diff options
| author | Eli Zaretskii | 2003-09-08 19:01:57 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2003-09-08 19:01:57 +0000 |
| commit | d5d78bd53e5bc03744fb55c62ba5330c498c5973 (patch) | |
| tree | 7311be32a4682f7f7f88a531db8c030a9f09486a | |
| parent | cc7593b13f243e804fdb4a63f1132f30e98f1db5 (diff) | |
| download | emacs-d5d78bd53e5bc03744fb55c62ba5330c498c5973.tar.gz emacs-d5d78bd53e5bc03744fb55c62ba5330c498c5973.zip | |
Ensure that recentf correctly update the menu bar:
(recentf-menu-path,recentf-menu-before): Doc fix.
(recentf-menu-bar): New function.
(recentf-clear-data): Use it
(recentf-update-menu): Likewise. Use easy-menu-add-item instead
of easy-menu-change.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/recentf.el | 22 |
2 files changed, 23 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d8ec8b18b1d..59d0a9a86dc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2003-09-08 David Ponce <david@dponce.com> | ||
| 2 | |||
| 3 | Ensure that recentf correctly update the menu bar. | ||
| 4 | * recentf.el (recentf-menu-path,recentf-menu-before): Doc fix. | ||
| 5 | (recentf-menu-bar): New function. | ||
| 6 | (recentf-clear-data): Use it | ||
| 7 | (recentf-update-menu): Likewise. Use easy-menu-add-item instead | ||
| 8 | of easy-menu-change. | ||
| 9 | |||
| 1 | 2003-09-08 Lute Kamstra <Lute.Kamstra@cwi.nl> | 10 | 2003-09-08 Lute Kamstra <Lute.Kamstra@cwi.nl> |
| 2 | 11 | ||
| 3 | * simple.el (size-indication-mode): New. | 12 | * simple.el (size-indication-mode): New. |
diff --git a/lisp/recentf.el b/lisp/recentf.el index 5a66a26428b..76c29995a57 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | ;; Maintainer: FSF | 8 | ;; Maintainer: FSF |
| 9 | ;; Keywords: files | 9 | ;; Keywords: files |
| 10 | 10 | ||
| 11 | (defconst recentf-version "$Revision: 1.24 $") | 11 | (defconst recentf-version "$Revision: 1.25 $") |
| 12 | 12 | ||
| 13 | ;; This file is part of GNU Emacs. | 13 | ;; This file is part of GNU Emacs. |
| 14 | 14 | ||
| @@ -98,7 +98,7 @@ Set VARIABLE with VALUE, and force a rebuild of the recentf menu." | |||
| 98 | 98 | ||
| 99 | (defcustom recentf-menu-path '("files") | 99 | (defcustom recentf-menu-path '("files") |
| 100 | "*Path where to add the recentf menu. | 100 | "*Path where to add the recentf menu. |
| 101 | If nil add it at top level (see also `easy-menu-change')." | 101 | If nil add it at top level (see also `easy-menu-add-item')." |
| 102 | :group 'recentf | 102 | :group 'recentf |
| 103 | :type '(choice (const :tag "Top Level" nil) | 103 | :type '(choice (const :tag "Top Level" nil) |
| 104 | (sexp :tag "Menu Path")) | 104 | (sexp :tag "Menu Path")) |
| @@ -106,7 +106,7 @@ If nil add it at top level (see also `easy-menu-change')." | |||
| 106 | 106 | ||
| 107 | (defcustom recentf-menu-before "Open File..." | 107 | (defcustom recentf-menu-before "Open File..." |
| 108 | "*Name of the menu before which the recentf menu will be added. | 108 | "*Name of the menu before which the recentf menu will be added. |
| 109 | If nil add it at end of menu (see also `easy-menu-change')." | 109 | If nil add it at end of menu (see also `easy-menu-add-item')." |
| 110 | :group 'recentf | 110 | :group 'recentf |
| 111 | :type '(choice (string :tag "Name") | 111 | :type '(choice (string :tag "Name") |
| 112 | (const :tag "Last" nil)) | 112 | (const :tag "Last" nil)) |
| @@ -520,10 +520,15 @@ menu-elements (no sub-menu)." | |||
| 520 | :help (concat "Open " value) | 520 | :help (concat "Open " value) |
| 521 | :active t)))) | 521 | :active t)))) |
| 522 | 522 | ||
| 523 | (defsubst recentf-menu-bar () | ||
| 524 | "Return the keymap of the global menu bar." | ||
| 525 | (lookup-key global-map [menu-bar])) | ||
| 526 | |||
| 523 | (defun recentf-clear-data () | 527 | (defun recentf-clear-data () |
| 524 | "Clear data used to build the recentf menu. | 528 | "Clear data used to build the recentf menu. |
| 525 | This force a rebuild of the menu." | 529 | This force a rebuild of the menu." |
| 526 | (easy-menu-remove-item nil recentf-menu-path recentf-menu-title) | 530 | (easy-menu-remove-item (recentf-menu-bar) |
| 531 | recentf-menu-path recentf-menu-title) | ||
| 527 | (setq recentf-data-cache nil)) | 532 | (setq recentf-data-cache nil)) |
| 528 | 533 | ||
| 529 | ;;; Predefined menu filters | 534 | ;;; Predefined menu filters |
| @@ -916,10 +921,11 @@ That is, remove a non readable file from the recent list, if | |||
| 916 | (unless (equal recentf-data-cache cache) | 921 | (unless (equal recentf-data-cache cache) |
| 917 | (setq recentf-data-cache cache) | 922 | (setq recentf-data-cache cache) |
| 918 | (condition-case err | 923 | (condition-case err |
| 919 | (easy-menu-change recentf-menu-path | 924 | (easy-menu-add-item |
| 920 | recentf-menu-title | 925 | (recentf-menu-bar) recentf-menu-path |
| 921 | (recentf-make-menu-items) | 926 | (easy-menu-create-menu recentf-menu-title |
| 922 | recentf-menu-before) | 927 | (recentf-make-menu-items)) |
| 928 | recentf-menu-before) | ||
| 923 | (error | 929 | (error |
| 924 | (message "recentf update menu failed: %s" | 930 | (message "recentf update menu failed: %s" |
| 925 | (error-message-string err))))))) | 931 | (error-message-string err))))))) |