aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Gallagher2012-06-19 15:05:44 +0800
committerChong Yidong2012-06-19 15:05:44 +0800
commitb382031894a7b3ade1d9f9e28249e9262f12e54f (patch)
tree7276ff19332d111bd8f24d3d974857888086ce91
parentc6bf30222430f41fbb696e296f0f63f465eefc35 (diff)
downloademacs-b382031894a7b3ade1d9f9e28249e9262f12e54f.tar.gz
emacs-b382031894a7b3ade1d9f9e28249e9262f12e54f.zip
In EDT emulator, allow updating of menu-bar Buffers menu.
* lisp/emulation/edt.el (edt-default-menu-bar-update-buffers) (edt-user-menu-bar-update-buffers): New functions. (edt-default-emulation-setup, edt-user-emulation-setup): Use them.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emulation/edt.el24
2 files changed, 25 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 71326e10748..e8332a701a8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-06-19 Kevin Gallagher <Kevin.Gallagher@boeing.com>
2
3 * emulation/edt.el (edt-default-menu-bar-update-buffers)
4 (edt-user-menu-bar-update-buffers): New functions.
5 (edt-default-emulation-setup, edt-user-emulation-setup): Use them.
6
12012-06-19 Chong Yidong <cyd@gnu.org> 72012-06-19 Chong Yidong <cyd@gnu.org>
2 8
3 * subr.el (with-selected-window): Preserve the selected window's 9 * subr.el (with-selected-window): Preserve the selected window's
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index fbb2359ca1f..dbd13a01a8b 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -2071,6 +2071,20 @@ created."
2071 (setq transient-mark-mode edt-orig-transient-mark-mode)) 2071 (setq transient-mark-mode edt-orig-transient-mark-mode))
2072 (message "Original key bindings restored; EDT Emulation disabled")) 2072 (message "Original key bindings restored; EDT Emulation disabled"))
2073 2073
2074(defun edt-default-menu-bar-update-buffers ()
2075 ;; Update edt-default-global-map with latest copy of
2076 ;; `global-buffers-menu-map' each time `menu-bar-update-buffers'
2077 ;; updates global-map.
2078 (define-key edt-default-global-map [menu-bar buffer]
2079 (cons "Buffers" global-buffers-menu-map)))
2080
2081(defun edt-user-menu-bar-update-buffers ()
2082 ;; We need to update edt-user-global-map with latest copy of
2083 ;; `global-buffers-menu-map' each time `menu-bar-update-buffers'
2084 ;; updates global-map.
2085 (define-key edt-user-global-map [menu-bar buffer]
2086 (cons "Buffers" global-buffers-menu-map)))
2087
2074(defun edt-default-emulation-setup (&optional user-setup) 2088(defun edt-default-emulation-setup (&optional user-setup)
2075 "Setup emulation of DEC's EDT editor. 2089 "Setup emulation of DEC's EDT editor.
2076Optional argument USER-SETUP non-nil means called from function 2090Optional argument USER-SETUP non-nil means called from function
@@ -2110,10 +2124,8 @@ Optional argument USER-SETUP non-nil means called from function
2110 (progn 2124 (progn
2111 (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map)) 2125 (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map))
2112 (edt-select-default-global-map))) 2126 (edt-select-default-global-map)))
2113 ;; We need to share `global-buffers-menu-map' with the saved global 2127 ;; Keep the menu bar Buffers menu up-to-date in edt-default-global-map.
2114 ;; keymap, because `menu-bar-update-buffers' directly changes it. 2128 (add-hook 'menu-bar-update-hook 'edt-default-menu-bar-update-buffers))
2115 (define-key (current-global-map) [menu-bar buffer]
2116 (cons "Buffers" global-buffers-menu-map)))
2117 2129
2118(defun edt-user-emulation-setup () 2130(defun edt-user-emulation-setup ()
2119 "Setup user custom emulation of DEC's EDT editor." 2131 "Setup user custom emulation of DEC's EDT editor."
@@ -2134,7 +2146,9 @@ Optional argument USER-SETUP non-nil means called from function
2134 ;; See Info node `edt' for more details, and sample edt-user.el file. 2146 ;; See Info node `edt' for more details, and sample edt-user.el file.
2135 (if (fboundp 'edt-setup-user-bindings) 2147 (if (fboundp 'edt-setup-user-bindings)
2136 (edt-setup-user-bindings)) 2148 (edt-setup-user-bindings))
2137 (edt-select-user-global-map)) 2149 (edt-select-user-global-map)
2150 ;; Keep the menu bar Buffers menu up-to-date in edt-user-global-map.
2151 (add-hook 'menu-bar-update-hook 'edt-user-menu-bar-update-buffers))
2138 2152
2139(defun edt-select-default-global-map() 2153(defun edt-select-default-global-map()
2140 "Select default EDT emulation key bindings." 2154 "Select default EDT emulation key bindings."