emacs-devel
[Top][All Lists]
Advanced

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

Re: easy-menu-define keys for key-valid-p (was: Info-mode patch)


From: Eli Zaretskii
Subject: Re: easy-menu-define keys for key-valid-p (was: Info-mode patch)
Date: Tue, 04 Jul 2023 14:33:25 +0300

> From: Juri Linkov <juri@linkov.net>
> Cc: arthur.miller@live.com,  emacs-devel@gnu.org
> Date: Tue, 04 Jul 2023 09:50:47 +0300
> 
> >> This symbol is generated automatically by 'easy-menu-define'
> >> from the menu item "Back in History" with spaces inside.
> >
> > key-valid-p invalidates keys that have embedded whitespace, so we need
> > to decide whether we want to add that or modify easy-menu-define to
> > produce more reasonable symbols.
> 
> Currently easy-menu-intern keeps spaces in strings:
> 
>   (defsubst easy-menu-intern (s)
>     (if (stringp s) (intern s) s))
> 
> Replacing it with:
> 
>   (defsubst easy-menu-intern (s)
>     (if (stringp s) (intern (string-replace " " "-" (downcase s))) s))
> 
> produces from the menu item "Back in History" a more reasonable
> symbol 'back-in-history' for which
> 
>   (key-valid-p "<tool-bar> C-<back-in-history>")
> 
> returns t and can be used in defvar-keymap.
> 
> OTOH, [tool-bar C-Back\ in\ history] worked in 27.2 but broke in 28.2
> with "<tool-bar> C-<Back in History> is undefined".
> 
> After the change above, [tool-bar C-back-in-history] works again.

Stefan, WDYT about this?  What is the best way of fixing this
inconsistency between easy-menu-define and key-valid-p?



reply via email to

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