emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorth


From: Gregory Heytings
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


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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]