Subject: bug#25191: Redesign `recentf-menu-bar' logic and its callers

From: Alexander Shukaev <[email-masked]>
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