38412
|
1 ;;; menu-bar.el --- define a default menu bar
|
2488
|
2
|
64762
|
3 ;; Copyright (C) 1993, 1994, 1995, 2000, 2001, 2002, 2003, 2004,
|
79721
|
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
14169
|
5
|
2488
|
6 ;; Author: RMS
|
17970
|
7 ;; Maintainer: FSF
|
31461
|
8 ;; Keywords: internal, mouse
|
2488
|
9
|
2485
|
10 ;; This file is part of GNU Emacs.
|
|
11
|
94678
|
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
|
2485
|
13 ;; it under the terms of the GNU General Public License as published by
|
94678
|
14 ;; the Free Software Foundation, either version 3 of the License, or
|
|
15 ;; (at your option) any later version.
|
2485
|
16
|
|
17 ;; GNU Emacs is distributed in the hope that it will be useful,
|
|
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20 ;; GNU General Public License for more details.
|
|
21
|
|
22 ;; You should have received a copy of the GNU General Public License
|
94678
|
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
2485
|
24
|
12558
|
25 ;; Avishai Yacobi suggested some menu rearrangements.
|
|
26
|
38412
|
27 ;;; Commentary:
|
|
28
|
14169
|
29 ;;; Code:
|
|
30
|
4668
|
31 ;; Don't clobber an existing menu-bar keymap, to preserve any menu-bar key
|
|
32 ;; definitions made in loaddefs.el.
|
|
33 (or (lookup-key global-map [menu-bar])
|
|
34 (define-key global-map [menu-bar] (make-sparse-keymap "menu-bar")))
|
3504
|
35 (defvar menu-bar-help-menu (make-sparse-keymap "Help"))
|
11067
|
36
|
|
37 ;; Force Help item to come last, after the major mode's own items.
|
12199
|
38 ;; The symbol used to be called `help', but that gets confused with the
|
|
39 ;; help key.
|
|
40 (setq menu-bar-final-items '(help-menu))
|
11067
|
41
|
12199
|
42 (define-key global-map [menu-bar help-menu] (cons "Help" menu-bar-help-menu))
|
27730
|
43 (defvar menu-bar-tools-menu (make-sparse-keymap "Tools"))
|
|
44 (define-key global-map [menu-bar tools] (cons "Tools" menu-bar-tools-menu))
|
|
45 ;; This definition is just to show what this looks like.
|
79167
|
46 ;; It gets modified in place when menu-bar-update-buffers is called.
|
|
47 (defvar global-buffers-menu-map (make-sparse-keymap "Buffers"))
|
27730
|
48 (define-key global-map [menu-bar buffer]
|
79167
|
49 (cons "Buffers" global-buffers-menu-map))
|
27730
|
50 (defvar menu-bar-options-menu (make-sparse-keymap "Options"))
|
|
51 (define-key global-map [menu-bar options]
|
|
52 (cons "Options" menu-bar-options-menu))
|
3504
|
53 (defvar menu-bar-edit-menu (make-sparse-keymap "Edit"))
|
2178
|
54 (define-key global-map [menu-bar edit] (cons "Edit" menu-bar-edit-menu))
|
58041
|
55 (defvar menu-bar-file-menu (make-sparse-keymap "File"))
|
|
56 (define-key global-map [menu-bar file] (cons "File" menu-bar-file-menu))
|
11293
d24be7d7af5d
(menu-bar-file-menu): Add back as alias for menu-bar-files-menu.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
57
|
d24be7d7af5d
(menu-bar-file-menu): Add back as alias for menu-bar-files-menu.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
58 ;; This alias is for compatibility with 19.28 and before.
|
58041
|
59 (defvar menu-bar-files-menu menu-bar-file-menu)
|
44776
|
60
|
|
61 ;; This is referenced by some code below; it is defined in uniquify.el
|
|
62 (defvar uniquify-buffer-name-style)
|
|
63
|
8010
|
64
|
27730
|
65 ;; The "File" menu items
|
58041
|
66 (define-key menu-bar-file-menu [exit-emacs]
|
27730
|
67 '(menu-item "Exit Emacs" save-buffers-kill-emacs
|
97010
|
68 :keys "C-x C-c"
|
27730
|
69 :help "Save unsaved buffers, then exit"))
|
11067
|
70
|
58041
|
71 (define-key menu-bar-file-menu [separator-exit]
|
8010
|
72 '("--"))
|
|
73
|
27730
|
74 ;; Don't use delete-frame as event name because that is a special
|
|
75 ;; event.
|
58041
|
76 (define-key menu-bar-file-menu [delete-this-frame]
|
27730
|
77 '(menu-item "Delete Frame" delete-frame
|
|
78 :visible (fboundp 'delete-frame)
|
|
79 :enable (delete-frame-enabled-p)
|
|
80 :help "Delete currently selected frame"))
|
58041
|
81 (define-key menu-bar-file-menu [make-frame-on-display]
|
27730
|
82 '(menu-item "New Frame on Display..." make-frame-on-display
|
|
83 :visible (fboundp 'make-frame-on-display)
|
|
84 :help "Open a new frame on another display"))
|
58041
|
85 (define-key menu-bar-file-menu [make-frame]
|
27730
|
86 '(menu-item "New Frame" make-frame-command
|
|
87 :visible (fboundp 'make-frame-command)
|
|
88 :help "Open a new frame"))
|
|
89
|
58041
|
90 (define-key menu-bar-file-menu [one-window]
|
64822
518cb89f1f95
(menu-bar-file-menu): Rename some menu items and improve help strings.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
91 '(menu-item "Remove Splits" delete-other-windows
|
27730
|
92 :enable (not (one-window-p t nil))
|
64822
518cb89f1f95
(menu-bar-file-menu): Rename some menu items and improve help strings.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
93 :help "Selected window grows to fill the whole frame"))
|
11067
|
94
|
58041
|
95 (define-key menu-bar-file-menu [split-window]
|
27730
|
96 '(menu-item "Split Window" split-window-vertically
|
65404
|
97 :enable (and (menu-bar-menu-frame-live-and-visible-p)
|
|
98 (menu-bar-non-minibuffer-window-p))
|
64822
518cb89f1f95
(menu-bar-file-menu): Rename some menu items and improve help strings.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
99 :help "Split selected window in two windows"))
|
27730
|
100
|
58041
|
101 (define-key menu-bar-file-menu [separator-window]
|
27730
|
102 '(menu-item "--"))
|
|
103
|
58041
|
104 (define-key menu-bar-file-menu [ps-print-region]
|
35684
|
105 '(menu-item "Postscript Print Region (B+W)" ps-print-region
|
|
106 :enable mark-active
|
|
107 :help "Pretty-print marked region in black and white to PostScript printer"))
|
58041
|
108 (define-key menu-bar-file-menu [ps-print-buffer]
|
35684
|
109 '(menu-item "Postscript Print Buffer (B+W)" ps-print-buffer
|
65404
|
110 :enable (menu-bar-menu-frame-live-and-visible-p)
|
35684
|
111 :help "Pretty-print current buffer in black and white to PostScript printer"))
|
58041
|
112 (define-key menu-bar-file-menu [ps-print-region-faces]
|
27730
|
113 '(menu-item "Postscript Print Region" ps-print-region-with-faces
|
|
114 :enable mark-active
|
|
115 :help "Pretty-print marked region to PostScript printer"))
|
58041
|
116 (define-key menu-bar-file-menu [ps-print-buffer-faces]
|
27730
|
117 '(menu-item "Postscript Print Buffer" ps-print-buffer-with-faces
|
65404
|
118 :enable (menu-bar-menu-frame-live-and-visible-p)
|
27730
|
119 :help "Pretty-print current buffer to PostScript printer"))
|
58041
|
120 (define-key menu-bar-file-menu [print-region]
|
27730
|
121 '(menu-item "Print Region" print-region
|
|
122 :enable mark-active
|
|
123 :help "Print region between mark and current position"))
|
58041
|
124 (define-key menu-bar-file-menu [print-buffer]
|
27730
|
125 '(menu-item "Print Buffer" print-buffer
|
65404
|
126 :enable (menu-bar-menu-frame-live-and-visible-p)
|
27730
|
127 :help "Print current buffer with page headings"))
|
|
128
|
58041
|
129 (define-key menu-bar-file-menu [separator-print]
|
27730
|
130 '(menu-item "--"))
|
8010
|
131
|
58041
|
132 (define-key menu-bar-file-menu [recover-session]
|
61024
bef623e1dcc0
(menu-bar-file-menu): Remove ellipsis from "Recover Crashed Session".
Juri Linkov <juri@jurta.org>
diff
changeset
|
133 '(menu-item "Recover Crashed Session" recover-session
|
27730
|
134 :enable (and auto-save-list-file-prefix
|
30387
b3f8b3df8d4f
(menu-bar-files-menu [recover-session]): Make sure auto save directory
Noah Friedman <friedman@splode.com>
diff
changeset
|
135 (file-directory-p
|
b3f8b3df8d4f
(menu-bar-files-menu [recover-session]): Make sure auto save directory
Noah Friedman <friedman@splode.com>
diff
changeset
|
136 (file-name-directory auto-save-list-file-prefix))
|
b3f8b3df8d4f
(menu-bar-files-menu [recover-session]): Make sure auto save directory
Noah Friedman <friedman@splode.com>
diff
changeset
|
137 (directory-files
|
27730
|
138 (file-name-directory auto-save-list-file-prefix)
|
|
139 nil
|
|
140 (concat "\\`"
|
|
141 (regexp-quote
|
|
142 (file-name-nondirectory
|
|
143 auto-save-list-file-prefix)))
|
|
144 t))
|
|
145 :help "Recover edits from a crashed session"))
|
58041
|
146 (define-key menu-bar-file-menu [revert-buffer]
|
27730
|
147 '(menu-item "Revert Buffer" revert-buffer
|
|
148 :enable (or revert-buffer-function
|
|
149 revert-buffer-insert-file-contents-function
|
49935
|
150 (and buffer-file-number
|
27730
|
151 (or (buffer-modified-p)
|
|
152 (not (verify-visited-file-modtime
|
|
153 (current-buffer))))))
|
|
154 :help "Re-read current buffer from its file"))
|
58041
|
155 (define-key menu-bar-file-menu [write-file]
|
64822
518cb89f1f95
(menu-bar-file-menu): Rename some menu items and improve help strings.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
156 '(menu-item "Save As..." write-file
|
65404
|
157 :enable (and (menu-bar-menu-frame-live-and-visible-p)
|
|
158 (menu-bar-non-minibuffer-window-p))
|
27730
|
159 :help "Write current buffer to another file"))
|
58041
|
160 (define-key menu-bar-file-menu [save-buffer]
|
64822
518cb89f1f95
(menu-bar-file-menu): Rename some menu items and improve help strings.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
161 '(menu-item "Save" save-buffer
|
27730
|
162 :enable (and (buffer-modified-p)
|
31645
|
163 (buffer-file-name)
|
65404
|
164 (menu-bar-non-minibuffer-window-p))
|
27730
|
165 :help "Save current buffer to its file"))
|
8010
|
166
|
58041
|
167 (define-key menu-bar-file-menu [separator-save]
|
27730
|
168 '(menu-item "--"))
|
8010
|
169
|
67762
|
170 (defun menu-find-file-existing ()
|
|
171 "Edit the existing file FILENAME."
|
|
172 (interactive)
|
|
173 (let* ((mustmatch (not (and (fboundp 'x-uses-old-gtk-dialog)
|
|
174 (x-uses-old-gtk-dialog))))
|
|
175 (filename (car (find-file-read-args "Find file: " mustmatch))))
|
|
176 (if mustmatch
|
|
177 (find-file-existing filename)
|
|
178 (find-file filename))))
|
|
179
|
|
180
|
58041
|
181 (define-key menu-bar-file-menu [kill-buffer]
|
64822
518cb89f1f95
(menu-bar-file-menu): Rename some menu items and improve help strings.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
182 '(menu-item "Close" kill-this-buffer
|
27730
|
183 :enable (kill-this-buffer-enabled-p)
|
64822
518cb89f1f95
(menu-bar-file-menu): Rename some menu items and improve help strings.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
184 :help "Discard (kill) current buffer"))
|
58041
|
185 (define-key menu-bar-file-menu [insert-file]
|
27730
|
186 '(menu-item "Insert File..." insert-file
|
65404
|
187 :enable (menu-bar-non-minibuffer-window-p)
|
27730
|
188 :help "Insert another file into current buffer"))
|
58041
|
189 (define-key menu-bar-file-menu [dired]
|
27730
|
190 '(menu-item "Open Directory..." dired
|
65404
|
191 :enable (menu-bar-non-minibuffer-window-p)
|
66347
|
192 :help "Read a directory, to operate on its files"))
|
58041
|
193 (define-key menu-bar-file-menu [open-file]
|
67762
|
194 '(menu-item "Open File..." menu-find-file-existing
|
65404
|
195 :enable (menu-bar-non-minibuffer-window-p)
|
57867
|
196 :help "Read an existing file into an Emacs buffer"))
|
58041
|
197 (define-key menu-bar-file-menu [new-file]
|
64822
518cb89f1f95
(menu-bar-file-menu): Rename some menu items and improve help strings.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
198 '(menu-item "Visit New File..." find-file
|
65404
|
199 :enable (menu-bar-non-minibuffer-window-p)
|
66347
|
200 :help "Specify a new file's name, to edit the file"))
|
8525
|
201
|
8010
|
202
|
27730
|
203 ;; The "Edit" menu items
|
47496
|
204
|
|
205 ;; The "Edit->Search" submenu
|
|
206 (defvar menu-bar-last-search-type nil
|
|
207 "Type of last non-incremental search command called from the menu.")
|
|
208
|
|
209 (defun nonincremental-repeat-search-forward ()
|
|
210 "Search forward for the previous search string or regexp."
|
|
211 (interactive)
|
|
212 (cond
|
|
213 ((and (eq menu-bar-last-search-type 'string)
|
|
214 search-ring)
|
|
215 (search-forward (car search-ring)))
|
|
216 ((and (eq menu-bar-last-search-type 'regexp)
|
|
217 regexp-search-ring)
|
|
218 (re-search-forward (car regexp-search-ring)))
|
|
219 (t
|
|
220 (error "No previous search"))))
|
|
221
|
|
222 (defun nonincremental-repeat-search-backward ()
|
|
223 "Search backward for the previous search string or regexp."
|
|
224 (interactive)
|
|
225 (cond
|
|
226 ((and (eq menu-bar-last-search-type 'string)
|
|
227 search-ring)
|
|
228 (search-backward (car search-ring)))
|
|
229 ((and (eq menu-bar-last-search-type 'regexp)
|
|
230 regexp-search-ring)
|
|
231 (re-search-backward (car regexp-search-ring)))
|
|
232 (t
|
|
233 (error "No previous search"))))
|
|
234
|
11067
|
235 (defun nonincremental-search-forward (string)
|
|
236 "Read a string and search for it nonincrementally."
|
|
237 (interactive "sSearch for string: ")
|
47496
|
238 (setq menu-bar-last-search-type 'string)
|
11067
|
239 (if (equal string "")
|
|
240 (search-forward (car search-ring))
|
|
241 (isearch-update-ring string nil)
|
|
242 (search-forward string)))
|
|
243
|
|
244 (defun nonincremental-search-backward (string)
|
|
245 "Read a string and search backward for it nonincrementally."
|
|
246 (interactive "sSearch for string: ")
|
47496
|
247 (setq menu-bar-last-search-type 'string)
|
11067
|
248 (if (equal string "")
|
|
249 (search-backward (car search-ring))
|
|
250 (isearch-update-ring string nil)
|
|
251 (search-backward string)))
|
|
252
|
|
253 (defun nonincremental-re-search-forward (string)
|
|
254 "Read a regular expression and search for it nonincrementally."
|
|
255 (interactive "sSearch for regexp: ")
|
47496
|
256 (setq menu-bar-last-search-type 'regexp)
|
11067
|
257 (if (equal string "")
|
|
258 (re-search-forward (car regexp-search-ring))
|
|
259 (isearch-update-ring string t)
|
|
260 (re-search-forward string)))
|
|
261
|
|
262 (defun nonincremental-re-search-backward (string)
|
|
263 "Read a regular expression and search backward for it nonincrementally."
|
|
264 (interactive "sSearch for regexp: ")
|
47496
|
265 (setq menu-bar-last-search-type 'regexp)
|
11067
|
266 (if (equal string "")
|
|
267 (re-search-backward (car regexp-search-ring))
|
|
268 (isearch-update-ring string t)
|
|
269 (re-search-backward string)))
|
|
270
|
47496
|
271 (defvar menu-bar-search-menu (make-sparse-keymap "Search"))
|
11067
|
272
|
47496
|
273 ;; The Edit->Search->Incremental Search menu
|
|
274 (defvar menu-bar-i-search-menu
|
|
275 (make-sparse-keymap "Incremental Search"))
|
11067
|
276
|
47496
|
277 (define-key menu-bar-i-search-menu [isearch-backward-regexp]
|
|
278 '(menu-item "Backward Regexp..." isearch-backward-regexp
|
|
279 :help "Search backwards for a regular expression as you type it"))
|
|
280 (define-key menu-bar-i-search-menu [isearch-forward-regexp]
|
|
281 '(menu-item "Forward Regexp..." isearch-forward-regexp
|
|
282 :help "Search forward for a regular expression as you type it"))
|
|
283 (define-key menu-bar-i-search-menu [isearch-backward]
|
|
284 '(menu-item "Backward String..." isearch-backward
|
|
285 :help "Search backwards for a string as you type it"))
|
|
286 (define-key menu-bar-i-search-menu [isearch-forward]
|
|
287 '(menu-item "Forward String..." isearch-forward
|
|
288 :help "Search forward for a string as you type it"))
|
11067
|
289
|
27730
|
290
|
47496
|
291 (define-key menu-bar-search-menu [i-search]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
292 (list 'menu-item "Incremental Search" menu-bar-i-search-menu))
|
47496
|
293 (define-key menu-bar-search-menu [separator-tag-isearch]
|
|
294 '(menu-item "--"))
|
|
295
|
|
296 (define-key menu-bar-search-menu [tags-continue]
|
|
297 '(menu-item "Continue Tags Search" tags-loop-continue
|
|
298 :help "Continue last tags search operation"))
|
|
299 (define-key menu-bar-search-menu [tags-srch]
|
92310
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
300 '(menu-item "Search Tagged Files..." tags-search
|
27730
|
301 :help "Search for a regexp in all tagged files"))
|
47496
|
302 (define-key menu-bar-search-menu [separator-tag-search]
|
27730
|
303 '(menu-item "--"))
|
|
304
|
47496
|
305 (define-key menu-bar-search-menu [repeat-search-back]
|
|
306 '(menu-item "Repeat Backwards" nonincremental-repeat-search-backward
|
|
307 :enable (or (and (eq menu-bar-last-search-type 'string)
|
|
308 search-ring)
|
|
309 (and (eq menu-bar-last-search-type 'regexp)
|
|
310 regexp-search-ring))
|
|
311 :help "Repeat last search backwards"))
|
|
312 (define-key menu-bar-search-menu [repeat-search-fwd]
|
|
313 '(menu-item "Repeat Forward" nonincremental-repeat-search-forward
|
|
314 :enable (or (and (eq menu-bar-last-search-type 'string)
|
|
315 search-ring)
|
|
316 (and (eq menu-bar-last-search-type 'regexp)
|
|
317 regexp-search-ring))
|
|
318 :help "Repeat last search forward"))
|
|
319 (define-key menu-bar-search-menu [separator-repeat-search]
|
|
320 '(menu-item "--"))
|
|
321
|
|
322 (define-key menu-bar-search-menu [re-search-backward]
|
|
323 '(menu-item "Regexp Backwards..." nonincremental-re-search-backward
|
|
324 :help "Search backwards for a regular expression"))
|
|
325 (define-key menu-bar-search-menu [re-search-forward]
|
|
326 '(menu-item "Regexp Forward..." nonincremental-re-search-forward
|
|
327 :help "Search forward for a regular expression"))
|
|
328
|
|
329 (define-key menu-bar-search-menu [search-backward]
|
|
330 '(menu-item "String Backwards..." nonincremental-search-backward
|
|
331 :help "Search backwards for a string"))
|
|
332 (define-key menu-bar-search-menu [search-forward]
|
|
333 '(menu-item "String Forward..." nonincremental-search-forward
|
|
334 :help "Search forward for a string"))
|
|
335
|
|
336 ;; The Edit->Replace submenu
|
|
337
|
|
338 (defvar menu-bar-replace-menu (make-sparse-keymap "Replace"))
|
|
339
|
|
340 (define-key menu-bar-replace-menu [tags-repl-continue]
|
|
341 '(menu-item "Continue Replace" tags-loop-continue
|
|
342 :help "Continue last tags replace operation"))
|
|
343 (define-key menu-bar-replace-menu [tags-repl]
|
92310
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
344 '(menu-item "Replace in Tagged Files..." tags-query-replace
|
47496
|
345 :help "Interactively replace a regexp in all tagged files"))
|
|
346 (define-key menu-bar-replace-menu [separator-replace-tags]
|
|
347 '(menu-item "--"))
|
|
348
|
|
349 (define-key menu-bar-replace-menu [query-replace-regexp]
|
27730
|
350 '(menu-item "Replace Regexp..." query-replace-regexp
|
|
351 :enable (not buffer-read-only)
|
47496
|
352 :help "Replace regular expression interactively, ask about each occurrence"))
|
|
353 (define-key menu-bar-replace-menu [query-replace]
|
|
354 '(menu-item "Replace String..." query-replace
|
27730
|
355 :enable (not buffer-read-only)
|
|
356 :help "Replace string interactively, ask about each occurrence"))
|
|
357
|
|
358 ;;; Assemble the top-level Edit menu items.
|
|
359 (define-key menu-bar-edit-menu [props]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
360 '(menu-item "Text Properties" facemenu-menu))
|
8010
|
361
|
39108
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
362 (define-key menu-bar-edit-menu [fill]
|
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
363 '(menu-item "Fill" fill-region
|
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
364 :enable (and mark-active (not buffer-read-only))
|
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
365 :help
|
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
366 "Fill text in region to fit between left and right margin"))
|
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
367
|
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
368 (define-key menu-bar-edit-menu [separator-bookmark]
|
27730
|
369 '(menu-item "--"))
|
|
370
|
|
371 (define-key menu-bar-edit-menu [bookmark]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
372 '(menu-item "Bookmarks" menu-bar-bookmark-map))
|
27730
|
373
|
|
374 (defvar menu-bar-goto-menu (make-sparse-keymap "Go To"))
|
11067
|
375
|
27730
|
376 (define-key menu-bar-goto-menu [set-tags-name]
|
61024
bef623e1dcc0
(menu-bar-file-menu): Remove ellipsis from "Recover Crashed Session".
Juri Linkov <juri@jurta.org>
diff
changeset
|
377 '(menu-item "Set Tags File Name..." visit-tags-table
|
27730
|
378 :help "Tell Tags commands which tag table file to use"))
|
|
379
|
|
380 (define-key menu-bar-goto-menu [separator-tag-file]
|
|
381 '(menu-item "--"))
|
11067
|
382
|
27730
|
383 (define-key menu-bar-goto-menu [apropos-tags]
|
61024
bef623e1dcc0
(menu-bar-file-menu): Remove ellipsis from "Recover Crashed Session".
Juri Linkov <juri@jurta.org>
diff
changeset
|
384 '(menu-item "Tags Apropos..." tags-apropos
|
27730
|
385 :help "Find function/variables whose names match regexp"))
|
|
386 (define-key menu-bar-goto-menu [next-tag-otherw]
|
|
387 '(menu-item "Next Tag in Other Window"
|
46908
|
388 menu-bar-next-tag-other-window
|
27773
|
389 :enable (and (boundp 'tags-location-ring)
|
|
390 (not (ring-empty-p tags-location-ring)))
|
27730
|
391 :help "Find next function/variable matching last tag name in another window"))
|
46908
|
392
|
|
393 (defun menu-bar-next-tag-other-window ()
|
|
394 "Find the next definition of the tag already specified."
|
|
395 (interactive)
|
|
396 (find-tag-other-window nil t))
|
|
397
|
|
398 (defun menu-bar-next-tag ()
|
|
399 "Find the next definition of the tag already specified."
|
|
400 (interactive)
|
|
401 (find-tag nil t))
|
|
402
|
27730
|
403 (define-key menu-bar-goto-menu [next-tag]
|
|
404 '(menu-item "Find Next Tag"
|
46908
|
405 menu-bar-next-tag
|
27773
|
406 :enable (and (boundp 'tags-location-ring)
|
|
407 (not (ring-empty-p tags-location-ring)))
|
27730
|
408 :help "Find next function/variable matching last tag name"))
|
|
409 (define-key menu-bar-goto-menu [find-tag-otherw]
|
|
410 '(menu-item "Find Tag in Other Window..." find-tag-other-window
|
|
411 :help "Find function/variable definition in another window"))
|
|
412 (define-key menu-bar-goto-menu [find-tag]
|
|
413 '(menu-item "Find Tag..." find-tag
|
|
414 :help "Find definition of function or variable"))
|
|
415
|
|
416 (define-key menu-bar-goto-menu [separator-tags]
|
|
417 '(menu-item "--"))
|
8010
|
418
|
27730
|
419 (define-key menu-bar-goto-menu [end-of-buf]
|
|
420 '(menu-item "Goto End of Buffer" end-of-buffer))
|
|
421 (define-key menu-bar-goto-menu [beg-of-buf]
|
|
422 '(menu-item "Goto Beginning of Buffer" beginning-of-buffer))
|
|
423 (define-key menu-bar-goto-menu [go-to-pos]
|
|
424 '(menu-item "Goto Buffer Position..." goto-char
|
|
425 :help "Read a number N and go to buffer position N"))
|
|
426 (define-key menu-bar-goto-menu [go-to-line]
|
|
427 '(menu-item "Goto Line..." goto-line
|
|
428 :help "Read a line number and go to that line"))
|
|
429
|
|
430 (define-key menu-bar-edit-menu [goto]
|
|
431 (list 'menu-item "Go To" menu-bar-goto-menu))
|
8010
|
432
|
47496
|
433 (define-key menu-bar-edit-menu [replace]
|
|
434 (list 'menu-item "Replace" menu-bar-replace-menu))
|
|
435
|
27730
|
436 (define-key menu-bar-edit-menu [search]
|
|
437 (list 'menu-item "Search" menu-bar-search-menu))
|
8767
|
438
|
39108
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
439 (define-key menu-bar-edit-menu [separator-search]
|
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
440 '(menu-item "--"))
|
bb0557fdcd9a
Fix separators in the Edit menu. Bring "Fill" near "Text Properties".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
441
|
29968
33751f6d1348
(menu-bar-edit-menu [mark-whole-buffer]): Change name to "Select All".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
442 (define-key menu-bar-edit-menu [mark-whole-buffer]
|
33751f6d1348
(menu-bar-edit-menu [mark-whole-buffer]): Change name to "Select All".
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
443 '(menu-item "Select All" mark-whole-buffer
|
99781
|
444 :help "Mark the whole buffer for a subsequent cut/copy"))
|
27730
|
445 (define-key menu-bar-edit-menu [clear]
|
|
446 '(menu-item "Clear" delete-region
|
|
447 :enable (and mark-active
|
|
448 (not buffer-read-only)
|
|
449 (not (mouse-region-match)))
|
|
450 :help
|
32932
|
451 "Delete the text in region between mark and current position"))
|
8767
|
452 (defvar yank-menu (cons "Select Yank" nil))
|
|
453 (fset 'yank-menu (cons 'keymap yank-menu))
|
74383
|
454 (define-key menu-bar-edit-menu [paste-from-menu]
|
99787
|
455 '(menu-item "Paste from Kill Menu" yank-menu
|
74383
|
456 :enable (and (cdr yank-menu) (not buffer-read-only))
|
|
457 :help "Choose a string from the kill ring and paste it"))
|
27730
|
458 (define-key menu-bar-edit-menu [paste]
|
|
459 '(menu-item "Paste" yank
|
40913
|
460 :enable (and
|
|
461 ;; Emacs compiled --without-x doesn't have
|
|
462 ;; x-selection-exists-p.
|
|
463 (fboundp 'x-selection-exists-p)
|
|
464 (x-selection-exists-p) (not buffer-read-only))
|
39080
|
465 :help "Paste (yank) text most recently cut/copied"))
|
27730
|
466 (define-key menu-bar-edit-menu [copy]
|
|
467 '(menu-item "Copy" menu-bar-kill-ring-save
|
|
468 :enable mark-active
|
41095
04e401e29e4e
(menu-bar-edit-menu) <copy>: Put an explicit key binding.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
469 :help "Copy text in region between mark and current position"
|
04e401e29e4e
(menu-bar-edit-menu) <copy>: Put an explicit key binding.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
470 :keys "\\[kill-ring-save]"))
|
27730
|
471 (define-key menu-bar-edit-menu [cut]
|
|
472 '(menu-item "Cut" kill-region
|
|
473 :enable (and mark-active (not buffer-read-only))
|
32932
|
474 :help
|
|
475 "Cut (kill) text in region between mark and current position"))
|
27730
|
476 (define-key menu-bar-edit-menu [undo]
|
|
477 '(menu-item "Undo" undo
|
|
478 :enable (and (not buffer-read-only)
|
|
479 (not (eq t buffer-undo-list))
|
|
480 (if (eq last-command 'undo)
|
67430
|
481 (listp pending-undo-list)
|
27730
|
482 (consp buffer-undo-list)))
|
|
483 :help "Undo last operation"))
|
|
484
|
2847
|
485
|
10721
|
486 (defun menu-bar-kill-ring-save (beg end)
|
|
487 (interactive "r")
|
|
488 (if (mouse-region-match)
|
22655
|
489 (message "Selecting a region with the mouse does `copy' automatically")
|
10721
|
490 (kill-ring-save beg end)))
|
|
491
|
6699
|
492 ;; These are alternative definitions for the cut, paste and copy
|
10721
|
493 ;; menu items. Use them if your system expects these to use the clipboard.
|
6699
|
494
|
86231
|
495 (put 'clipboard-kill-region 'menu-enable
|
|
496 '(and mark-active (not buffer-read-only)))
|
6699
|
497 (put 'clipboard-kill-ring-save 'menu-enable 'mark-active)
|
|
498 (put 'clipboard-yank 'menu-enable
|
86231
|
499 '(and (or (and (fboundp 'x-selection-exists-p)
|
|
500 (x-selection-exists-p))
|
|
501 (x-selection-exists-p 'CLIPBOARD))
|
|
502 (not buffer-read-only)))
|
6699
|
503
|
|
504 (defun clipboard-yank ()
|
23982
|
505 "Insert the clipboard contents, or the last stretch of killed text."
|
73005
|
506 (interactive "*")
|
6699
|
507 (let ((x-select-enable-clipboard t))
|
|
508 (yank)))
|
|
509
|
|
510 (defun clipboard-kill-ring-save (beg end)
|
|
511 "Copy region to kill ring, and save in the X clipboard."
|
|
512 (interactive "r")
|
|
513 (let ((x-select-enable-clipboard t))
|
|
514 (kill-ring-save beg end)))
|
|
515
|
|
516 (defun clipboard-kill-region (beg end)
|
|
517 "Kill the region, and save it in the X clipboard."
|
|
518 (interactive "r")
|
|
519 (let ((x-select-enable-clipboard t))
|
|
520 (kill-region beg end)))
|
|
521
|
|
522 (defun menu-bar-enable-clipboard ()
|
8391
|
523 "Make CUT, PASTE and COPY (keys and menu bar items) use the clipboard.
|
|
524 Do the same for the keys of the same name."
|
6699
|
525 (interactive)
|
6948
|
526 ;; We can't use constant list structure here because it becomes pure,
|
|
527 ;; and because it gets modified with cache data.
|
|
528 (define-key menu-bar-edit-menu [paste]
|
27730
|
529 (cons "Paste" (cons "Paste text from clipboard" 'clipboard-yank)))
|
6948
|
530 (define-key menu-bar-edit-menu [copy]
|
27730
|
531 (cons "Copy" (cons "Copy text in region to the clipboard"
|
|
532 'clipboard-kill-ring-save)))
|
6948
|
533 (define-key menu-bar-edit-menu [cut]
|
27730
|
534 (cons "Cut" (cons "Delete text in region and copy it to the clipboard"
|
|
535 'clipboard-kill-region)))
|
6745
|
536
|
52406
|
537 ;; These are Sun server keysyms for the Cut, Copy and Paste keys
|
|
538 ;; (also for XFree86 on Sun keyboard):
|
8391
|
539 (define-key global-map [f20] 'clipboard-kill-region)
|
|
540 (define-key global-map [f16] 'clipboard-kill-ring-save)
|
|
541 (define-key global-map [f18] 'clipboard-yank)
|
52406
|
542 ;; X11R6 versions:
|
8391
|
543 (define-key global-map [cut] 'clipboard-kill-region)
|
|
544 (define-key global-map [copy] 'clipboard-kill-ring-save)
|
|
545 (define-key global-map [paste] 'clipboard-yank))
|
6699
|
546
|
27730
|
547 ;; The "Options" menu items
|
17341
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
548
|
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
549 (defvar menu-bar-custom-menu (make-sparse-keymap "Customize"))
|
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
550
|
18700
|
551 (define-key menu-bar-custom-menu [customize-apropos-groups]
|
27730
|
552 '(menu-item "Groups Matching Regexp..." customize-apropos-groups
|
|
553 :help "Browse groups whose names match regexp"))
|
18700
|
554 (define-key menu-bar-custom-menu [customize-apropos-faces]
|
27730
|
555 '(menu-item "Faces Matching Regexp..." customize-apropos-faces
|
|
556 :help "Browse faces whose names match regexp"))
|
18700
|
557 (define-key menu-bar-custom-menu [customize-apropos-options]
|
27730
|
558 '(menu-item "Options Matching Regexp..." customize-apropos-options
|
|
559 :help "Browse options whose names match regexp"))
|
17341
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
560 (define-key menu-bar-custom-menu [customize-apropos]
|
27730
|
561 '(menu-item "Settings Matching Regexp..." customize-apropos
|
|
562 :help "Browse customizable settings whose names match regexp"))
|
45044
|
563 (define-key menu-bar-custom-menu [separator-1]
|
18700
|
564 '("--"))
|
17615
|
565 (define-key menu-bar-custom-menu [customize-group]
|
27730
|
566 '(menu-item "Specific Group..." customize-group
|
|
567 :help "Customize settings of specific group"))
|
17341
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
568 (define-key menu-bar-custom-menu [customize-face]
|
27730
|
569 '(menu-item "Specific Face..." customize-face
|
|
570 :help "Customize attributes of specific face"))
|
18700
|
571 (define-key menu-bar-custom-menu [customize-option]
|
27730
|
572 '(menu-item "Specific Option..." customize-option
|
45044
|
573 :help "Customize value of specific option"))
|
|
574 (define-key menu-bar-custom-menu [separator-2]
|
|
575 '("--"))
|
21912
|
576 (define-key menu-bar-custom-menu [customize-changed-options]
|
45044
|
577 '(menu-item "New Options..." customize-changed-options
|
|
578 :help "Options added or changed in recent Emacs versions"))
|
|
579 (define-key menu-bar-custom-menu [customize-saved]
|
|
580 '(menu-item "Saved Options" customize-saved
|
|
581 :help "Customize previously saved options"))
|
18700
|
582 (define-key menu-bar-custom-menu [separator-3]
|
|
583 '("--"))
|
18602
|
584 (define-key menu-bar-custom-menu [customize-browse]
|
27730
|
585 '(menu-item "Browse Customization Groups" customize-browse
|
|
586 :help "Browse all customization groups"))
|
18700
|
587 (define-key menu-bar-custom-menu [customize]
|
27730
|
588 '(menu-item "Top-level Customization Group" customize
|
|
589 :help "The master group called `Emacs'"))
|
17341
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
590
|
27730
|
591 ;(defvar menu-bar-preferences-menu (make-sparse-keymap "Preferences"))
|
19617
|
592
|
47296
|
593 (defmacro menu-bar-make-mm-toggle (fname doc help &optional props)
|
|
594 "Make a menu-item for a global minor mode toggle.
|
|
595 FNAME is the minor mode's name (variable and function).
|
60392
|
596 DOC is the text to use for the menu entry.
|
47296
|
597 HELP is the text to use for the tooltip.
|
|
598 PROPS are additional properties."
|
47493
|
599 `'(menu-item ,doc ,fname
|
60826
|
600 ,@props
|
47296
|
601 :help ,help
|
|
602 :button (:toggle . (and (default-boundp ',fname)
|
|
603 (default-value ',fname)))))
|
|
604
|
47421
|
605 (defmacro menu-bar-make-toggle (name variable doc message help &rest body)
|
19617
|
606 `(progn
|
57700
|
607 (defun ,name (&optional interactively)
|
38155
|
608 ,(concat "Toggle whether to " (downcase (substring help 0 1))
|
63333
|
609 (substring help 1) ".
|
57700
|
610 In an interactive call, record this option as a candidate for saving
|
|
611 by \"Save Options\" in Custom buffers.")
|
|
612 (interactive "p")
|
19617
|
613 (if ,(if body `(progn . ,body)
|
44499
|
614 `(progn
|
43246
|
615 (custom-load-symbol ',variable)
|
|
616 (let ((set (or (get ',variable 'custom-set) 'set-default))
|
|
617 (get (or (get ',variable 'custom-get) 'default-value)))
|
|
618 (funcall set ',variable (not (funcall get ',variable))))))
|
74383
|
619 (message ,message "enabled globally")
|
|
620 (message ,message "disabled globally"))
|
47421
|
621 ;; The function `customize-mark-as-set' must only be called when
|
|
622 ;; a variable is set interactively, as the purpose is to mark it as
|
|
623 ;; a candidate for "Save Options", and we do not want to save options
|
|
624 ;; the user have already set explicitly in his init file.
|
57700
|
625 (if interactively (customize-mark-as-set ',variable)))
|
47421
|
626 '(menu-item ,doc ,name
|
27730
|
627 :help ,help
|
43246
|
628 :button (:toggle . (and (default-boundp ',variable)
|
|
629 (default-value ',variable))))))
|
27730
|
630
|
95786
|
631 ;; Function for setting/saving default font.
|
|
632
|
|
633 (defun menu-set-font ()
|
|
634 "Interactively select a font and make it the default."
|
|
635 (interactive)
|
95871
|
636 (let ((font (if (fboundp 'x-select-font)
|
95852
|
637 (x-select-font)
|
95786
|
638 (mouse-select-font)))
|
|
639 spec)
|
|
640 (when font
|
|
641 (set-face-attribute 'default nil :font font)
|
|
642 (setq spec (list (list t (face-attr-construct 'default))))
|
|
643 (put 'default 'customized-face spec)
|
|
644 (custom-push-theme 'theme-face 'default 'user 'set spec)
|
|
645 (put 'default 'face-modified nil))))
|
|
646
|
27730
|
647 ;;; Assemble all the top-level items of the "Options" menu
|
|
648 (define-key menu-bar-options-menu [customize]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
649 (list 'menu-item "Customize Emacs" menu-bar-custom-menu))
|
29739
|
650
|
|
651 (defun menu-bar-options-save ()
|
|
652 "Save current values of Options menu items using Custom."
|
|
653 (interactive)
|
43167
|
654 (let ((need-save nil))
|
58586
|
655 ;; These are set with menu-bar-make-mm-toggle, which does not
|
|
656 ;; put on a customized-value property.
|
61714
de02ab04abd0
(menu-bar-options-save, menu-bar-showhide-menu): Add size-indication-mode.
Lute Kamstra <lute@gnu.org>
diff
changeset
|
657 (dolist (elt '(line-number-mode column-number-mode size-indication-mode
|
de02ab04abd0
(menu-bar-options-save, menu-bar-showhide-menu): Add size-indication-mode.
Lute Kamstra <lute@gnu.org>
diff
changeset
|
658 cua-mode show-paren-mode transient-mark-mode
|
66858
|
659 blink-cursor-mode display-time-mode display-battery-mode))
|
58586
|
660 (and (customize-mark-to-save elt)
|
|
661 (setq need-save t)))
|
43246
|
662 ;; These are set with `customize-set-variable'.
|
58586
|
663 (dolist (elt '(scroll-bar-mode
|
61710
|
664 debug-on-quit debug-on-error
|
|
665 tooltip-mode menu-bar-mode tool-bar-mode
|
45492
|
666 save-place uniquify-buffer-name-style fringe-mode
|
64760
|
667 indicate-empty-lines indicate-buffer-boundaries
|
65127
|
668 case-fold-search
|
43252
|
669 current-language-environment default-input-method
|
43246
|
670 ;; Saving `text-mode-hook' is somewhat questionable,
|
|
671 ;; as we might get more than we bargain for, if
|
|
672 ;; other code may has added hooks as well.
|
|
673 ;; Nonetheless, not saving it would like be confuse
|
|
674 ;; more often.
|
|
675 ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.
|
|
676 text-mode-hook))
|
|
677 (and (get elt 'customized-value)
|
|
678 (customize-mark-to-save elt)
|
|
679 (setq need-save t)))
|
95797
|
680 (when (get 'default 'customized-face)
|
|
681 (put 'default 'saved-face (get 'default 'customized-face))
|
|
682 (put 'default 'customized-face nil)
|
|
683 (setq need-save t))
|
43167
|
684 ;; Save if we changed anything.
|
|
685 (when need-save
|
|
686 (custom-save-all))))
|
29739
|
687
|
|
688 (define-key menu-bar-options-menu [save]
|
29741
|
689 '(menu-item "Save Options" menu-bar-options-save
|
29739
|
690 :help "Save options set from the menu above"))
|
|
691
|
|
692 (define-key menu-bar-options-menu [custom-separator]
|
|
693 '("--"))
|
|
694
|
95786
|
695 (define-key menu-bar-options-menu [menu-set-font]
|
|
696 '(menu-item "Set Default Font..." menu-set-font
|
|
697 :visible (display-multi-font-p)
|
|
698 :help "Select a default font"))
|
51687
|
699
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
700 ;; The "Show/Hide" submenu of menu "Options"
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
701
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
702 (defvar menu-bar-showhide-menu (make-sparse-keymap "Show/Hide"))
|
43086
|
703
|
43216
|
704 (define-key menu-bar-showhide-menu [column-number-mode]
|
47421
|
705 (menu-bar-make-mm-toggle column-number-mode
|
52406
|
706 "Column Numbers"
|
47421
|
707 "Show the current column number in the mode line"))
|
43216
|
708
|
|
709 (define-key menu-bar-showhide-menu [line-number-mode]
|
47421
|
710 (menu-bar-make-mm-toggle line-number-mode
|
52406
|
711 "Line Numbers"
|
47421
|
712 "Show the current line number in the mode line"))
|
43216
|
713
|
61714
de02ab04abd0
(menu-bar-options-save, menu-bar-showhide-menu): Add size-indication-mode.
Lute Kamstra <lute@gnu.org>
diff
changeset
|
714 (define-key menu-bar-showhide-menu [size-indication-mode]
|
de02ab04abd0
(menu-bar-options-save, menu-bar-showhide-menu): Add size-indication-mode.
Lute Kamstra <lute@gnu.org>
diff
changeset
|
715 (menu-bar-make-mm-toggle size-indication-mode
|
de02ab04abd0
(menu-bar-options-save, menu-bar-showhide-menu): Add size-indication-mode.
Lute Kamstra <lute@gnu.org>
diff
changeset
|
716 "Size Indication"
|
de02ab04abd0
(menu-bar-options-save, menu-bar-showhide-menu): Add size-indication-mode.
Lute Kamstra <lute@gnu.org>
diff
changeset
|
717 "Show the size of the buffer in the mode line"))
|
de02ab04abd0
(menu-bar-options-save, menu-bar-showhide-menu): Add size-indication-mode.
Lute Kamstra <lute@gnu.org>
diff
changeset
|
718
|
43216
|
719 (define-key menu-bar-showhide-menu [linecolumn-separator]
|
|
720 '("--"))
|
|
721
|
64867
|
722 (define-key menu-bar-showhide-menu [showhide-battery]
|
|
723 (menu-bar-make-mm-toggle display-battery-mode
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
724 "Battery Status"
|
64867
|
725 "Display battery status information in mode line"))
|
|
726
|
43086
|
727 (define-key menu-bar-showhide-menu [showhide-date-time]
|
60826
|
728 (menu-bar-make-mm-toggle display-time-mode
|
64904
91a457b76b86
(menu-bar-showhide-menu): Rename "Date, Time and Mail" item to
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
729 "Time, Load and Mail"
|
91a457b76b86
(menu-bar-showhide-menu): Rename "Date, Time and Mail" item to
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
730 "Display time, system load averages and \
|
91a457b76b86
(menu-bar-showhide-menu): Rename "Date, Time and Mail" item to
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
731 mail status in mode line"))
|
43086
|
732
|
|
733 (define-key menu-bar-showhide-menu [datetime-separator]
|
|
734 '("--"))
|
|
735
|
43383
|
736 (define-key menu-bar-showhide-menu [showhide-speedbar]
|
|
737 '(menu-item "Speedbar" speedbar-frame-mode
|
45228
|
738 :help "Display a Speedbar quick-navigation frame"
|
43383
|
739 :button (:toggle
|
|
740 . (and (boundp 'speedbar-frame)
|
|
741 (frame-live-p (symbol-value 'speedbar-frame))
|
44499
|
742 (frame-visible-p
|
43383
|
743 (symbol-value 'speedbar-frame))))))
|
|
744
|
64760
|
745 (defvar menu-bar-showhide-fringe-menu (make-sparse-keymap "Fringe"))
|
58598
|
746
|
64760
|
747 (defvar menu-bar-showhide-fringe-ind-menu
|
|
748 (make-sparse-keymap "Buffer boundaries"))
|
58598
|
749
|
64760
|
750 (defun menu-bar-showhide-fringe-ind-customize ()
|
|
751 "Show customization buffer for `indicate-buffer-boundaries'."
|
58598
|
752 (interactive)
|
64760
|
753 (customize-variable 'indicate-buffer-boundaries))
|
58598
|
754
|
64760
|
755 (define-key menu-bar-showhide-fringe-ind-menu [customize]
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
756 '(menu-item "Other (Customize)"
|
64760
|
757 menu-bar-showhide-fringe-ind-customize
|
|
758 :help "Additional choices available through Custom buffer"
|
93155
09cc3d0d41ce
(menu-bar-showhide-fringe-ind-menu) [customize]: Add radio button.
Andreas Schwab <schwab@suse.de>
diff
changeset
|
759 :visible (display-graphic-p)
|
09cc3d0d41ce
(menu-bar-showhide-fringe-ind-menu) [customize]: Add radio button.
Andreas Schwab <schwab@suse.de>
diff
changeset
|
760 :button (:radio . (not (member indicate-buffer-boundaries
|
09cc3d0d41ce
(menu-bar-showhide-fringe-ind-menu) [customize]: Add radio button.
Andreas Schwab <schwab@suse.de>
diff
changeset
|
761 '(nil left right
|
09cc3d0d41ce
(menu-bar-showhide-fringe-ind-menu) [customize]: Add radio button.
Andreas Schwab <schwab@suse.de>
diff
changeset
|
762 ((top . left) (bottom . right))
|
09cc3d0d41ce
(menu-bar-showhide-fringe-ind-menu) [customize]: Add radio button.
Andreas Schwab <schwab@suse.de>
diff
changeset
|
763 ((t . right) (top . left))))))))
|
58598
|
764
|
|
765 (defun menu-bar-showhide-fringe-ind-mixed ()
|
64760
|
766 "Display top and bottom indicators in opposite fringes, arrows in right."
|
58598
|
767 (interactive)
|
64760
|
768 (customize-set-variable 'indicate-buffer-boundaries
|
|
769 '((t . right) (top . left))))
|
58598
|
770
|
|
771 (define-key menu-bar-showhide-fringe-ind-menu [mixed]
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
772 '(menu-item "Opposite, Arrows Right" menu-bar-showhide-fringe-ind-mixed
|
64760
|
773 :help
|
|
774 "Show top/bottom indicators in opposite fringes, arrows in right"
|
58598
|
775 :visible (display-graphic-p)
|
93154
|
776 :button (:radio . (equal indicate-buffer-boundaries
|
|
777 '((t . right) (top . left))))))
|
58598
|
778
|
|
779 (defun menu-bar-showhide-fringe-ind-box ()
|
|
780 "Display top and bottom indicators in opposite fringes."
|
|
781 (interactive)
|
64760
|
782 (customize-set-variable 'indicate-buffer-boundaries
|
|
783 '((top . left) (bottom . right))))
|
58598
|
784
|
|
785 (define-key menu-bar-showhide-fringe-ind-menu [box]
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
786 '(menu-item "Opposite, No Arrows" menu-bar-showhide-fringe-ind-box
|
58598
|
787 :help "Show top/bottom indicators in opposite fringes, no arrows"
|
|
788 :visible (display-graphic-p)
|
93154
|
789 :button (:radio . (equal indicate-buffer-boundaries
|
|
790 '((top . left) (bottom . right))))))
|
58598
|
791
|
|
792 (defun menu-bar-showhide-fringe-ind-right ()
|
64760
|
793 "Display buffer boundaries and arrows in the right fringe."
|
58598
|
794 (interactive)
|
64760
|
795 (customize-set-variable 'indicate-buffer-boundaries 'right))
|
58598
|
796
|
|
797 (define-key menu-bar-showhide-fringe-ind-menu [right]
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
798 '(menu-item "In Right Fringe" menu-bar-showhide-fringe-ind-right
|
64760
|
799 :help "Show buffer boundaries and arrows in right fringe"
|
58598
|
800 :visible (display-graphic-p)
|
64760
|
801 :button (:radio . (eq indicate-buffer-boundaries 'right))))
|
58598
|
802
|
|
803 (defun menu-bar-showhide-fringe-ind-left ()
|
64760
|
804 "Display buffer boundaries and arrows in the left fringe."
|
58598
|
805 (interactive)
|
64760
|
806 (customize-set-variable 'indicate-buffer-boundaries 'left))
|
58598
|
807
|
|
808 (define-key menu-bar-showhide-fringe-ind-menu [left]
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
809 '(menu-item "In Left Fringe" menu-bar-showhide-fringe-ind-left
|
64760
|
810 :help "Show buffer boundaries and arrows in left fringe"
|
58598
|
811 :visible (display-graphic-p)
|
64760
|
812 :button (:radio . (eq indicate-buffer-boundaries 'left))))
|
58598
|
813
|
|
814 (defun menu-bar-showhide-fringe-ind-none ()
|
64760
|
815 "Do not display any buffer boundary indicators."
|
58598
|
816 (interactive)
|
64760
|
817 (customize-set-variable 'indicate-buffer-boundaries nil))
|
58598
|
818
|
|
819 (define-key menu-bar-showhide-fringe-ind-menu [none]
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
820 '(menu-item "No Indicators" menu-bar-showhide-fringe-ind-none
|
64760
|
821 :help "Hide all buffer boundary indicators and arrows"
|
58598
|
822 :visible (display-graphic-p)
|
64760
|
823 :button (:radio . (eq indicate-buffer-boundaries nil))))
|
58598
|
824
|
64760
|
825 (define-key menu-bar-showhide-fringe-menu [showhide-fringe-ind]
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
826 (list 'menu-item "Buffer Boundaries" menu-bar-showhide-fringe-ind-menu
|
64760
|
827 :visible `(display-graphic-p)
|
|
828 :help "Indicate buffer boundaries in fringe"))
|
58598
|
829
|
64760
|
830 (define-key menu-bar-showhide-fringe-menu [indicate-empty-lines]
|
|
831 (menu-bar-make-toggle toggle-indicate-empty-lines indicate-empty-lines
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
832 "Empty Line Indicators"
|
64760
|
833 "Indicating of empty lines %s"
|
74383
|
834 "Indicate trailing empty lines in fringe, globally"))
|
45492
|
835
|
|
836 (defun menu-bar-showhide-fringe-menu-customize ()
|
|
837 "Show customization buffer for `fringe-mode'."
|
|
838 (interactive)
|
|
839 (customize-variable 'fringe-mode))
|
|
840
|
|
841 (define-key menu-bar-showhide-fringe-menu [customize]
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
842 '(menu-item "Customize Fringe" menu-bar-showhide-fringe-menu-customize
|
45492
|
843 :help "Detailed customization of fringe"
|
|
844 :visible (display-graphic-p)))
|
|
845
|
|
846 (defun menu-bar-showhide-fringe-menu-customize-reset ()
|
46908
|
847 "Reset the fringe mode: display fringes on both sides of a window."
|
45492
|
848 (interactive)
|
|
849 (customize-set-variable 'fringe-mode nil))
|
|
850
|
|
851 (define-key menu-bar-showhide-fringe-menu [default]
|
|
852 '(menu-item "Default" menu-bar-showhide-fringe-menu-customize-reset
|
|
853 :help "Default width fringe on both left and right side"
|
|
854 :visible (display-graphic-p)
|
46908
|
855 :button (:radio . (eq fringe-mode nil))))
|
45492
|
856
|
67550
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
857 (defun menu-bar-showhide-fringe-menu-customize-right ()
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
858 "Display fringes only on the right of each window."
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
859 (interactive)
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
860 (require 'fringe)
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
861 (customize-set-variable 'fringe-mode '(0 . nil)))
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
862
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
863 (define-key menu-bar-showhide-fringe-menu [right]
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
864 '(menu-item "On the Right" menu-bar-showhide-fringe-menu-customize-right
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
865 :help "Fringe only on the right side"
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
866 :visible (display-graphic-p)
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
867 :button (:radio . (equal fringe-mode '(0 . nil)))))
|
7c0bd57ed595
* menu-bar.el (menu-bar-showhide-fringe-menu): Moved "On the Right"
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
868
|
45492
|
869 (defun menu-bar-showhide-fringe-menu-customize-left ()
|
46908
|
870 "Display fringes only on the left of each window."
|
45492
|
871 (interactive)
|
45505
|
872 (require 'fringe)
|
|
873 (customize-set-variable 'fringe-mode '(nil . 0)))
|
45492
|
874
|
|
875 (define-key menu-bar-showhide-fringe-menu [left]
|
|
876 '(menu-item "On the Left" menu-bar-showhide-fringe-menu-customize-left
|
|
877 :help "Fringe only on the left side"
|
|
878 :visible (display-graphic-p)
|
46908
|
879 :button (:radio . (equal fringe-mode '(nil . 0)))))
|
45492
|
880
|
|
881 (defun menu-bar-showhide-fringe-menu-customize-disable ()
|
46908
|
882 "Do not display window fringes."
|
45492
|
883 (interactive)
|
45505
|
884 (require 'fringe)
|
|
885 (customize-set-variable 'fringe-mode 0))
|
45492
|
886
|
|
887 (define-key menu-bar-showhide-fringe-menu [none]
|
|
888 '(menu-item "None" menu-bar-showhide-fringe-menu-customize-disable
|
|
889 :help "Turn off fringe"
|
|
890 :visible (display-graphic-p)
|
46908
|
891 :button (:radio . (eq fringe-mode 0))))
|
45492
|
892
|
|
893 (define-key menu-bar-showhide-menu [showhide-fringe]
|
|
894 (list 'menu-item "Fringe" menu-bar-showhide-fringe-menu
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
895 :visible `(display-graphic-p)))
|
45492
|
896
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
897 (defvar menu-bar-showhide-scroll-bar-menu (make-sparse-keymap "Scroll-bar"))
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
898
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
899 (define-key menu-bar-showhide-scroll-bar-menu [right]
|
44499
|
900 '(menu-item "On the Right"
|
46908
|
901 menu-bar-right-scroll-bar
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
902 :help "Scroll-bar on the right side"
|
45228
|
903 :visible (display-graphic-p)
|
43246
|
904 :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
|
|
905 (frame-parameters))) 'right))))
|
46908
|
906 (defun menu-bar-right-scroll-bar ()
|
|
907 "Display scroll bars on the right of each window."
|
|
908 (interactive)
|
|
909 (customize-set-variable 'scroll-bar-mode 'right))
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
910
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
911 (define-key menu-bar-showhide-scroll-bar-menu [left]
|
44499
|
912 '(menu-item "On the Left"
|
46908
|
913 menu-bar-left-scroll-bar
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
914 :help "Scroll-bar on the left side"
|
45228
|
915 :visible (display-graphic-p)
|
43246
|
916 :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
|
|
917 (frame-parameters))) 'left))))
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
918
|
46908
|
919 (defun menu-bar-left-scroll-bar ()
|
|
920 "Display scroll bars on the left of each window."
|
|
921 (interactive)
|
49012
|
922 (customize-set-variable 'scroll-bar-mode 'left))
|
46908
|
923
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
924 (define-key menu-bar-showhide-scroll-bar-menu [none]
|
44499
|
925 '(menu-item "None"
|
46908
|
926 menu-bar-no-scroll-bar
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
927 :help "Turn off scroll-bar"
|
45228
|
928 :visible (display-graphic-p)
|
43246
|
929 :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
|
|
930 (frame-parameters))) nil))))
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
931
|
46908
|
932 (defun menu-bar-no-scroll-bar ()
|
|
933 "Turn off scroll bars."
|
|
934 (interactive)
|
|
935 (customize-set-variable 'scroll-bar-mode nil))
|
|
936
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
937 (define-key menu-bar-showhide-menu [showhide-scroll-bar]
|
44499
|
938 (list 'menu-item "Scroll-bar" menu-bar-showhide-scroll-bar-menu
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
939 :visible `(display-graphic-p)))
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
940
|
61710
|
941 (define-key menu-bar-showhide-menu [showhide-tooltip-mode]
|
|
942 (list 'menu-item "Tooltips" 'tooltip-mode
|
74559
|
943 :help "Turn tooltips on/off"
|
61710
|
944 :visible `(and (display-graphic-p) (fboundp 'x-show-tip))
|
|
945 :button `(:toggle . tooltip-mode)))
|
|
946
|
47296
|
947 (define-key menu-bar-showhide-menu [menu-bar-mode]
|
83497
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
948 '(menu-item "Menu-bar" toggle-menu-bar-mode-from-frame
|
74559
|
949 :help "Turn menu-bar on/off"
|
83497
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
950 :button (:toggle . (> (frame-parameter nil 'menu-bar-lines) 0))))
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
951
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
952 (define-key menu-bar-showhide-menu [showhide-tool-bar]
|
83497
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
953 (list 'menu-item "Tool-bar" 'toggle-tool-bar-mode-from-frame
|
99781
|
954 :help "Turn tool-bar on/off"
|
45228
|
955 :visible `(display-graphic-p)
|
83497
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
956 :button `(:toggle . (> (frame-parameter nil 'tool-bar-lines) 0))))
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
957
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
958 (define-key menu-bar-options-menu [showhide]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
959 (list 'menu-item "Show/Hide" menu-bar-showhide-menu))
|
43020
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
960
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
961 (define-key menu-bar-options-menu [showhide-separator]
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
962 '("--"))
|
9a93c325183a
(menu-bar-options-save): Add `default-frame-alist' to saved variables.
Pavel Janík <Pavel@Janik.cz>
diff
changeset
|
963
|
27730
|
964 (define-key menu-bar-options-menu [mule]
|
|
965 ;; It is better not to use backquote here,
|
|
966 ;; because that makes a bootstrapping problem
|
|
967 ;; if you need to recompile all the Lisp files using interpreted code.
|
|
968 (list 'menu-item "Mule (Multilingual Environment)" mule-menu-keymap
|
28557
|
969 ;; Most of the MULE menu actually does make sense in unibyte mode,
|
|
970 ;; e.g. language selection.
|
|
971 ;;; ':visible 'default-enable-multibyte-characters
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
972 ))
|
27730
|
973 ;(setq menu-bar-final-items (cons 'mule menu-bar-final-items))
|
|
974 ;(define-key menu-bar-options-menu [preferences]
|
|
975 ; (list 'menu-item "Preferences" menu-bar-preferences-menu
|
|
976 ; :help "Toggle important global options"))
|
|
977
|
|
978 (define-key menu-bar-options-menu [mule-separator]
|
28557
|
979 '("--"))
|
19617
|
980
|
|
981 (define-key menu-bar-options-menu [debug-on-quit]
|
|
982 (menu-bar-make-toggle toggle-debug-on-quit debug-on-quit
|
38155
|
983 "Enter Debugger on Quit/C-g" "Debug on Quit %s"
|
27730
|
984 "Enter Lisp debugger when C-g is pressed"))
|
19617
|
985 (define-key menu-bar-options-menu [debug-on-error]
|
|
986 (menu-bar-make-toggle toggle-debug-on-error debug-on-error
|
38155
|
987 "Enter Debugger on Error" "Debug on Error %s"
|
|
988 "Enter Lisp debugger when an error is signaled"))
|
27730
|
989 (define-key menu-bar-options-menu [debugger-separator]
|
19617
|
990 '("--"))
|
60392
|
991
|
|
992 (define-key menu-bar-options-menu [blink-cursor-mode]
|
|
993 (menu-bar-make-mm-toggle blink-cursor-mode
|
|
994 "Blinking Cursor"
|
|
995 "Whether the cursor blinks (Blink Cursor mode)"))
|
|
996 (define-key menu-bar-options-menu [cursor-separator]
|
|
997 '("--"))
|
|
998
|
19617
|
999 (define-key menu-bar-options-menu [save-place]
|
|
1000 (menu-bar-make-toggle toggle-save-place-globally save-place
|
21302
|
1001 "Save Place in Files between Sessions"
|
19617
|
1002 "Saving place in files %s"
|
52178
|
1003 "Visit files of previous session when restarting Emacs"
|
|
1004 (require 'saveplace)
|
|
1005 ;; Do it by name, to avoid a free-variable
|
|
1006 ;; warning during byte compilation.
|
|
1007 (set-default
|
|
1008 'save-place (not (symbol-value 'save-place)))))
|
43246
|
1009
|
19617
|
1010 (define-key menu-bar-options-menu [uniquify]
|
|
1011 (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style
|
21302
|
1012 "Use Directory Names in Buffer Names"
|
19617
|
1013 "Directory name in buffer names (uniquify) %s"
|
38155
|
1014 "Uniquify buffer names by adding parent directory names"
|
19617
|
1015 (require 'uniquify)
|
|
1016 (setq uniquify-buffer-name-style
|
|
1017 (if (not uniquify-buffer-name-style)
|
|
1018 'forward))))
|
43246
|
1019
|
27730
|
1020 (define-key menu-bar-options-menu [edit-options-separator]
|
|
1021 '("--"))
|
45073
|
1022 (define-key menu-bar-options-menu [cua-mode]
|
50970
7831ca508f35
(menu-bar-options-menu) <cua-mode>: Use menu-bar-make-mm-toggle.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
1023 (menu-bar-make-mm-toggle cua-mode
|
64925
2aaaa5e2d539
(menu-bar-options-menu): Standardize capitalization of menu items.
Luc Teirlinck <teirllm@auburn.edu>
diff
changeset
|
1024 "C-x/C-c/C-v Cut and Paste (CUA)"
|
66625
|
1025 "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste"
|
|
1026 (:visible (or (not (boundp 'cua-enable-cua-keys))
|
|
1027 cua-enable-cua-keys))))
|
|
1028
|
|
1029 (define-key menu-bar-options-menu [cua-emulation-mode]
|
|
1030 (menu-bar-make-mm-toggle cua-mode
|
|
1031 "Shift movement mark region (CUA)"
|
|
1032 "Use shifted movement keys to set and extend the region."
|
|
1033 (:visible (and (boundp 'cua-enable-cua-keys)
|
|
1034 (not cua-enable-cua-keys)))))
|
46908
|
1035
|
22207
|
1036 (define-key menu-bar-options-menu [case-fold-search]
|
|
1037 (menu-bar-make-toggle toggle-case-fold-search case-fold-search
|
74362
|
1038 "Case-Insensitive Search"
|
74383
|
1039 "Case-Insensitive Search %s"
|
95609
|
1040 "Ignore letter-case in search commands"))
|
46908
|
1041
|
|
1042 (defun menu-bar-text-mode-auto-fill ()
|
|
1043 (interactive)
|
|
1044 (toggle-text-mode-auto-fill)
|
|
1045 ;; This is somewhat questionable, as `text-mode-hook'
|
|
1046 ;; might have changed outside customize.
|
|
1047 ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.
|
|
1048 (customize-mark-as-set 'text-mode-hook))
|
|
1049
|
27730
|
1050 (define-key menu-bar-options-menu [auto-fill-mode]
|
95609
|
1051 '(menu-item "Auto Fill in Text Modes"
|
46908
|
1052 menu-bar-text-mode-auto-fill
|
99781
|
1053 :help "Automatically fill text while typing (Auto Fill mode)"
|
43993
|
1054 :button (:toggle . (if (listp text-mode-hook)
|
|
1055 (member 'turn-on-auto-fill text-mode-hook)
|
|
1056 (eq 'turn-on-auto-fill text-mode-hook)))))
|
95609
|
1057
|
96587
|
1058
|
|
1059 (defvar menu-bar-line-wrapping-menu (make-sparse-keymap "Line Wrapping"))
|
|
1060
|
96875
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1061 (define-key menu-bar-line-wrapping-menu [word-wrap]
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1062 '(menu-item "Word Wrap (Visual Line mode)"
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1063 (lambda ()
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1064 (interactive)
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1065 (unless visual-line-mode
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1066 (visual-line-mode 1))
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1067 (message "Visual-Line mode enabled"))
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1068 :help "Wrap long lines at word boundaries"
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1069 :button (:radio . (and (null truncate-lines)
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1070 (not (truncated-partial-width-window-p))
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1071 word-wrap))
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1072 :visible (menu-bar-menu-frame-live-and-visible-p)))
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1073
|
96587
|
1074 (define-key menu-bar-line-wrapping-menu [truncate]
|
|
1075 '(menu-item "Truncate Long Lines"
|
96875
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1076 (lambda ()
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1077 (interactive)
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1078 (if visual-line-mode (visual-line-mode 0))
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1079 (setq word-wrap nil)
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1080 (toggle-truncate-lines 1))
|
96587
|
1081 :help "Truncate long lines at window edge"
|
|
1082 :button (:radio . (or truncate-lines
|
|
1083 (truncated-partial-width-window-p)))
|
|
1084 :visible (menu-bar-menu-frame-live-and-visible-p)
|
|
1085 :enable (not (truncated-partial-width-window-p))))
|
95609
|
1086
|
96587
|
1087 (define-key menu-bar-line-wrapping-menu [window-wrap]
|
|
1088 '(menu-item "Wrap at Window Edge"
|
96875
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1089 (lambda () (interactive)
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1090 (if visual-line-mode (visual-line-mode 0))
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1091 (setq word-wrap nil)
|
771bcc6d1c99
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1092 (if truncate-lines (toggle-truncate-lines -1)))
|
96587
|
1093 :help "Wrap long lines at window edge"
|
|
1094 :button (:radio . (and (null truncate-lines)
|
|
1095 (not (truncated-partial-width-window-p))
|
|
1096 (not word-wrap)))
|
|
1097 :visible (menu-bar-menu-frame-live-and-visible-p)
|
|
1098 :enable (not (truncated-partial-width-window-p))))
|
|
1099
|
|
1100 (define-key menu-bar-options-menu [line-wrapping]
|
|
1101 (list 'menu-item "Line Wrapping in this Buffer" menu-bar-line-wrapping-menu))
|
|
1102
|
43254
|
1103
|
27730
|
1104 (define-key menu-bar-options-menu [highlight-separator]
|
|
1105 '("--"))
|
|
1106 (define-key menu-bar-options-menu [highlight-paren-mode]
|
47296
|
1107 (menu-bar-make-mm-toggle show-paren-mode
|
|
1108 "Paren Match Highlighting"
|
47421
|
1109 "Highlight matching/mismatched parentheses at cursor (Show Paren mode)"))
|
19617
|
1110 (define-key menu-bar-options-menu [transient-mark-mode]
|
47421
|
1111 (menu-bar-make-mm-toggle transient-mark-mode
|
|
1112 "Active Region Highlighting"
|
|
1113 "Make text in active region stand out in color (Transient Mark mode)"
|
|
1114 (:enable (not cua-mode))))
|
27730
|
1115
|
20336
|
1116
|
27730
|
1117 ;; The "Tools" menu items
|
|
1118
|
32329
|
1119 (defun send-mail-item-name ()
|
|
1120 (let* ((known-send-mail-commands '((sendmail-user-agent . "sendmail")
|
|
1121 (mh-e-user-agent . "MH")
|
|
1122 (message-user-agent . "Gnus Message")
|
|
1123 (gnus-user-agent . "Gnus")))
|
|
1124 (name (assq mail-user-agent known-send-mail-commands)))
|
|
1125 (if name
|
|
1126 (setq name (cdr name))
|
|
1127 (setq name (symbol-name mail-user-agent))
|
|
1128 (if (string-match "\\(.+\\)-user-agent" name)
|
|
1129 (setq name (match-string 1 name))))
|
|
1130 name))
|
|
1131
|
31471
|
1132 (defun read-mail-item-name ()
|
|
1133 (let* ((known-rmail-commands '((rmail . "RMAIL")
|
|
1134 (mh-rmail . "MH")
|
|
1135 (gnus . "Gnus")))
|
|
1136 (known (assq read-mail-command known-rmail-commands)))
|
|
1137 (if known (cdr known) (symbol-name read-mail-command))))
|
|
1138
|
27730
|
1139 (defvar menu-bar-games-menu (make-sparse-keymap "Games"))
|
|
1140
|
|
1141 (define-key menu-bar-tools-menu [games]
|
|
1142 (list 'menu-item "Games" menu-bar-games-menu))
|
|
1143
|
|
1144 (define-key menu-bar-tools-menu [separator-games]
|
|
1145 '("--"))
|
|
1146
|
30586
|
1147 (define-key menu-bar-games-menu [zone]
|
|
1148 '(menu-item "Zone Out" zone
|
|
1149 :help "Play tricks with Emacs display when Emacs is idle"))
|
27730
|
1150 (define-key menu-bar-games-menu [tetris]
|
92130
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1151 '(menu-item "Tetris" tetris
|
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1152 :help "Falling blocks game"))
|
27730
|
1153 (define-key menu-bar-games-menu [solitaire]
|
92130
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1154 '(menu-item "Solitaire" solitaire
|
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1155 :help "Get rid of all the stones"))
|
27730
|
1156 (define-key menu-bar-games-menu [snake]
|
|
1157 '(menu-item "Snake" snake
|
|
1158 :help "Move snake around avoiding collisions"))
|
92130
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1159 (define-key menu-bar-games-menu [pong]
|
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1160 '(menu-item "Pong" pong
|
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1161 :help "Bounce the ball to your opponent"))
|
27730
|
1162 (define-key menu-bar-games-menu [mult]
|
|
1163 '(menu-item "Multiplication Puzzle" mpuz
|
63501
|
1164 :help "Exercise brain with multiplication"))
|
27730
|
1165 (define-key menu-bar-games-menu [life]
|
|
1166 '(menu-item "Life" life
|
|
1167 :help "Watch how John Conway's cellular automaton evolves"))
|
|
1168 (define-key menu-bar-games-menu [hanoi]
|
|
1169 '(menu-item "Towers of Hanoi" hanoi
|
|
1170 :help "Watch Towers-of-Hanoi puzzle solved by Emacs"))
|
|
1171 (define-key menu-bar-games-menu [gomoku]
|
|
1172 '(menu-item "Gomoku" gomoku
|
|
1173 :help "Mark 5 contiguous squares (like tic-tac-toe)"))
|
92130
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1174 (define-key menu-bar-games-menu [bubbles]
|
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1175 '(menu-item "Bubbles" bubbles
|
8bebc6db7663
(menu-bar-games-menu): Add Bubbles and Pong. Add :help for Solitaire and Tetris.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1176 :help "Remove all bubbles using the fewest moves"))
|
27730
|
1177 (define-key menu-bar-games-menu [black-box]
|
|
1178 '(menu-item "Blackbox" blackbox
|
|
1179 :help "Find balls in a black box by shooting rays"))
|
|
1180 (define-key menu-bar-games-menu [adventure]
|
|
1181 '(menu-item "Adventure" dunnet
|
|
1182 :help "Dunnet, a text Adventure game for Emacs"))
|
|
1183 (define-key menu-bar-games-menu [5x5]
|
|
1184 '(menu-item "5x5" 5x5
|
|
1185 :help "Fill in all the squares on a 5x5 board"))
|
|
1186
|
94491
|
1187 (defvar menu-bar-encryption-decryption-menu
|
|
1188 (make-sparse-keymap "Encryption/Decryption"))
|
|
1189
|
|
1190 (define-key menu-bar-tools-menu [encryption-decryption]
|
|
1191 (list 'menu-item "Encryption/Decryption" menu-bar-encryption-decryption-menu))
|
|
1192
|
|
1193 (define-key menu-bar-tools-menu [separator-encryption-decryption]
|
|
1194 '("--"))
|
|
1195
|
|
1196 (define-key menu-bar-encryption-decryption-menu [insert-keys]
|
|
1197 '(menu-item "Insert Keys" epa-insert-keys
|
|
1198 :help "Insert public keys after the current point"))
|
|
1199
|
|
1200 (define-key menu-bar-encryption-decryption-menu [export-keys]
|
|
1201 '(menu-item "Export Keys" epa-export-keys
|
|
1202 :help "Export public keys to a file"))
|
|
1203
|
|
1204 (define-key menu-bar-encryption-decryption-menu [import-keys-region]
|
|
1205 '(menu-item "Import Keys from Region" epa-import-keys-region
|
|
1206 :help "Import public keys from the current region"))
|
|
1207
|
|
1208 (define-key menu-bar-encryption-decryption-menu [import-keys]
|
|
1209 '(menu-item "Import Keys from File..." epa-import-keys
|
|
1210 :help "Import public keys from a file"))
|
|
1211
|
|
1212 (define-key menu-bar-encryption-decryption-menu [list-keys]
|
|
1213 '(menu-item "List Keys" epa-list-keys
|
|
1214 :help "Browse your public keyring"))
|
|
1215
|
|
1216 (define-key menu-bar-encryption-decryption-menu [separator-keys]
|
|
1217 '("--"))
|
|
1218
|
|
1219 (define-key menu-bar-encryption-decryption-menu [sign-region]
|
|
1220 '(menu-item "Sign Region" epa-sign-region
|
|
1221 :help "Create digital signature of the current region"))
|
|
1222
|
|
1223 (define-key menu-bar-encryption-decryption-menu [verify-region]
|
|
1224 '(menu-item "Verify Region" epa-verify-region
|
|
1225 :help "Verify digital signature of the current region"))
|
|
1226
|
|
1227 (define-key menu-bar-encryption-decryption-menu [encrypt-region]
|
|
1228 '(menu-item "Encrypt Region" epa-encrypt-region
|
|
1229 :help "Encrypt the current region"))
|
|
1230
|
|
1231 (define-key menu-bar-encryption-decryption-menu [decrypt-region]
|
|
1232 '(menu-item "Decrypt Region" epa-decrypt-region
|
|
1233 :help "Decrypt the current region"))
|
|
1234
|
|
1235 (define-key menu-bar-encryption-decryption-menu [separator-file]
|
|
1236 '("--"))
|
|
1237
|
|
1238 (define-key menu-bar-encryption-decryption-menu [sign-file]
|
|
1239 '(menu-item "Sign File..." epa-sign-file
|
|
1240 :help "Create digital signature of a file"))
|
|
1241
|
|
1242 (define-key menu-bar-encryption-decryption-menu [verify-file]
|
|
1243 '(menu-item "Verify File..." epa-verify-file
|
|
1244 :help "Verify digital signature of a file"))
|
|
1245
|
|
1246 (define-key menu-bar-encryption-decryption-menu [encrypt-file]
|
|
1247 '(menu-item "Encrypt File..." epa-encrypt-file
|
|
1248 :help "Encrypt a file"))
|
|
1249
|
|
1250 (define-key menu-bar-encryption-decryption-menu [decrypt-file]
|
|
1251 '(menu-item "Decrypt File..." epa-decrypt-file
|
|
1252 :help "Decrypt a file"))
|
|
1253
|
45324
76c4660660ec
(menu-bar-tools-menu) <calculator>: Renamed to "Simple Calculator".
Colin Walters <walters@gnu.org>
diff
changeset
|
1254 (define-key menu-bar-tools-menu [simple-calculator]
|
76c4660660ec
(menu-bar-tools-menu) <calculator>: Renamed to "Simple Calculator".
Colin Walters <walters@gnu.org>
diff
changeset
|
1255 '(menu-item "Simple Calculator" calculator
|
76c4660660ec
(menu-bar-tools-menu) <calculator>: Renamed to "Simple Calculator".
Colin Walters <walters@gnu.org>
diff
changeset
|
1256 :help "Invoke the Emacs built-in quick calculator"))
|
76c4660660ec
(menu-bar-tools-menu) <calculator>: Renamed to "Simple Calculator".
Colin Walters <walters@gnu.org>
diff
changeset
|
1257 (define-key menu-bar-tools-menu [calc]
|
76c4660660ec
(menu-bar-tools-menu) <calculator>: Renamed to "Simple Calculator".
Colin Walters <walters@gnu.org>
diff
changeset
|
1258 '(menu-item "Programmable Calculator" calc
|
76c4660660ec
(menu-bar-tools-menu) <calculator>: Renamed to "Simple Calculator".
Colin Walters <walters@gnu.org>
diff
changeset
|
1259 :help "Invoke the Emacs built-in full scientific calculator"))
|
28557
|
1260 (define-key menu-bar-tools-menu [calendar]
|
74559
|
1261 '(menu-item "Calendar" calendar
|
|
1262 :help "Invoke the Emacs built-in calendar"))
|
43305
|
1263
|
|
1264 (define-key menu-bar-tools-menu [separator-net]
|
|
1265 '("--"))
|
|
1266
|
27730
|
1267 (define-key menu-bar-tools-menu [directory-search]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1268 '(menu-item "Directory Search" eudc-tools-menu))
|
28557
|
1269 (define-key menu-bar-tools-menu [compose-mail]
|
32329
|
1270 (list
|
|
1271 'menu-item `(format "Send Mail (with %s)" (send-mail-item-name))
|
|
1272 'compose-mail
|
|
1273 :visible `(and mail-user-agent (not (eq mail-user-agent 'ignore)))
|
|
1274 :help "Send a mail message"))
|
28557
|
1275 (define-key menu-bar-tools-menu [rmail]
|
31471
|
1276 (list
|
|
1277 'menu-item `(format "Read Mail (with %s)" (read-mail-item-name))
|
46908
|
1278 'menu-bar-read-mail
|
32329
|
1279 :visible `(and read-mail-command (not (eq read-mail-command 'ignore)))
|
31471
|
1280 :help "Read your mail and reply to it"))
|
46908
|
1281
|
|
1282 (defun menu-bar-read-mail ()
|
47152
|
1283 "Read mail using `read-mail-command'."
|
46908
|
1284 (interactive)
|
|
1285 (call-interactively read-mail-command))
|
|
1286
|
27730
|
1287 (define-key menu-bar-tools-menu [gnus]
|
31471
|
1288 '(menu-item "Read Net News (Gnus)" gnus
|
27730
|
1289 :help "Read network news groups"))
|
|
1290
|
|
1291 (define-key menu-bar-tools-menu [separator-vc]
|
|
1292 '("--"))
|
|
1293
|
28258
|
1294 (define-key menu-bar-tools-menu [pcl-cvs]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1295 '(menu-item "PCL-CVS" cvs-global-menu))
|
78822
|
1296 (define-key menu-bar-tools-menu [vc] nil) ;Create the place for the VC menu.
|
27730
|
1297
|
|
1298 (define-key menu-bar-tools-menu [separator-compare]
|
|
1299 '("--"))
|
|
1300
|
|
1301 (define-key menu-bar-tools-menu [ediff-misc]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1302 '(menu-item "Ediff Miscellanea" menu-bar-ediff-misc-menu))
|
27730
|
1303 (define-key menu-bar-tools-menu [epatch]
|
|
1304 '(menu-item "Apply Patch" menu-bar-epatch-menu))
|
|
1305 (define-key menu-bar-tools-menu [ediff-merge]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1306 '(menu-item "Merge" menu-bar-ediff-merge-menu))
|
27730
|
1307 (define-key menu-bar-tools-menu [compare]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1308 '(menu-item "Compare (Ediff)" menu-bar-ediff-menu))
|
27730
|
1309
|
|
1310 (define-key menu-bar-tools-menu [separator-spell]
|
|
1311 '("--"))
|
|
1312
|
|
1313 (define-key menu-bar-tools-menu [spell]
|
|
1314 '(menu-item "Spell Checking" ispell-menu-map))
|
|
1315
|
|
1316 (define-key menu-bar-tools-menu [separator-prog]
|
|
1317 '("--"))
|
|
1318
|
|
1319 (define-key menu-bar-tools-menu [gdb]
|
44267
|
1320 '(menu-item "Debugger (GDB)..." gdb
|
|
1321 :help "Debug a program from within Emacs with GDB"))
|
27730
|
1322 (define-key menu-bar-tools-menu [shell-on-region]
|
|
1323 '(menu-item "Shell Command on Region..." shell-command-on-region
|
|
1324 :enable mark-active
|
|
1325 :help "Pass marked region to a shell command"))
|
|
1326 (define-key menu-bar-tools-menu [shell]
|
|
1327 '(menu-item "Shell Command..." shell-command
|
|
1328 :help "Invoke a shell command and catch its output"))
|
|
1329 (define-key menu-bar-tools-menu [compile]
|
|
1330 '(menu-item "Compile..." compile
|
|
1331 :help "Invoke compiler or Make, view compilation errors"))
|
|
1332 (define-key menu-bar-tools-menu [grep]
|
76980
|
1333 '(menu-item "Search Files (Grep)..." grep
|
|
1334 :help "Search files for strings or regexps (with Grep)"))
|
27730
|
1335
|
|
1336
|
|
1337 ;; The "Help" menu items
|
|
1338
|
20336
|
1339 (defvar menu-bar-describe-menu (make-sparse-keymap "Describe"))
|
|
1340
|
27730
|
1341 (define-key menu-bar-describe-menu [mule-diag]
|
|
1342 '(menu-item "Show All of Mule Status" mule-diag
|
|
1343 :visible default-enable-multibyte-characters
|
|
1344 :help "Display multilingual environment settings"))
|
41475
|
1345 (define-key menu-bar-describe-menu [describe-coding-system-briefly]
|
79570
|
1346 '(menu-item "Describe Coding System (Briefly)"
|
41475
|
1347 describe-current-coding-system-briefly
|
|
1348 :visible default-enable-multibyte-characters))
|
27730
|
1349 (define-key menu-bar-describe-menu [describe-coding-system]
|
|
1350 '(menu-item "Describe Coding System..." describe-coding-system
|
|
1351 :visible default-enable-multibyte-characters))
|
|
1352 (define-key menu-bar-describe-menu [describe-input-method]
|
|
1353 '(menu-item "Describe Input Method..." describe-input-method
|
|
1354 :visible default-enable-multibyte-characters
|
|
1355 :help "Keyboard layout for specific input method"))
|
|
1356 (define-key menu-bar-describe-menu [describe-language-environment]
|
28557
|
1357 (list 'menu-item "Describe Language Environment"
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1358 describe-language-environment-map))
|
27730
|
1359
|
|
1360 (define-key menu-bar-describe-menu [separator-desc-mule]
|
28557
|
1361 '("--"))
|
27730
|
1362
|
20336
|
1363 (define-key menu-bar-describe-menu [list-keybindings]
|
27730
|
1364 '(menu-item "List Key Bindings" describe-bindings
|
99781
|
1365 :help "Display all current key bindings (keyboard shortcuts)"))
|
41475
|
1366 (define-key menu-bar-describe-menu [describe-current-display-table]
|
|
1367 '(menu-item "Describe Display Table" describe-current-display-table
|
|
1368 :help "Describe the current display table"))
|
|
1369 (define-key menu-bar-describe-menu [describe-face]
|
|
1370 '(menu-item "Describe Face..." describe-face
|
|
1371 :help "Display the properties of a face"))
|
27730
|
1372 (define-key menu-bar-describe-menu [describe-variable]
|
|
1373 '(menu-item "Describe Variable..." describe-variable
|
|
1374 :help "Display documentation of variable/option"))
|
|
1375 (define-key menu-bar-describe-menu [describe-function]
|
|
1376 '(menu-item "Describe Function..." describe-function
|
|
1377 :help "Display documentation of function/command"))
|
48524
|
1378 (define-key menu-bar-describe-menu [describe-key-1]
|
65119
|
1379 '(menu-item "Describe Key or Mouse Operation..." describe-key
|
48524
|
1380 ;; Users typically don't identify keys and menu items...
|
|
1381 :help "Display documentation of command bound to a \
|
65119
|
1382 key, a click, or a menu-item"))
|
20336
|
1383 (define-key menu-bar-describe-menu [describe-mode]
|
27730
|
1384 '(menu-item "Describe Buffer Modes" describe-mode
|
|
1385 :help "Describe this buffer's major and minor mode"))
|
20336
|
1386
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1387 (defvar menu-bar-search-documentation-menu
|
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1388 (make-sparse-keymap "Search Documentation"))
|
41703
|
1389 (defun menu-bar-read-lispref ()
|
|
1390 "Display the Emacs Lisp Reference manual in Info mode."
|
|
1391 (interactive)
|
|
1392 (info "elisp"))
|
|
1393
|
|
1394 (defun menu-bar-read-lispintro ()
|
|
1395 "Display the Introduction to Emacs Lisp Programming in Info mode."
|
|
1396 (interactive)
|
|
1397 (info "eintr"))
|
|
1398
|
|
1399 (defun search-emacs-glossary ()
|
|
1400 "Display the Glossary node of the Emacs manual in Info mode."
|
|
1401 (interactive)
|
|
1402 (info "(emacs)Glossary"))
|
|
1403
|
|
1404 (defun emacs-index-search (topic)
|
|
1405 "Look up TOPIC in the indices of the Emacs User Manual."
|
|
1406 (interactive "sSubject to look up: ")
|
|
1407 (info "emacs")
|
|
1408 (Info-index topic))
|
|
1409
|
|
1410 (defun elisp-index-search (topic)
|
|
1411 "Look up TOPIC in the indices of the Emacs Lisp Reference Manual."
|
|
1412 (interactive "sSubject to look up: ")
|
|
1413 (info "elisp")
|
|
1414 (Info-index topic))
|
41475
|
1415
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1416 (define-key menu-bar-search-documentation-menu [search-documentation-strings]
|
41703
|
1417 '(menu-item "Search Documentation Strings..." apropos-documentation
|
|
1418 :help
|
|
1419 "Find functions and variables whose doc strings match a regexp"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1420 (define-key menu-bar-search-documentation-menu [find-any-object-by-name]
|
41703
|
1421 '(menu-item "Find Any Object by Name..." apropos
|
|
1422 :help "Find symbols of any kind whose names match a regexp"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1423 (define-key menu-bar-search-documentation-menu [find-option-by-value]
|
41703
|
1424 '(menu-item "Find Options by Value..." apropos-value
|
|
1425 :help "Find variables whose values match a regexp"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1426 (define-key menu-bar-search-documentation-menu [find-options-by-name]
|
41703
|
1427 '(menu-item "Find Options by Name..." apropos-variable
|
|
1428 :help "Find variables whose names match a regexp"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1429 (define-key menu-bar-search-documentation-menu [find-commands-by-name]
|
41703
|
1430 '(menu-item "Find Commands by Name..." apropos-command
|
|
1431 :help "Find commands whose names match a regexp"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1432 (define-key menu-bar-search-documentation-menu [sep1]
|
41703
|
1433 '("--"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1434 (define-key menu-bar-search-documentation-menu [lookup-command-in-manual]
|
70972
3ffa2f66a303
(menu-bar-apropos-menu): Move "Find Key in Manual" and "Find Command in Manual"
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1435 '(menu-item "Look Up Command in User Manual..." Info-goto-emacs-command-node
|
3ffa2f66a303
(menu-bar-apropos-menu): Move "Find Key in Manual" and "Find Command in Manual"
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1436 :help "Display manual section that describes a command"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1437 (define-key menu-bar-search-documentation-menu [lookup-key-in-manual]
|
70972
3ffa2f66a303
(menu-bar-apropos-menu): Move "Find Key in Manual" and "Find Command in Manual"
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1438 '(menu-item "Look Up Key in User Manual..." Info-goto-emacs-key-command-node
|
3ffa2f66a303
(menu-bar-apropos-menu): Move "Find Key in Manual" and "Find Command in Manual"
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1439 :help "Display manual section that describes a key"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1440 (define-key menu-bar-search-documentation-menu [lookup-subject-in-elisp-manual]
|
41703
|
1441 '(menu-item "Look Up Subject in ELisp Manual..." elisp-index-search
|
|
1442 :help "Find description of a subject in Emacs Lisp manual"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1443 (define-key menu-bar-search-documentation-menu [lookup-subject-in-emacs-manual]
|
41703
|
1444 '(menu-item "Look Up Subject in User Manual..." emacs-index-search
|
|
1445 :help "Find description of a subject in Emacs User manual"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1446 (define-key menu-bar-search-documentation-menu [emacs-terminology]
|
41703
|
1447 '(menu-item "Emacs Terminology" search-emacs-glossary
|
|
1448 :help "Display the Glossary section of the Emacs manual"))
|
41475
|
1449
|
41703
|
1450 (defvar menu-bar-manuals-menu (make-sparse-keymap "More Manuals"))
|
20336
|
1451
|
|
1452 (define-key menu-bar-manuals-menu [man]
|
27730
|
1453 '(menu-item "Read Man Page..." manual-entry
|
|
1454 :help "Man-page docs for external commands and libraries"))
|
20336
|
1455 (define-key menu-bar-manuals-menu [sep2]
|
|
1456 '("--"))
|
41703
|
1457 (define-key menu-bar-manuals-menu [order-emacs-manuals]
|
|
1458 '(menu-item "Ordering Manuals" view-order-manuals
|
|
1459 :help "How to order manuals from the Free Software Foundation"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1460 (define-key menu-bar-manuals-menu [lookup-subject-in-all-manuals]
|
99781
|
1461 '(menu-item "Lookup Subject in all Manuals..." info-apropos
|
70793
|
1462 :help "Find description of a subject in all installed manuals"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1463 (define-key menu-bar-manuals-menu [other-manuals]
|
41703
|
1464 '(menu-item "All Other Manuals (Info)" Info-directory
|
27730
|
1465 :help "Read any of the installed manuals"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1466 (define-key menu-bar-manuals-menu [emacs-lisp-reference]
|
41703
|
1467 '(menu-item "Emacs Lisp Reference" menu-bar-read-lispref
|
|
1468 :help "Read the Emacs Lisp Reference manual"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1469 (define-key menu-bar-manuals-menu [emac-lisp-intro]
|
41703
|
1470 '(menu-item "Introduction to Emacs Lisp" menu-bar-read-lispintro
|
|
1471 :help "Read the Introduction to Emacs Lisp Programming"))
|
27730
|
1472
|
79377
|
1473 (define-key menu-bar-help-menu [about-gnu-project]
|
92350
|
1474 '(menu-item "About GNU" describe-gnu-project
|
79377
|
1475 :help "About the GNU System, GNU Project, and GNU/Linux"))
|
|
1476 (define-key menu-bar-help-menu [about-emacs]
|
|
1477 '(menu-item "About Emacs" about-emacs
|
|
1478 :help "Display version number, copyright info, and basic help"))
|
41703
|
1479 (define-key menu-bar-help-menu [sep4]
|
20336
|
1480 '("--"))
|
20762
|
1481 (define-key menu-bar-help-menu [describe-no-warranty]
|
27730
|
1482 '(menu-item "(Non)Warranty" describe-no-warranty
|
|
1483 :help "Explain that Emacs has NO WARRANTY"))
|
20762
|
1484 (define-key menu-bar-help-menu [describe-copying]
|
27730
|
1485 '(menu-item "Copying Conditions" describe-copying
|
|
1486 :help "Show the Emacs license (GPL)"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1487 (define-key menu-bar-help-menu [getting-new-versions]
|
27730
|
1488 '(menu-item "Getting New Versions" describe-distribution
|
99781
|
1489 :help "How to get the latest version of Emacs"))
|
46908
|
1490 (defun menu-bar-help-extra-packages ()
|
|
1491 "Display help about some additional packages available for Emacs."
|
|
1492 (interactive)
|
|
1493 (let (enable-local-variables)
|
|
1494 (view-file (expand-file-name "MORE.STUFF"
|
|
1495 data-directory))
|
|
1496 (goto-address)))
|
20336
|
1497 (define-key menu-bar-help-menu [sep2]
|
|
1498 '("--"))
|
79377
|
1499 (define-key menu-bar-help-menu [external-packages]
|
|
1500 '(menu-item "External Packages" menu-bar-help-extra-packages
|
|
1501 :help "Lisp packages distributed separately for use in Emacs"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1502 (define-key menu-bar-help-menu [find-emacs-packages]
|
61024
bef623e1dcc0
(menu-bar-file-menu): Remove ellipsis from "Recover Crashed Session".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1503 '(menu-item "Find Emacs Packages" finder-by-keyword
|
27730
|
1504 :help "Find packages and features by keyword"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1505 (define-key menu-bar-help-menu [more-manuals]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1506 (list 'menu-item "More Manuals" menu-bar-manuals-menu))
|
41703
|
1507 (define-key menu-bar-help-menu [emacs-manual]
|
46908
|
1508 '(menu-item "Read the Emacs Manual" info-emacs-manual
|
41703
|
1509 :help "Full documentation of Emacs features"))
|
20336
|
1510 (define-key menu-bar-help-menu [describe]
|
70882
c5d2bd581ee7
* menu-bar.el, international/mule-cmds.el: Remove tooltips for
Chong Yidong <cyd@stupidchicken.com>
diff
changeset
|
1511 (list 'menu-item "Describe" menu-bar-describe-menu))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1512 (define-key menu-bar-help-menu [search-documentation]
|
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1513 (list 'menu-item "Search Documentation" menu-bar-search-documentation-menu))
|
20336
|
1514 (define-key menu-bar-help-menu [sep1]
|
|
1515 '("--"))
|
79377
|
1516 (define-key menu-bar-help-menu [emacs-psychotherapist]
|
|
1517 '(menu-item "Emacs Psychotherapist" doctor
|
|
1518 :help "Our doctor will help you feel better"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1519 (define-key menu-bar-help-menu [send-emacs-bug-report]
|
27730
|
1520 '(menu-item "Send Bug Report..." report-emacs-bug
|
|
1521 :help "Send e-mail to Emacs maintainers"))
|
78894
ab22b2902e1f
(menu-bar-search-documentation-menu): Renamed from menu-bar-apropos-menu.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
1522 (define-key menu-bar-help-menu [emacs-known-problems]
|
74559
|
1523 '(menu-item "Emacs Known Problems" view-emacs-problems
|
|
1524 :help "Read about known problems with Emacs"))
|
27730
|
1525 (define-key menu-bar-help-menu [emacs-news]
|
|
1526 '(menu-item "Emacs News" view-emacs-news
|
|
1527 :help "New features of this version"))
|
|
1528 (define-key menu-bar-help-menu [emacs-faq]
|
74559
|
1529 '(menu-item "Emacs FAQ" view-emacs-FAQ
|
|
1530 :help "Frequently asked (and answered) questions about Emacs"))
|
46908
|
1531
|
|
1532 (defun help-with-tutorial-spec-language ()
|
|
1533 "Use the Emacs tutorial, specifying which language you want."
|
49597
|
1534 (interactive)
|
46908
|
1535 (help-with-tutorial t))
|
|
1536
|
29685
|
1537 (define-key menu-bar-help-menu [emacs-tutorial-language-specific]
|
|
1538 '(menu-item "Emacs Tutorial (choose language)..."
|
46908
|
1539 help-with-tutorial-spec-language
|
29685
|
1540 :help "Learn how to use Emacs (choose a language)"))
|
27730
|
1541 (define-key menu-bar-help-menu [emacs-tutorial]
|
|
1542 '(menu-item "Emacs Tutorial" help-with-tutorial
|
|
1543 :help "Learn how to use Emacs"))
|
2178
|
1544
|
65404
|
1545 (defun menu-bar-menu-frame-live-and-visible-p ()
|
|
1546 "Return non-nil if the menu frame is alive and visible.
|
|
1547 The menu frame is the frame for which we are updating the menu."
|
67705
|
1548 (let ((menu-frame (or menu-updating-frame (selected-frame))))
|
65404
|
1549 (and (frame-live-p menu-frame)
|
|
1550 (frame-visible-p menu-frame))))
|
|
1551
|
|
1552 (defun menu-bar-non-minibuffer-window-p ()
|
|
1553 "Return non-nil if selected window of the menu frame is not a minibuf window.
|
|
1554
|
|
1555 See the documentation of `menu-bar-menu-frame-live-and-visible-p'
|
|
1556 for the definition of the menu frame."
|
67705
|
1557 (let ((menu-frame (or menu-updating-frame (selected-frame))))
|
65404
|
1558 (not (window-minibuffer-p (frame-selected-window menu-frame)))))
|
|
1559
|
67628
6b7e5db3f184
(kill-this-buffer): Set a good example by using menu bar, not menubar
Bill Wohler <wohler@newt.com>
diff
changeset
|
1560 (defun kill-this-buffer () ; for the menu bar
|
93010
|
1561 "Kill the current buffer.
|
|
1562 When called in the minibuffer, get out of the minibuffer
|
|
1563 using `abort-recursive-edit'."
|
2175
|
1564 (interactive)
|
93010
|
1565 (if (menu-bar-non-minibuffer-window-p)
|
|
1566 (kill-buffer (current-buffer))
|
|
1567 (abort-recursive-edit)))
|
2175
|
1568
|
2178
|
1569 (defun kill-this-buffer-enabled-p ()
|
|
1570 (let ((count 0)
|
|
1571 (buffers (buffer-list)))
|
|
1572 (while buffers
|
|
1573 (or (string-match "^ " (buffer-name (car buffers)))
|
|
1574 (setq count (1+ count)))
|
|
1575 (setq buffers (cdr buffers)))
|
93010
|
1576 (or (not (menu-bar-non-minibuffer-window-p))
|
|
1577 (> count 1))))
|
11525
|
1578
|
65404
|
1579 (put 'dired 'menu-enable '(menu-bar-non-minibuffer-window-p))
|
11525
|
1580
|
4337
|
1581 ;; Permit deleting frame if it would leave a visible or iconified frame.
|
11891
|
1582 (defun delete-frame-enabled-p ()
|
|
1583 "Return non-nil if `delete-frame' should be enabled in the menu bar."
|
|
1584 (let ((frames (frame-list))
|
15471
|
1585 (count 0))
|
|
1586 (while frames
|
|
1587 (if (frame-visible-p (car frames))
|
|
1588 (setq count (1+ count)))
|
|
1589 (setq frames (cdr frames)))
|
|
1590 (> count 1)))
|
2178
|
1591
|
17665
|
1592 (defcustom yank-menu-length 20
|
100171
|
1593 "Maximum length to display in the yank-menu."
|
17665
|
1594 :type 'integer
|
94264
|
1595 :group 'menu)
|
3795
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1596
|
8767
|
1597 (defun menu-bar-update-yank-menu (string old)
|
|
1598 (let ((front (car (cdr yank-menu)))
|
|
1599 (menu-string (if (<= (length string) yank-menu-length)
|
|
1600 string
|
10590
|
1601 (concat
|
|
1602 (substring string 0 (/ yank-menu-length 2))
|
|
1603 "..."
|
|
1604 (substring string (- (/ yank-menu-length 2)))))))
|
12610
|
1605 ;; Don't let the menu string be all dashes
|
|
1606 ;; because that has a special meaning in a menu.
|
|
1607 (if (string-match "\\`-+\\'" menu-string)
|
|
1608 (setq menu-string (concat menu-string " ")))
|
8767
|
1609 ;; If we're supposed to be extending an existing string, and that
|
|
1610 ;; string really is at the front of the menu, then update it in place.
|
|
1611 (if (and old (or (eq old (car front))
|
|
1612 (string= old (car front))))
|
3942
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
diff
changeset
|
1613 (progn
|
8767
|
1614 (setcar front string)
|
|
1615 (setcar (cdr front) menu-string))
|
|
1616 (setcdr yank-menu
|
|
1617 (cons
|
|
1618 (cons string (cons menu-string 'menu-bar-select-yank))
|
|
1619 (cdr yank-menu)))))
|
|
1620 (if (> (length (cdr yank-menu)) kill-ring-max)
|
|
1621 (setcdr (nthcdr kill-ring-max yank-menu) nil)))
|
|
1622
|
20481
|
1623 (put 'menu-bar-select-yank 'apropos-inhibit t)
|
8767
|
1624 (defun menu-bar-select-yank ()
|
68797
|
1625 "Insert the stretch of previously-killed text selected from menu.
|
|
1626 The menu shows all the killed text sequences stored in `kill-ring'."
|
8767
|
1627 (interactive "*")
|
|
1628 (push-mark (point))
|
|
1629 (insert last-command-event))
|
44803
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1630
|
2181
|
1631
|
94264
|
1632 ;;; Buffers Menu
|
|
1633
|
|
1634 (defcustom buffers-menu-max-size 10
|
100171
|
1635 "Maximum number of entries which may appear on the Buffers menu.
|
94264
|
1636 If this is 10, then only the ten most-recently-selected buffers are shown.
|
|
1637 If this is nil, then all buffers are shown.
|
|
1638 A large number or nil slows down menu responsiveness."
|
|
1639 :type '(choice integer
|
|
1640 (const :tag "All" nil))
|
|
1641 :group 'menu)
|
|
1642
|
|
1643 (defcustom buffers-menu-buffer-name-length 30
|
100171
|
1644 "Maximum length of the buffer name on the Buffers menu.
|
94264
|
1645 If this is a number, then buffer names are truncated to this length.
|
|
1646 If this is nil, then buffer names are shown in full.
|
|
1647 A large number or nil makes the menu too wide."
|
|
1648 :type '(choice integer
|
|
1649 (const :tag "Full length" nil))
|
|
1650 :group 'menu)
|
|
1651
|
44803
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1652 (defcustom buffers-menu-show-directories 'unless-uniquify
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1653 "If non-nil, show directories in the Buffers menu for buffers that have them.
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1654 The special value `unless-uniquify' means that directories will be shown
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1655 unless `uniquify-buffer-name-style' is non-nil (in which case, buffer
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1656 names should include enough of a buffer's directory to distinguish it
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1657 from other buffers).
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1658
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1659 Setting this variable directly does not take effect until next time the
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1660 Buffers menu is regenerated."
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1661 :set (lambda (symbol value)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1662 (set symbol value)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1663 (menu-bar-update-buffers t))
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1664 :initialize 'custom-initialize-default
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1665 :type '(choice (const :tag "Never" nil)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1666 (const :tag "Unless uniquify is enabled" unless-uniquify)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1667 (const :tag "Always" t))
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1668 :group 'menu)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1669
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1670 (defcustom buffers-menu-show-status t
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1671 "If non-nil, show modified/read-only status of buffers in the Buffers menu.
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1672 Setting this variable directly does not take effect until next time the
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1673 Buffers menu is regenerated."
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1674 :set (lambda (symbol value)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1675 (set symbol value)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1676 (menu-bar-update-buffers t))
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1677 :initialize 'custom-initialize-default
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1678 :type 'boolean
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1679 :group 'menu)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1680
|
4628
|
1681 (defvar list-buffers-directory nil)
|
|
1682
|
95059
4ce13b37e978
menu-bar-select-buffer: Reinsert it as msb.el use it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff
changeset
|
1683 (defun menu-bar-select-buffer ()
|
4ce13b37e978
menu-bar-select-buffer: Reinsert it as msb.el use it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff
changeset
|
1684 (interactive)
|
4ce13b37e978
menu-bar-select-buffer: Reinsert it as msb.el use it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff
changeset
|
1685 (switch-to-buffer last-command-event))
|
4ce13b37e978
menu-bar-select-buffer: Reinsert it as msb.el use it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff
changeset
|
1686
|
92745
|
1687 (defun menu-bar-select-frame (frame)
|
|
1688 (make-frame-visible frame)
|
|
1689 (raise-frame frame)
|
|
1690 (select-frame frame))
|
7150
|
1691
|
9518
|
1692 (defun menu-bar-update-buffers-1 (elt)
|
44776
|
1693 (let* ((buf (car elt))
|
|
1694 (file
|
44803
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1695 (and (if (eq buffers-menu-show-directories 'unless-uniquify)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1696 (or (not (boundp 'uniquify-buffer-name-style))
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1697 (null uniquify-buffer-name-style))
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1698 buffers-menu-show-directories)
|
44776
|
1699 (or (buffer-file-name buf)
|
44803
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1700 (buffer-local-value 'list-buffers-directory buf)))))
|
44776
|
1701 (when file
|
|
1702 (setq file (file-name-directory file)))
|
|
1703 (when (and file (> (length file) 20))
|
|
1704 (setq file (concat "..." (substring file -17))))
|
44803
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1705 (cons (if buffers-menu-show-status
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1706 (let ((mod (if (buffer-modified-p buf) "*" ""))
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1707 (ro (if (buffer-local-value 'buffer-read-only buf) "%" "")))
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1708 (if file
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1709 (format "%s %s%s -- %s" (cdr elt) mod ro file)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1710 (format "%s %s%s" (cdr elt) mod ro)))
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1711 (if file
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1712 (format "%s -- %s" (cdr elt) file)
|
de50fca9a8aa
(buffers-menu-show-directories, buffers-menu-show-status): New variables.
Miles Bader <miles@gnu.org>
diff
changeset
|
1713 (cdr elt)))
|
44776
|
1714 buf)))
|
|
1715
|
44770
|
1716 ;; Used to cache the menu entries for commands in the Buffers menu
|
|
1717 (defvar menu-bar-buffers-menu-command-entries nil)
|
|
1718
|
36230
|
1719 (defun menu-bar-update-buffers (&optional force)
|
8316
|
1720 ;; If user discards the Buffers item, play along.
|
8347
0fff2106fa43
(menu-bar-update-buffers): Use (current-global-map), not global-map.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1721 (and (lookup-key (current-global-map) [menu-bar buffer])
|
36230
|
1722 (or force (frame-or-buffer-changed-p))
|
8316
|
1723 (let ((buffers (buffer-list))
|
|
1724 (frames (frame-list))
|
79167
|
1725 buffers-menu)
|
8316
|
1726 ;; If requested, list only the N most recently selected buffers.
|
|
1727 (if (and (integerp buffers-menu-max-size)
|
|
1728 (> buffers-menu-max-size 1))
|
|
1729 (if (> (length buffers) buffers-menu-max-size)
|
|
1730 (setcdr (nthcdr buffers-menu-max-size buffers) nil)))
|
7150
|
1731
|
8316
|
1732 ;; Make the menu of buffers proper.
|
|
1733 (setq buffers-menu
|
92745
|
1734 (let (alist)
|
44768
|
1735 ;; Put into each element of buffer-list
|
|
1736 ;; the name for actual display,
|
|
1737 ;; perhaps truncated in the middle.
|
92745
|
1738 (dolist (buf buffers)
|
|
1739 (let ((name (buffer-name buf)))
|
|
1740 (unless (eq ?\s (aref name 0))
|
|
1741 (push (menu-bar-update-buffers-1
|
|
1742 (cons buf
|
94264
|
1743 (if (and (integerp buffers-menu-buffer-name-length)
|
|
1744 (> (length name) buffers-menu-buffer-name-length))
|
|
1745 (concat
|
|
1746 (substring
|
|
1747 name 0 (/ buffers-menu-buffer-name-length 2))
|
|
1748 "..."
|
|
1749 (substring
|
|
1750 name (- (/ buffers-menu-buffer-name-length 2))))
|
|
1751 name)
|
|
1752 ))
|
92745
|
1753 alist))))
|
|
1754 ;; Now make the actual list of items.
|
|
1755 (let ((buffers-vec (make-vector (length alist) nil))
|
|
1756 (i (length alist)))
|
|
1757 (dolist (pair alist)
|
|
1758 (setq i (1- i))
|
|
1759 (aset buffers-vec i
|
|
1760 (nconc (list (car pair)
|
44768
|
1761 (cons nil nil))
|
92745
|
1762 `(lambda ()
|
|
1763 (interactive)
|
|
1764 (switch-to-buffer ,(cdr pair))))))
|
|
1765 (list buffers-vec))))
|
7239
|
1766
|
8316
|
1767 ;; Make a Frames menu if we have more than one frame.
|
44768
|
1768 (when (cdr frames)
|
92745
|
1769 (let* ((frames-vec (make-vector (length frames) nil))
|
|
1770 (frames-menu
|
|
1771 (cons 'keymap
|
|
1772 (list "Select Frame" frames-vec)))
|
|
1773 (i 0))
|
|
1774 (dolist (frame frames)
|
|
1775 (aset frames-vec i
|
|
1776 (nconc
|
|
1777 (list
|
|
1778 (frame-parameter frame 'name)
|
|
1779 (cons nil nil))
|
|
1780 `(lambda ()
|
|
1781 (interactive) (menu-bar-select-frame ,frame))))
|
|
1782 (setq i (1+ i)))
|
44768
|
1783 ;; Put it after the normal buffers
|
|
1784 (setq buffers-menu
|
|
1785 (nconc buffers-menu
|
|
1786 `((frames-separator "--")
|
|
1787 (frames menu-item "Frames" ,frames-menu))))))
|
|
1788
|
44770
|
1789 ;; Add in some normal commands at the end of the menu. We use
|
|
1790 ;; the copy cached in `menu-bar-buffers-menu-command-entries'
|
|
1791 ;; if it's been set already. Note that we can't use constant
|
|
1792 ;; lists for the menu-entries, because the low-level menu-code
|
|
1793 ;; modifies them.
|
|
1794 (unless menu-bar-buffers-menu-command-entries
|
|
1795 (setq menu-bar-buffers-menu-command-entries
|
|
1796 (list '(command-separator "--")
|
44907
5e84d4496348
(menu-bar-update-buffers): Add menu items Next Buffer and Previous Buffer.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1797 (list 'next-buffer
|
5e84d4496348
(menu-bar-update-buffers): Add menu items Next Buffer and Previous Buffer.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1798 'menu-item
|
5e84d4496348
(menu-bar-update-buffers): Add menu items Next Buffer and Previous Buffer.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1799 "Next Buffer"
|
5e84d4496348
(menu-bar-update-buffers): Add menu items Next Buffer and Previous Buffer.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1800 'next-buffer
|
5e84d4496348
(menu-bar-update-buffers): Add menu items Next Buffer and Previous Buffer.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1801 :help "Switch to the \"next\" buffer in a cyclic order")
|
67602
|
1802 (list 'previous-buffer
|
44907
5e84d4496348
(menu-bar-update-buffers): Add menu items Next Buffer and Previous Buffer.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1803 'menu-item
|
5e84d4496348
(menu-bar-update-buffers): Add menu items Next Buffer and Previous Buffer.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1804 "Previous Buffer"
|
67602
|
1805 'previous-buffer
|
44907
5e84d4496348
(menu-bar-update-buffers): Add menu items Next Buffer and Previous Buffer.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1806 :help "Switch to the \"previous\" buffer in a cyclic order")
|
44770
|
1807 (list 'select-named-buffer
|
|
1808 'menu-item
|
|
1809 "Select Named Buffer..."
|
|
1810 'switch-to-buffer
|
|
1811 :help "Prompt for a buffer name, and select that buffer in the current window")
|
|
1812 (list 'list-all-buffers
|
|
1813 'menu-item
|
|
1814 "List All Buffers"
|
|
1815 'list-buffers
|
73757
|
1816 :help "Pop up a window listing all Emacs buffers"
|
44770
|
1817 ))))
|
44768
|
1818 (setq buffers-menu
|
44770
|
1819 (nconc buffers-menu menu-bar-buffers-menu-command-entries))
|
44768
|
1820
|
79167
|
1821 ;; We used to "(define-key (current-global-map) [menu-bar buffer]"
|
|
1822 ;; but that did not do the right thing when the [menu-bar buffer]
|
|
1823 ;; entry above had been moved (e.g. to a parent keymap).
|
|
1824 (setcdr global-buffers-menu-map (cons "Select Buffer" buffers-menu)))))
|
2181
|
1825
|
7150
|
1826 (add-hook 'menu-bar-update-hook 'menu-bar-update-buffers)
|
2181
|
1827
|
12633
|
1828 (menu-bar-update-buffers)
|
|
1829
|
2181
|
1830 ;; this version is too slow
|
47421
|
1831 ;;(defun format-buffers-menu-line (buffer)
|
|
1832 ;; "Returns a string to represent the given buffer in the Buffer menu.
|
|
1833 ;;nil means the buffer shouldn't be listed. You can redefine this."
|
|
1834 ;; (if (string-match "\\` " (buffer-name buffer))
|
|
1835 ;; nil
|
|
1836 ;; (save-excursion
|
|
1837 ;; (set-buffer buffer)
|
|
1838 ;; (let ((size (buffer-size)))
|
|
1839 ;; (format "%s%s %-19s %6s %-15s %s"
|
|
1840 ;; (if (buffer-modified-p) "*" " ")
|
|
1841 ;; (if buffer-read-only "%" " ")
|
|
1842 ;; (buffer-name)
|
|
1843 ;; size
|
|
1844 ;; mode-name
|
|
1845 ;; (or (buffer-file-name) ""))))))
|
2181
|
1846
|
12427
|
1847 ;;; Set up a menu bar menu for the minibuffer.
|
|
1848
|
39844
0433563f559d
(minibuffer-local-*map): Take inheritance into account.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
1849 (dolist (map (list minibuffer-local-map
|
0433563f559d
(minibuffer-local-*map): Take inheritance into account.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
1850 ;; This shouldn't be necessary, but there's a funny
|
0433563f559d
(minibuffer-local-*map): Take inheritance into account.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
1851 ;; bug in keymap.c that I don't understand yet. -stef
|
33191
|
1852 minibuffer-local-completion-map))
|
|
1853 (define-key map [menu-bar minibuf]
|
|
1854 (cons "Minibuf" (make-sparse-keymap "Minibuf"))))
|
12427
|
1855
|
39844
0433563f559d
(minibuffer-local-*map): Take inheritance into account.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
1856 (let ((map minibuffer-local-completion-map))
|
33191
|
1857 (define-key map [menu-bar minibuf ?\?]
|
|
1858 (list 'menu-item "List Completions" 'minibuffer-completion-help
|
|
1859 :help "Display all possible completions"))
|
|
1860 (define-key map [menu-bar minibuf space]
|
|
1861 (list 'menu-item "Complete Word" 'minibuffer-complete-word
|
|
1862 :help "Complete at most one word"))
|
|
1863 (define-key map [menu-bar minibuf tab]
|
|
1864 (list 'menu-item "Complete" 'minibuffer-complete
|
|
1865 :help "Complete as far as possible")))
|
12427
|
1866
|
39844
0433563f559d
(minibuffer-local-*map): Take inheritance into account.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
1867 (let ((map minibuffer-local-map))
|
33191
|
1868 (define-key map [menu-bar minibuf quit]
|
92747
98f0d29f01c5
(minibuffer-local-map): Use the same command for the "Quit" menu as used for
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
1869 (list 'menu-item "Quit" 'abort-recursive-edit
|
33191
|
1870 :help "Abort input and exit minibuffer"))
|
|
1871 (define-key map [menu-bar minibuf return]
|
|
1872 (list 'menu-item "Enter" 'exit-minibuffer
|
92747
98f0d29f01c5
(minibuffer-local-map): Use the same command for the "Quit" menu as used for
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
1873 :key-sequence "\r"
|
92310
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1874 :help "Terminate input and exit minibuffer"))
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1875 (define-key map [menu-bar minibuf isearch-forward]
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1876 (list 'menu-item "Isearch History Forward" 'isearch-forward
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1877 :help "Incrementally search minibuffer history forward"))
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1878 (define-key map [menu-bar minibuf isearch-backward]
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1879 (list 'menu-item "Isearch History Backward" 'isearch-backward
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1880 :help "Incrementally search minibuffer history backward"))
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1881 (define-key map [menu-bar minibuf next]
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1882 (list 'menu-item "Next History Item" 'next-history-element
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1883 :help "Put next minibuffer history element in the minibuffer"))
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1884 (define-key map [menu-bar minibuf previous]
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1885 (list 'menu-item "Previous History Item" 'previous-history-element
|
0801285155e7
(menu-bar-search-menu, menu-bar-replace-menu): Capitalize "Tagged Files".
Juri Linkov <juri@jurta.org>
diff
changeset
|
1886 :help "Put previous minibuffer history element in the minibuffer")))
|
12427
|
1887
|
49997
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1888 ;;;###autoload
|
66168
|
1889 ;; This comment is taken from tool-bar.el near
|
49997
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1890 ;; (put 'tool-bar-mode ...)
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1891 ;; We want to pretend the menu bar by standard is on, as this will make
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1892 ;; customize consider disabling the menu bar a customization, and save
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1893 ;; that. We could do this for real by setting :init-value below, but
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1894 ;; that would overwrite disabling the tool bar from X resources.
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1895 (put 'menu-bar-mode 'standard-value '(t))
|
8055
|
1896
|
49997
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1897 (define-minor-mode menu-bar-mode
|
3007
|
1898 "Toggle display of a menu bar on each frame.
|
2847
|
1899 This command applies to all frames that exist and frames to be
|
|
1900 created in the future.
|
22665
|
1901 With a numeric argument, if the argument is positive,
|
|
1902 turn on menu bars; otherwise, turn off menu bars."
|
49997
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1903 :init-value nil
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1904 :global t
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1905 :group 'frames
|
83496
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1906
|
8055
|
1907 ;; Make menu-bar-mode and default-frame-alist consistent.
|
83496
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1908 (modify-all-frames-parameters (list (cons 'menu-bar-lines
|
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1909 (if menu-bar-mode 1 0))))
|
4470
|
1910
|
49997
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1911 ;; Make the message appear when Emacs is idle. We can not call message
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1912 ;; directly. The minor-mode message "Menu-bar mode disabled" comes
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1913 ;; after this function returns, overwriting any message we do here.
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1914 (when (and (interactive-p) (not menu-bar-mode))
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1915 (run-with-idle-timer 0 nil 'message
|
afcd12db0367
* startup.el (command-line): Call menu-bar-mode with 1 instead of t.
Jan Djärv <jan.h.d@swipnet.se>
diff
changeset
|
1916 "Menu-bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear."))
|
47296
|
1917 menu-bar-mode)
|
2485
|
1918
|
83497
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1919 (defun toggle-menu-bar-mode-from-frame (&optional arg)
|
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1920 "Toggle menu bar on or off, based on the status of the current frame.
|
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1921 See `menu-bar-mode' for more information."
|
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1922 (interactive (list (or current-prefix-arg 'toggle)))
|
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1923 (if (eq arg 'toggle)
|
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1924 (menu-bar-mode (if (> (frame-parameter nil 'menu-bar-lines) 0) 0 1))
|
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1925 (menu-bar-mode arg)))
|
a25bb5ef27bf
Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
1926
|
86322
|
1927 (declare-function x-menu-bar-open "term/x-win" (&optional frame))
|
95840
|
1928 (declare-function w32-menu-bar-open "term/w32-win" (&optional frame))
|
86322
|
1929
|
83537
|
1930 (defun menu-bar-open (&optional frame)
|
|
1931 "Start key navigation of the menu bar in FRAME.
|
|
1932
|
|
1933 This function decides which method to use to access the menu
|
|
1934 depending on FRAME's terminal device. On X displays, it calls
|
95804
|
1935 `x-menu-bar-open'; on Windows, `w32-menu-bar-open' otherwise it
|
|
1936 calls `tmm-menubar'.
|
83537
|
1937
|
|
1938 If FRAME is nil or not given, use the selected frame."
|
|
1939 (interactive)
|
95804
|
1940 (let ((type (framep (or frame (selected-frame)))))
|
|
1941 (cond
|
|
1942 ((eq type 'x) (x-menu-bar-open frame))
|
|
1943 ((eq type 'w32) (w32-menu-bar-open frame))
|
|
1944 (t (with-selected-frame (or frame (selected-frame))
|
|
1945 (tmm-menubar))))))
|
83537
|
1946
|
|
1947 (global-set-key [f10] 'menu-bar-open)
|
|
1948
|
2765
|
1949 (provide 'menu-bar)
|
|
1950
|
79167
|
1951 ;; arch-tag: 6e6a3c22-4ec4-4d3d-8190-583f8ef94ced
|
2488
|
1952 ;;; menu-bar.el ends here
|