From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.devel Subject: Re: Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorthands have landed on master) Date: Mon, 04 Oct 2021 13:09:25 +0000 Message-ID: <6c69780538d3aad9ad1e@heytings.org> References: <16338bdc2497fc51c6fb6d54ab370bfb@webmail.orcon.net.nz> <831r59kyhf.fsf@gnu.org> <834ka4k15m.fsf@gnu.org> <83y27gijmz.fsf@gnu.org> <8335pmgnjy.fsf@gnu.org> <604da2cb10ac61f2b8b89a02c89056be@webmail.orcon.net.nz> <83a6jtff87.fsf@gnu.org> <5ac7a31cf2959c31c262a3377c736a5a@webmail.orcon.net.nz> <83ilygew7p.fsf@gnu.org> <83fstjdiwl.fsf@gnu.org> <871r534s2o.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25635"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 04 15:11:21 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXNkU-0006Q3-U2 for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Oct 2021 15:11:19 +0200 Original-Received: from localhost ([::1]:44470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXNkT-0001BA-Vp for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Oct 2021 09:11:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXNik-0007sL-5e for emacs-devel@gnu.org; Mon, 04 Oct 2021 09:09:30 -0400 Original-Received: from heytings.org ([95.142.160.155]:36818) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXNii-0003mK-I4; Mon, 04 Oct 2021 09:09:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1633352966; bh=jy3uSilQSMSmjmFzXaK+QTl+ROH0+bRFNg+VV0h+HxQ=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=kV6taYw+RUWhTyi6NXCQipOHob4u0KAmVfoCvSZRHBJn7iN2f8RtKqn3jYvRNj1gK +96UrFXENp3O9A5/ess++W7NnELahgwd/DeTdHJy7Jlv/VPk2ZCea16n7n3MrO6AUt aFk3Z4K9c+n9AqWyj9dI28xCvqtiQ6lAjH2zxLHJCKeU+/GaQmRqewqiTDN7DDGVnB yB/09WRK2CU8WHRBy7N8Bs+iSyNf5GAlvf6TYodQABW+94xraXKBzRLNT2UA+Feui5 glM6RLzccaJ+m/qUBvlID6CRt67hD/d+T5xR0vTjz3vus3AbvfQQI8szgb56L56+Rr /+f2sbYjgeZ0Q== In-Reply-To: Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:276183 Archived-At: >>> The name known to Emacs is "string-library-foo" (or whatever). >>> >>> The user types "C-h o s-foo RET" and Emacs says "no match". > > If the user switches to a buffer which contains a Lisp program that > requires s, then types C-h o s-foo RET, or C-h f s-foo RET, I think it > would make sense for it to find s-foo. > That's yet another problem introduced by that system. Suppose a user has an Emacs session opened, with two windows: the top one contains a buffer with a (require 'string-library) and a elisp-shorthands (("s-" . "string-library-")), and the bottom one contains a text buffer. Now: (1) If the currently selected window is the top one: (1.1) If point is on s-foo, C-h o will suggest string-library-foo. So far so good. (1.2) If the user is not on s-foo, C-h o s - f o o RET will currently return "No match". Unless of course an s-foo function or variable defined is already defined elsewhere, in which case it's that function or variable that will be found, and the user will get a possibly wrong information. That could perhaps be fixed by copying the value of elisp-shorthands in the minibuffer buffer-local variables, in which case s-foo will automatically be expanded into string-library-foo. The same would be necessary for M-:, C-h f, C-h v, and perhaps M-x. (1.3) The fix in (1.2) would however break another use case: the buffer in the top window was entered with M-., the function that is visible does not use any of the string-library functions, which means that the user does not know that s-foo expands into string-library-foo. What they actually want is perhaps to see the documentation of the s-foo function or variable that they know and that is defined elsewhere, and C-h o s - f o o RET will display the documentation of string-library-foo instead. (1.4) The fix in (1.2) would also not be enough when recursive minibuffers enter the scene, see (2). (1.5) If the fix in (1.2) is not used for M-x, M-x s-frobnicate will not expand into string-library-frobnicate. If the fix in (1.2) is used for M-x, M-x s-mode will become M-x string-library-mode. Both are obviously problematic. (2) If the currently selected window is not the top one (it is either in the minibuffer or in the bottom window), C-h o s - f o o will again return "No match", unless of course an s-foo function or variable is already defined elsewhere, in which case the user will get a wrong information.