changeset 79167:cc88b3f9bb72

(global-buffers-menu-map): New var. (global-map, menu-bar-update-buffers): Use it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 22 Oct 2007 04:10:04 +0000
parents 93a637a2f2a0
children a14b49f75b09
files lisp/ChangeLog lisp/menu-bar.el
diffstat 2 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Oct 21 07:53:06 2007 +0000
+++ b/lisp/ChangeLog	Mon Oct 22 04:10:04 2007 +0000
@@ -1,3 +1,8 @@
+2007-10-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* menu-bar.el (global-buffers-menu-map): New var.
+	(global-map, menu-bar-update-buffers): Use it.
+
 2007-10-21  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* hexl.el (hexl-menu): New major mode menu.
@@ -58,6 +63,11 @@
 	* progmodes/cc-menus.el (cc-imenu-c++-generic-expression):
 	Tweak regexp to avoid stack overflow.
 
+2007-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* simple.el (reindent-then-newline-and-indent): Don't assume that
+	indent-according-to-mode preserves point.
+
 2007-10-16  Juanma Barranquero  <lekktu@gmail.com>
 
 	* bs.el (bs--window-config-coming-from): Revert 2006-11-09 change.
--- a/lisp/menu-bar.el	Sun Oct 21 07:53:06 2007 +0000
+++ b/lisp/menu-bar.el	Mon Oct 22 04:10:04 2007 +0000
@@ -56,9 +56,10 @@
 (defvar menu-bar-tools-menu (make-sparse-keymap "Tools"))
 (define-key global-map [menu-bar tools] (cons "Tools" menu-bar-tools-menu))
 ;; This definition is just to show what this looks like.
-;; It gets overridden below when menu-bar-update-buffers is called.
+;; It gets modified in place when menu-bar-update-buffers is called.
+(defvar global-buffers-menu-map (make-sparse-keymap "Buffers"))
 (define-key global-map [menu-bar buffer]
-  (cons "Buffers" (make-sparse-keymap "Buffers")))
+  (cons "Buffers" global-buffers-menu-map))
 (defvar menu-bar-options-menu (make-sparse-keymap "Options"))
 (define-key global-map [menu-bar options]
   (cons "Options" menu-bar-options-menu))
@@ -1576,7 +1577,7 @@
        (or force (frame-or-buffer-changed-p))
        (let ((buffers (buffer-list))
 	     (frames (frame-list))
-	     buffers-menu frames-menu)
+	     buffers-menu)
 	 ;; If requested, list only the N most recently selected buffers.
 	 (if (and (integerp buffers-menu-max-size)
 		  (> buffers-menu-max-size 1))
@@ -1677,10 +1678,10 @@
 	 (setq buffers-menu
 	       (nconc buffers-menu menu-bar-buffers-menu-command-entries))
 
-	 (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu)))
-	 (define-key (current-global-map) [menu-bar buffer]
-	   ;; Call copy-sequence so the string is not pure.
-	   (cons (copy-sequence "Buffers") buffers-menu)))))
+         ;; We used to "(define-key (current-global-map) [menu-bar buffer]"
+         ;; but that did not do the right thing when the [menu-bar buffer]
+         ;; entry above had been moved (e.g. to a parent keymap).
+	 (setcdr global-buffers-menu-map (cons "Select Buffer" buffers-menu)))))
 
 (add-hook 'menu-bar-update-hook 'menu-bar-update-buffers)
 
@@ -1773,5 +1774,5 @@
 
 (provide 'menu-bar)
 
-;;; arch-tag: 6e6a3c22-4ec4-4d3d-8190-583f8ef94ced
+;; arch-tag: 6e6a3c22-4ec4-4d3d-8190-583f8ef94ced
 ;;; menu-bar.el ends here