GNU bug report logs - #14257
24.3.50; (elisp) `Modifying Menus' - clarify second example

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Wed, 24 Apr 2013 16:27:01 UTC

Severity: minor

Tags: fixed

Found in version 24.3.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14257 in the body.
You can then email your comments to 14257 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14257; Package emacs. (Wed, 24 Apr 2013 16:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 24 Apr 2013 16:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.3.50; (elisp) `Modifying Menus' - clarify second example
Date: Wed, 24 Apr 2013 09:21:08 -0700
It might help if some motivation were given for the second example:
 
 (define-key-after
   (lookup-key shell-mode-map [menu-bar signals])
   [work] '("Work" . work-command) 'break)
 
My guess is that that example was added to tell users how to deal with
the error that used to be raised if you used something like this:
 
 (define-key-after minibuffer-local-completion-map
   [menu-bar minibuf foo]
   '(menu-item "Foo" foo) 'quit)
 
Instead of this:
 
 (define-key-after (lookup-key minibuffer-local-completion-map
                               [menu-bar minibuf])
   [foo]
   '(menu-item "Foo" foo) 'quit)
 
That error is no longer raised.  And the doc string has been updated to
no longer say this:
 
 "KEY must contain just one event type--that is to say, it must be a
  string or vector of length 1."
 
If the example still has a purpose (some other purpose), then consider
mentioning it.
 
And it would at least help to mention that the `lookup-key' sexp in the
example returns a keymap, not a key.  Without knowing that, the second
example would not make much sense (hence, some readers will guess it,
but it would still help to mention it).
 
 
 

In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2013-04-17 on ODIEONE
Bzr revision: 112320 monnier <at> iro.umontreal.ca-20130418001233-g6wsqi5bpq2hsd0k
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14257; Package emacs. (Wed, 20 Jan 2021 03:20:02 GMT) Full text and rfc822 format available.

Message #8 received at 14257 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 14257 <at> debbugs.gnu.org
Subject: Re: bug#14257: 24.3.50; (elisp) `Modifying Menus' - clarify second
 example
Date: Wed, 20 Jan 2021 04:19:14 +0100
"Drew Adams" <drew.adams <at> oracle.com> writes:

> It might help if some motivation were given for the second example:
>
>  (define-key-after
>    (lookup-key shell-mode-map [menu-bar signals])
>    [work] '("Work" . work-command) 'break)
>
> My guess is that that example was added to tell users how to deal with
> the error that used to be raised if you used something like this:
>
>  (define-key-after minibuffer-local-completion-map
>    [menu-bar minibuf foo]
>    '(menu-item "Foo" foo) 'quit)
>
> Instead of this:
>
>  (define-key-after (lookup-key minibuffer-local-completion-map
>                                [menu-bar minibuf])
>    [foo]
>    '(menu-item "Foo" foo) 'quit)
>
> That error is no longer raised.

I've now altered the second example to be more like the first example in
Emacs 28.  It's perhaps useful to illustrate the other syntax, too, but
the first syntax is to be encouraged, I guess.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 20 Jan 2021 03:20:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 14257 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 20 Jan 2021 03:20:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 17 Feb 2021 12:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 40 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.