GNU bug report logs - #25191
`recentf-menu-bar' assumes [menu-bar] is bound in global-map

Previous Next

Package: emacs;

Reported by: Alexander Shukaev <emacs <at> Alexander.Shukaev.name>

Date: Tue, 13 Dec 2016 01:00:02 UTC

Severity: minor

Tags: fixed

Fixed in version 27.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 25191 in the body.
You can then email your comments to 25191 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#25191; Package emacs. (Tue, 13 Dec 2016 01:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alexander Shukaev <emacs <at> Alexander.Shukaev.name>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 13 Dec 2016 01:00:02 GMT) Full text and rfc822 format available.

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

From: Alexander Shukaev <emacs <at> Alexander.Shukaev.name>
To: bug-gnu-emacs <at> gnu.org
Subject: Redesign `recentf-menu-bar' logic and its callers
Date: Tue, 13 Dec 2016 01:59:34 +0100
Hi,

consider

(defsubst recentf-menu-bar ()
  "Return the keymap of the global menu bar."
  (lookup-key global-map [menu-bar]))

(defun recentf-show-menu ()
  "Show the menu of recently opened files."
  (easy-menu-add-item
   (recentf-menu-bar) recentf-menu-path
   (list recentf-menu-title :filter 'recentf-make-menu-items)
   recentf-menu-before))

(defun recentf-hide-menu ()
  "Hide the menu of recently opened files."
  (easy-menu-remove-item (recentf-menu-bar) recentf-menu-path
                         recentf-menu-title))

from 'recentf.el'.  This code is ill-formed.  When `global-map' is 
customized in such a way that it does not have `(kbd "<menu-bar>")' (or 
`[menu-bar]'), then both `recentf-show-menu' and `recentf-hide-menu' 
will fail.  Furthermore, according to Emacs documentation, using 
`(current-global-map)' is more correct than `global-map'.

Looking forward to fix.

Regards,
Alexander




Changed bug title to '`recentf-menu-bar' assumes [menu-bar] is bound in global-map' from 'Redesign `recentf-menu-bar' logic and its callers' Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Mon, 04 Dec 2017 06:31:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25191; Package emacs. (Wed, 09 Oct 2019 07:47:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alexander Shukaev <emacs <at> Alexander.Shukaev.name>
Cc: 25191 <at> debbugs.gnu.org
Subject: Re: bug#25191: Redesign `recentf-menu-bar' logic and its callers
Date: Wed, 09 Oct 2019 09:46:16 +0200
Alexander Shukaev <emacs <at> Alexander.Shukaev.name> writes:

> (defsubst recentf-menu-bar ()
>   "Return the keymap of the global menu bar."
>   (lookup-key global-map [menu-bar]))
>
> (defun recentf-show-menu ()
>   "Show the menu of recently opened files."
>   (easy-menu-add-item
>    (recentf-menu-bar) recentf-menu-path
>    (list recentf-menu-title :filter 'recentf-make-menu-items)
>    recentf-menu-before))
>
> (defun recentf-hide-menu ()
>   "Hide the menu of recently opened files."
>   (easy-menu-remove-item (recentf-menu-bar) recentf-menu-path
>                          recentf-menu-title))
>
> from 'recentf.el'.  This code is ill-formed.  When `global-map' is
> customized in such a way that it does not have `(kbd "<menu-bar>")'
> (or `[menu-bar]'), then both `recentf-show-menu' and
> `recentf-hide-menu' will fail.

I've now added checks to protect against this in Emacs 27.

> Furthermore, according to Emacs documentation, using
> `(current-global-map)' is more correct than `global-map'.

That's true, but I think fixing that is more a matter of somebody
grepping and replacing rather than fixing piecemeal, perhaps...

-- 
(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, 09 Oct 2019 07:47:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 25191 <at> debbugs.gnu.org and Alexander Shukaev <emacs <at> Alexander.Shukaev.name> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 09 Oct 2019 07:47: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, 06 Nov 2019 12:24:15 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 170 days ago.

Previous Next


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