diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-09 09:45:07 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-09 09:45:07 +0200 |
commit | fdf7349b1c4b0d599208761af948bd1d6f2434fd (patch) | |
tree | 1882927f47d27746193de6f03f78fbe93e7ad577 /lisp/recentf.el | |
parent | 3d0d2d1a195072d7683b88757f63e8e953988cfb (diff) | |
download | emacs-fdf7349b1c4b0d599208761af948bd1d6f2434fd.tar.gz emacs-fdf7349b1c4b0d599208761af948bd1d6f2434fd.tar.bz2 emacs-fdf7349b1c4b0d599208761af948bd1d6f2434fd.zip |
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).
Diffstat (limited to 'lisp/recentf.el')
-rw-r--r-- | lisp/recentf.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/recentf.el b/lisp/recentf.el index 2720286814a..83c71a561a9 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -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 ;; |