[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: RE: menu entries missing display of equivalent keybo
Re: address@hidden: RE: menu entries missing display of equivalent keyboard sequence]
Wed, 15 Jan 2003 19:13:17 -0500
> The problem below is caused by the where_is_cache, which I believe you
Actually, the problem is not caused by this at all. It's caused by another
problem: the way `nomenus' was implemented in Emacs-20 was that any binding
that had a "menu-item" shape (either old-style or new-style) was considered
as a menu binding and was thus not listed in the shortcuts.
I wanted to change that so that "Edit => Text Properties => Face => Bold"
shows the "M-g b" shortcut (even though the M-g prefix uses the HierarKey
thingy to display a "menu in the minibuffer", which relies on menu-items
as well, which is why the M-g b shortcut is missing in Emacs-20).
So now, the problem is "what is a menu binding" ?
In Emacs-21, I defined it as "a key sequence whose first key is
a symbol". Clearly, it's pretty arbitrary as well, since as is seen
in Andrew's example, it rules out "f8 d", but it was chosen because
it correctly rules out the menu-bar bindings, the tool-bar bindings,
and the FOO-down-mouse-N popup menus bindings.
The offending lines are in keymap.c:
/* if (nomenus && !ascii_sequence_p (this)) */
if (nomenus && XINT (last) >= 0
&& !INTEGERP (Faref (this, make_number (0))))
/* If no menu entries should be returned, skip over the
keymaps bound to `menu-bar' and `tool-bar' and other
non-ascii prefixes like `C-down-mouse-2'. */
> I think the simplest fix is to get rid of that cache. As far as I can
> see, it is active only in the case of lookup for menu items equivalent
> key bindings, and it's unnecessary in that case because the menu
> itself caches the equivalent key bindings.
> Is there some case where where_is_cache really provides service?
> If so, would you like to fix this bug?
> Please respond.
> ------- Start of forwarded message -------
> From: address@hidden
> To: address@hidden
> Date: Fri, 20 Dec 2002 12:29:40 -0500
> cc: address@hidden
> Subject: RE: menu entries missing display of equivalent keyboard sequence
> Sender: address@hidden
> Here is some example lisp that works in 20.7 but not in 21.2
> (defun andrew-fn ()
> (message "Hello"))
> (setq andrew-map (make-sparse-keymap "Andrew"))
> (put 'andrew-fn 'menu-enable t)
> ;(define-key andrew-map "F" nil)
> (define-key andrew-map [andrew-function] '("My function" . andrew-fn))
> (define-key global-map [menu-bar andrew] andrew-map)
> (define-key-after (lookup-key global-map [menu-bar]) [andrew]
> (cons "Andrew" andrew-map) 'dev)
> (setq f8-map (make-sparse-keymap))
> (fset 'f8-map f8-map)
> (define-key f8-map "d" 'andrew-fn)
> (define-key global-map [f8] 'f8-map)
> > -----Original Message-----
> > From: Andrew Maguire [mailto:address@hidden
> > Sent: 20 December 2002 15:42
> > To: address@hidden; Maguire, Andrew (PS, GENS)
> > Subject: menu entries missing display of equivalent keyboard sequence
> > This bug report will be sent to the Free Software Foundation,
> > not to your local site managers!
> > Please write in English, because the Emacs maintainers do not have
> > translators to read other languages for them.
> > Your bug report will be posted to the address@hidden
> > mailing list,
> > and to the gnu.emacs.bug news group.
> > In GNU Emacs 21.2.1 (sparc-sun-solaris2.6, X toolkit)
> > of 2002-07-11 on albany
> > configured using `configure --libexecdir=/usr/local/lib'
> > Important settings:
> > value of $LC_ALL: nil
> > value of $LC_COLLATE: en_GB.ISO8859-15
> > value of $LC_CTYPE: en_GB.ISO8859-15
> > value of $LC_MESSAGES: C
> > value of $LC_MONETARY: en_GB.ISO8859-15
> > value of $LC_NUMERIC: en_GB.ISO8859-15
> > value of $LC_TIME: en_GB.ISO8859-15
> > value of $LANG: en_GB.ISO8859-15
> > locale-coding-system: iso-latin-9
> > default-enable-multibyte-characters: t
> > Please describe exactly what actions triggered the bug
> > and the precise symptoms of the bug:
> > The code I have defines various global keys, creates a couple of
> > menu-bar general entries and some major mode specific ones
> > but the menu entries do not show their equivalent keyboard shortcuts.
> > (Apart from one that is defined on f1.) I am just using the simple
> > method for defining menu entries i.e. I am not using (menu-item ...).
> > The problem alsoo occurs on the Windows build 21.2.1 on buffy.
> > The menu entries for the standard menus is there, Fil, Edit, Help etc.
> > It just seems that the is something up with the mechanism that
> > calculates the shortcut keys and the caching in the keymap definition.
> > My code is fine on Emacs 20.7.
> > Can I force a recalculation of the caching of keysequences?
> > Thanks in advance,
> > Andrew Maguire
> > Recent input:
> > <down> <return> <help-echo> <down-mouse-2> <help-echo>
> > <mouse-2> <down-mouse-1> <mouse-1> <next> <next> <next>
> > <prior> <prior> <C-home> <next> <next> <next> <next>
> > <next> <next> <next> C-s c o n s C-s C-s C-s C-s C-s
> > C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s <down>
> > <next> C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s
> > C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s <down>
> > <down> <down> <down> <down> <down> <down> <down> <down>
> > <down> <help-echo> <down-mouse-1> <mouse-1> C-h C-g
> > C-x b * i n <tab> <return> <prior> <help-echo> <help-echo>
> > <help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
> > <help-echo> <menu-bar> <help-menu> <report-emacs-b
> > ug>
> > Recent messages:
> > setq: Quit [2 times]
> > Starting gis version selection...
> > Type C-x 1 to remove help window. C-M-v to scroll the help.
> > call-interactively: Quit
> > list: Quit
> > sw-half-scroll-down: Beginning of buffer
> > Mark set
> > Mark saved where search started [2 times]
> > Loading emacsbug...done
> Bug-gnu-emacs mailing list
> ------- End of forwarded message -------
- Re: address@hidden: RE: menu entries missing display of equivalent keyboard sequence],
Stefan Monnier <=