emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mouse.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/mouse.el,v
Date: Tue, 08 Jan 2008 05:12:50 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/01/08 05:12:50

Index: mouse.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mouse.el,v
retrieving revision 1.325
retrieving revision 1.326
diff -u -b -r1.325 -r1.326
--- mouse.el    4 Jan 2008 08:34:14 -0000       1.325
+++ mouse.el    8 Jan 2008 05:12:50 -0000       1.326
@@ -194,11 +194,22 @@
         (newmap (if ancestor
                     (make-sparse-keymap (concat (format-mode-line mode-name)
                                                  " Mode"))
-                  menu-bar-edit-menu)))
+                  menu-bar-edit-menu))
+        uniq)
     (if ancestor
        ;; Make our menu inherit from the desired keymap which we want
        ;; to display as the menu now.
-       (set-keymap-parent newmap ancestor))
+       ;; Sometimes keymaps contain duplicate menu code, leading to
+       ;; duplicates in the popped-up menu. Avoid this by simply
+       ;; taking the first of any identically-named menus.
+       ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg00469.html
+       (set-keymap-parent newmap
+                          (progn
+                            (dolist (e ancestor)
+                              (unless (and (listp e)
+                                           (assoc (car e) uniq))
+                                (setq uniq (append uniq (list e)))))
+                            uniq)))
     (popup-menu newmap event prefix)))
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]