unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Alexander Shukaev <emacs@Alexander.Shukaev.name>
Cc: 25191@debbugs.gnu.org
Subject: bug#25191: Redesign `recentf-menu-bar' logic and its callers
Date: Wed, 09 Oct 2019 09:46:16 +0200	[thread overview]
Message-ID: <87v9sypdiv.fsf@gnus.org> (raw)
In-Reply-To: <f186d126-cb3a-3a28-e0fb-33385b8ffae6@Alexander.Shukaev.name> (Alexander Shukaev's message of "Tue, 13 Dec 2016 01:59:34 +0100")

Alexander Shukaev <emacs@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





      parent reply	other threads:[~2019-10-09  7:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13  0:59 bug#25191: Redesign `recentf-menu-bar' logic and its callers Alexander Shukaev
2017-06-10 12:59 ` bug#27306: Regression: Emacs Lisp Indentation Alexander Shukaev
2017-06-10 15:33   ` npostavs
2017-06-13 11:27     ` npostavs
2017-06-16  7:39       ` Alexander Shukaev
2017-06-10 19:00   ` bug#27315: Regression: `abbreviate-file-name' and `tramp-file-name-handler' Alexander Shukaev
2017-06-11  9:13     ` Michael Albinus
2017-06-11 11:30       ` Alexander Shukaev
2017-06-12 15:59         ` Michael Albinus
2017-06-13 21:55           ` Alexander Shukaev
2017-06-14 12:38             ` Michael Albinus
2017-06-16  7:33               ` Alexander Shukaev
2017-06-16  8:39                 ` Michael Albinus
2019-10-09  7:46 ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9sypdiv.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=25191@debbugs.gnu.org \
    --cc=emacs@Alexander.Shukaev.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).