Commit 0595c9f9 authored by Glenn Morris's avatar Glenn Morris
Browse files

(mouse-major-mode-menu): Suppress duplicate menus.

parent 15d62167
2008-01-05 Ralf Angeli <>
2008-01-08 Glenn Morris <>
* mouse.el (mouse-major-mode-menu): Suppress duplicate menus.
2008-01-08 Ralf Angeli <>
* textmodes/reftex-toc.el (reftex-make-separate-toc-frame):
Simplify selection of frame focusing function.
......@@ -194,11 +194,22 @@ Default to the Edit menu if the major mode doesn't define a menu."
(newmap (if ancestor
(make-sparse-keymap (concat (format-mode-line mode-name)
" Mode"))
(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.
(set-keymap-parent newmap
(dolist (e ancestor)
(unless (and (listp e)
(assoc (car e) uniq))
(setq uniq (append uniq (list e)))))
(popup-menu newmap event prefix)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment