Protect against unlikely case of [menu-bar] not being bound
* lisp/recentf.el (recentf-show-menu): (recentf-hide-menu): The [menu-bar] key may be unbound (bug#25191).
This commit is contained in:
parent
3d0d2d1a19
commit
fdf7349b1c
1 changed files with 8 additions and 6 deletions
|
@ -658,15 +658,17 @@ Return nil if file NAME is not one of the ten more recent."
|
|||
|
||||
(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))
|
||||
(when (keymapp (recentf-menu-bar))
|
||||
(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))
|
||||
(when (keymapp (recentf-menu-bar))
|
||||
(easy-menu-remove-item (recentf-menu-bar) recentf-menu-path
|
||||
recentf-menu-title)))
|
||||
|
||||
;;; Predefined menu filters
|
||||
;;
|
||||
|
|
Loading…
Add table
Reference in a new issue