Mercurial > emacs
comparison lisp/mouse.el @ 65498:f2fdccb16607
2005-09-14 Chong Yidong <cyd@stupidchicken.com>
* mouse.el (mouse-major-mode-menu): Make `prefix' optional.
Delete unused local var.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Tue, 13 Sep 2005 20:13:31 +0000 |
parents | 3607a394b655 |
children | fcbaf6135d19 fa0da9b57058 |
comparison
equal
deleted
inserted
replaced
65497:bc64e5ea4657 | 65498:f2fdccb16607 |
---|---|
151 ;; mouse-major-mode-menu was using `command-execute' instead. | 151 ;; mouse-major-mode-menu was using `command-execute' instead. |
152 (call-interactively cmd)))) | 152 (call-interactively cmd)))) |
153 | 153 |
154 (defvar mouse-major-mode-menu-prefix) ; dynamically bound | 154 (defvar mouse-major-mode-menu-prefix) ; dynamically bound |
155 | 155 |
156 (defun mouse-major-mode-menu (event prefix) | 156 (defun mouse-major-mode-menu (event &optional prefix) |
157 "Pop up a mode-specific menu of mouse commands. | 157 "Pop up a mode-specific menu of mouse commands. |
158 Default to the Edit menu if the major mode doesn't define a menu." | 158 Default to the Edit menu if the major mode doesn't define a menu." |
159 ;; Switch to the window clicked on, because otherwise | 159 ;; Switch to the window clicked on, because otherwise |
160 ;; the mode's commands may not make sense. | 160 ;; the mode's commands may not make sense. |
161 (interactive "@e\nP") | 161 (interactive "@e\nP") |
171 (local-key-binding [menu-bar])))) | 171 (local-key-binding [menu-bar])))) |
172 ;; Make a keymap in which our last command leads to a menu or | 172 ;; Make a keymap in which our last command leads to a menu or |
173 ;; default to the edit menu. | 173 ;; default to the edit menu. |
174 (newmap (if ancestor | 174 (newmap (if ancestor |
175 (make-sparse-keymap (concat mode-name " Mode")) | 175 (make-sparse-keymap (concat mode-name " Mode")) |
176 menu-bar-edit-menu)) | 176 menu-bar-edit-menu))) |
177 result) | |
178 (if ancestor | 177 (if ancestor |
179 ;; Make our menu inherit from the desired keymap which we want | 178 ;; Make our menu inherit from the desired keymap which we want |
180 ;; to display as the menu now. | 179 ;; to display as the menu now. |
181 (set-keymap-parent newmap ancestor)) | 180 (set-keymap-parent newmap ancestor)) |
182 (popup-menu newmap event prefix))) | 181 (popup-menu newmap event prefix))) |