Mercurial > emacs
annotate lisp/menu-bar.el @ 19885:266e93ddaf0e
(french-calendar-accents): Change variable to function.
Uses changed. Test that we can display multibyte chars.
(french-calendar-day-name-array, french-calendar-month-name-array):
New functions. Use them instead of directly using these variables.
(french-calendar-multibyte-month-name-array): New variable.
(french-calendar-multibyte-special-days-array): New variable.
(calendar-print-french-date): Bind enable-multibyte-characters to t.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 12 Sep 1997 19:34:27 +0000 |
parents | 8c5aca90861b |
children | 6c26b3f61e02 |
rev | line source |
---|---|
2488
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
1 ;;; menu-bar.el --- define a default menu bar. |
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
2 |
14169 | 3 ;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. |
4 | |
2488
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
5 ;; Author: RMS |
17970 | 6 ;; Maintainer: FSF |
5140 | 7 ;; Keywords: internal |
2488
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
8 |
2485 | 9 ;; This file is part of GNU Emacs. |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
14169 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
2485 | 25 |
12558
98c9ac60aa20
(menu-bar-help-menu): Add finder-by-keyword.
Karl Heuer <kwzh@gnu.org>
parents:
12434
diff
changeset
|
26 ;; Avishai Yacobi suggested some menu rearrangements. |
98c9ac60aa20
(menu-bar-help-menu): Add finder-by-keyword.
Karl Heuer <kwzh@gnu.org>
parents:
12434
diff
changeset
|
27 |
14169 | 28 ;;; Code: |
29 | |
13871
4b5161e903c1
(buffers-menu-max-size): Move definition to top of file.
Richard M. Stallman <rms@gnu.org>
parents:
13567
diff
changeset
|
30 ;;; User options: |
4b5161e903c1
(buffers-menu-max-size): Move definition to top of file.
Richard M. Stallman <rms@gnu.org>
parents:
13567
diff
changeset
|
31 |
17665 | 32 (defcustom buffers-menu-max-size 10 |
13871
4b5161e903c1
(buffers-menu-max-size): Move definition to top of file.
Richard M. Stallman <rms@gnu.org>
parents:
13567
diff
changeset
|
33 "*Maximum number of entries which may appear on the Buffers menu. |
4b5161e903c1
(buffers-menu-max-size): Move definition to top of file.
Richard M. Stallman <rms@gnu.org>
parents:
13567
diff
changeset
|
34 If this is 10, then only the ten most-recently-selected buffers are shown. |
4b5161e903c1
(buffers-menu-max-size): Move definition to top of file.
Richard M. Stallman <rms@gnu.org>
parents:
13567
diff
changeset
|
35 If this is nil, then all buffers are shown. |
17665 | 36 A large number or nil slows down menu responsiveness." |
37 :type '(choice integer | |
38 (const :tag "All" nil)) | |
39 :group 'mouse) | |
13871
4b5161e903c1
(buffers-menu-max-size): Move definition to top of file.
Richard M. Stallman <rms@gnu.org>
parents:
13567
diff
changeset
|
40 |
4668
12289fa93455
Don't clobber existing binding for menu-bar in global-map.
Roland McGrath <roland@gnu.org>
parents:
4628
diff
changeset
|
41 ;; Don't clobber an existing menu-bar keymap, to preserve any menu-bar key |
12289fa93455
Don't clobber existing binding for menu-bar in global-map.
Roland McGrath <roland@gnu.org>
parents:
4628
diff
changeset
|
42 ;; definitions made in loaddefs.el. |
12289fa93455
Don't clobber existing binding for menu-bar in global-map.
Roland McGrath <roland@gnu.org>
parents:
4628
diff
changeset
|
43 (or (lookup-key global-map [menu-bar]) |
12289fa93455
Don't clobber existing binding for menu-bar in global-map.
Roland McGrath <roland@gnu.org>
parents:
4628
diff
changeset
|
44 (define-key global-map [menu-bar] (make-sparse-keymap "menu-bar"))) |
3504
5fb4eefbd7ac
(menu-bar-help-menu): Add defvar.
Richard M. Stallman <rms@gnu.org>
parents:
3500
diff
changeset
|
45 (defvar menu-bar-help-menu (make-sparse-keymap "Help")) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
46 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
47 ;; Force Help item to come last, after the major mode's own items. |
12199
5f618eea1343
(help-menu): Symbol renamed from `help'.
Karl Heuer <kwzh@gnu.org>
parents:
12041
diff
changeset
|
48 ;; The symbol used to be called `help', but that gets confused with the |
5f618eea1343
(help-menu): Symbol renamed from `help'.
Karl Heuer <kwzh@gnu.org>
parents:
12041
diff
changeset
|
49 ;; help key. |
5f618eea1343
(help-menu): Symbol renamed from `help'.
Karl Heuer <kwzh@gnu.org>
parents:
12041
diff
changeset
|
50 (setq menu-bar-final-items '(help-menu)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
51 |
12199
5f618eea1343
(help-menu): Symbol renamed from `help'.
Karl Heuer <kwzh@gnu.org>
parents:
12041
diff
changeset
|
52 (define-key global-map [menu-bar help-menu] (cons "Help" menu-bar-help-menu)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
53 (defvar menu-bar-search-menu (make-sparse-keymap "Search")) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
54 (define-key global-map [menu-bar search] (cons "Search" menu-bar-search-menu)) |
3504
5fb4eefbd7ac
(menu-bar-help-menu): Add defvar.
Richard M. Stallman <rms@gnu.org>
parents:
3500
diff
changeset
|
55 (defvar menu-bar-edit-menu (make-sparse-keymap "Edit")) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
56 (define-key global-map [menu-bar edit] (cons "Edit" menu-bar-edit-menu)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
57 (defvar menu-bar-tools-menu (make-sparse-keymap "Tools")) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
58 (define-key global-map [menu-bar tools] (cons "Tools" menu-bar-tools-menu)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
59 (defvar menu-bar-files-menu (make-sparse-keymap "Files")) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
60 (define-key global-map [menu-bar files] (cons "Files" menu-bar-files-menu)) |
11293
d24be7d7af5d
(menu-bar-file-menu): Add back as alias for menu-bar-files-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
61 |
d24be7d7af5d
(menu-bar-file-menu): Add back as alias for menu-bar-files-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
62 ;; This alias is for compatibility with 19.28 and before. |
d24be7d7af5d
(menu-bar-file-menu): Add back as alias for menu-bar-files-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
63 (defvar menu-bar-file-menu menu-bar-files-menu) |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
64 |
8977
c8e2c62cf851
(vc-menu-map): New menu.
Richard M. Stallman <rms@gnu.org>
parents:
8809
diff
changeset
|
65 (defvar vc-menu-map (make-sparse-keymap "Version Control")) |
c8e2c62cf851
(vc-menu-map): New menu.
Richard M. Stallman <rms@gnu.org>
parents:
8809
diff
changeset
|
66 |
16677
e5d1cfd4d29c
(menu-bar-tools-menu): Add items
Richard M. Stallman <rms@gnu.org>
parents:
16619
diff
changeset
|
67 (define-key menu-bar-tools-menu [gdb] '("Debugger..." . gdb)) |
e5d1cfd4d29c
(menu-bar-tools-menu): Add items
Richard M. Stallman <rms@gnu.org>
parents:
16619
diff
changeset
|
68 (define-key menu-bar-tools-menu [compile] '("Compile..." . compile)) |
e5d1cfd4d29c
(menu-bar-tools-menu): Add items
Richard M. Stallman <rms@gnu.org>
parents:
16619
diff
changeset
|
69 (define-key menu-bar-tools-menu [grep] '("Search Files..." . grep)) |
e5d1cfd4d29c
(menu-bar-tools-menu): Add items
Richard M. Stallman <rms@gnu.org>
parents:
16619
diff
changeset
|
70 |
e5d1cfd4d29c
(menu-bar-tools-menu): Add items
Richard M. Stallman <rms@gnu.org>
parents:
16619
diff
changeset
|
71 (define-key menu-bar-tools-menu [separator-1] |
e5d1cfd4d29c
(menu-bar-tools-menu): Add items
Richard M. Stallman <rms@gnu.org>
parents:
16619
diff
changeset
|
72 '("--")) |
e5d1cfd4d29c
(menu-bar-tools-menu): Add items
Richard M. Stallman <rms@gnu.org>
parents:
16619
diff
changeset
|
73 |
11182
9fdd7498250f
(menu-bar-edit-menu): Capitalize an item name.
Richard M. Stallman <rms@gnu.org>
parents:
11118
diff
changeset
|
74 (define-key menu-bar-tools-menu [calendar] '("Display Calendar" . calendar)) |
17099
6ae39e04077b
(menu-bar-tools-menu): Fix typo in Send Mail item.
Karl Heuer <kwzh@gnu.org>
parents:
16759
diff
changeset
|
75 (define-key menu-bar-tools-menu [compose-mail] '("Send Mail" . compose-mail)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
76 (define-key menu-bar-tools-menu [rmail] '("Read Mail" . rmail)) |
13475
ddf1e34018d2
(menu-bar-tools-menu): Always define GNUS entry.
Richard M. Stallman <rms@gnu.org>
parents:
13173
diff
changeset
|
77 (define-key menu-bar-tools-menu [gnus] '("Read Net News" . gnus)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
78 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
79 (define-key menu-bar-tools-menu [separator-vc] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
80 '("--")) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
81 |
14291
3eb791861e23
(menu-bar-search-menu): Clean up key symbols.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
82 (define-key menu-bar-tools-menu [vc] |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
83 (cons "Version Control" vc-menu-map)) |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
84 |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
85 (define-key menu-bar-tools-menu [separator-compare] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
86 '("--")) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
87 |
18288
1e31ff4722f7
Added [ediff-misc] to menu-bar-tools-menu
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
17970
diff
changeset
|
88 (define-key menu-bar-tools-menu [ediff-misc] |
1e31ff4722f7
Added [ediff-misc] to menu-bar-tools-menu
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
17970
diff
changeset
|
89 '("Ediff Miscellanea" . menu-bar-ediff-misc-menu)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
90 (define-key menu-bar-tools-menu [epatch] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
91 '("Apply Patch" . menu-bar-epatch-menu)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
92 (define-key menu-bar-tools-menu [ediff-merge] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
93 '("Merge" . menu-bar-ediff-merge-menu)) |
11753
6a7b0b9bb6ac
(menu-bar-tools-menu): Rename key to `compare'.
Richard M. Stallman <rms@gnu.org>
parents:
11525
diff
changeset
|
94 (define-key menu-bar-tools-menu [compare] |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
95 '("Compare" . menu-bar-ediff-menu)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
96 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
97 (define-key menu-bar-tools-menu [separator-print] |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
98 '("--")) |
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
99 |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
100 (put 'print-region 'menu-enable 'mark-active) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
101 (put 'ps-print-region-with-faces 'menu-enable 'mark-active) |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
102 |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
103 (define-key menu-bar-tools-menu [ps-print-region] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
104 '("Postscript Print Region" . ps-print-region-with-faces)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
105 (define-key menu-bar-tools-menu [ps-print-buffer] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
106 '("Postscript Print Buffer" . ps-print-buffer-with-faces)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
107 (define-key menu-bar-tools-menu [print-region] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
108 '("Print Region" . print-region)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
109 (define-key menu-bar-tools-menu [print-buffer] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
110 '("Print Buffer" . print-buffer)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
111 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
112 (define-key menu-bar-files-menu [exit-emacs] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
113 '("Exit Emacs" . save-buffers-kill-emacs)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
114 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
115 (define-key menu-bar-files-menu [separator-exit] |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
116 '("--")) |
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
117 |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
118 (define-key menu-bar-files-menu [one-window] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
119 '("One Window" . delete-other-windows)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
120 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
121 (define-key menu-bar-files-menu [split-window] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
122 '("Split Window" . split-window-vertically)) |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
123 |
9422
669208821120
(menu-bar-file-menu): Don't include the frame
Richard M. Stallman <rms@gnu.org>
parents:
9356
diff
changeset
|
124 (if (fboundp 'delete-frame) |
669208821120
(menu-bar-file-menu): Don't include the frame
Richard M. Stallman <rms@gnu.org>
parents:
9356
diff
changeset
|
125 (progn |
13506
6360f5543071
(delete-frame): Don't use delete-frame as event name.
Richard M. Stallman <rms@gnu.org>
parents:
13475
diff
changeset
|
126 ;; Don't use delete-frame as event name |
6360f5543071
(delete-frame): Don't use delete-frame as event name.
Richard M. Stallman <rms@gnu.org>
parents:
13475
diff
changeset
|
127 ;; because that is a special event. |
6360f5543071
(delete-frame): Don't use delete-frame as event name.
Richard M. Stallman <rms@gnu.org>
parents:
13475
diff
changeset
|
128 (define-key menu-bar-files-menu [delete-this-frame] |
9422
669208821120
(menu-bar-file-menu): Don't include the frame
Richard M. Stallman <rms@gnu.org>
parents:
9356
diff
changeset
|
129 '("Delete Frame" . delete-frame)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
130 (define-key menu-bar-files-menu [make-frame-on-display] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
131 '("Open New Display..." . make-frame-on-display)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
132 (define-key menu-bar-files-menu [make-frame] |
18637
62cf644c438b
(menu-bar-files-menu): Use make-frame-command
Richard M. Stallman <rms@gnu.org>
parents:
18602
diff
changeset
|
133 '("Make New Frame" . make-frame-command)))) |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
134 |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
135 (define-key menu-bar-files-menu [separator-buffers] |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
136 '("--")) |
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
137 |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
138 (define-key menu-bar-files-menu [kill-buffer] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
139 '("Kill Current Buffer" . kill-this-buffer)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
140 (define-key menu-bar-files-menu [insert-file] |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
141 '("Insert File..." . insert-file)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
142 (define-key menu-bar-files-menu [revert-buffer] |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
143 '("Revert Buffer" . revert-buffer)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
144 (define-key menu-bar-files-menu [write-file] |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
145 '("Save Buffer As..." . write-file)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
146 (define-key menu-bar-files-menu [save-buffer] '("Save Buffer" . save-buffer)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
147 (define-key menu-bar-files-menu [dired] '("Open Directory..." . dired)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
148 (define-key menu-bar-files-menu [open-file] '("Open File..." . find-file)) |
8525
fcc070bca96d
(menu-bar-file-menu): Compare Files renamed to Compare.
Richard M. Stallman <rms@gnu.org>
parents:
8391
diff
changeset
|
149 |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
150 |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
151 (defun nonincremental-search-forward (string) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
152 "Read a string and search for it nonincrementally." |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
153 (interactive "sSearch for string: ") |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
154 (if (equal string "") |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
155 (search-forward (car search-ring)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
156 (isearch-update-ring string nil) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
157 (search-forward string))) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
158 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
159 (defun nonincremental-search-backward (string) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
160 "Read a string and search backward for it nonincrementally." |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
161 (interactive "sSearch for string: ") |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
162 (if (equal string "") |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
163 (search-backward (car search-ring)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
164 (isearch-update-ring string nil) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
165 (search-backward string))) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
166 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
167 (defun nonincremental-re-search-forward (string) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
168 "Read a regular expression and search for it nonincrementally." |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
169 (interactive "sSearch for regexp: ") |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
170 (if (equal string "") |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
171 (re-search-forward (car regexp-search-ring)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
172 (isearch-update-ring string t) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
173 (re-search-forward string))) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
174 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
175 (defun nonincremental-re-search-backward (string) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
176 "Read a regular expression and search backward for it nonincrementally." |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
177 (interactive "sSearch for regexp: ") |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
178 (if (equal string "") |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
179 (re-search-backward (car regexp-search-ring)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
180 (isearch-update-ring string t) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
181 (re-search-backward string))) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
182 |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
183 (defun nonincremental-repeat-search-forward () |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
184 "Search forward for the previous search string." |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
185 (interactive) |
18483
4d66cfbc5735
(nonincremental-repeat-search-forward)
Richard M. Stallman <rms@gnu.org>
parents:
18288
diff
changeset
|
186 (if (null search-ring) |
4d66cfbc5735
(nonincremental-repeat-search-forward)
Richard M. Stallman <rms@gnu.org>
parents:
18288
diff
changeset
|
187 (error "No previous search")) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
188 (search-forward (car search-ring))) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
189 |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
190 (defun nonincremental-repeat-search-backward () |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
191 "Search backward for the previous search string." |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
192 (interactive) |
18483
4d66cfbc5735
(nonincremental-repeat-search-forward)
Richard M. Stallman <rms@gnu.org>
parents:
18288
diff
changeset
|
193 (if (null search-ring) |
4d66cfbc5735
(nonincremental-repeat-search-forward)
Richard M. Stallman <rms@gnu.org>
parents:
18288
diff
changeset
|
194 (error "No previous search")) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
195 (search-backward (car search-ring))) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
196 |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
197 (defun nonincremental-repeat-re-search-forward () |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
198 "Search forward for the previous regular expression." |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
199 (interactive) |
18484 | 200 (if (null regexp-search-ring) |
18483
4d66cfbc5735
(nonincremental-repeat-search-forward)
Richard M. Stallman <rms@gnu.org>
parents:
18288
diff
changeset
|
201 (error "No previous search")) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
202 (re-search-forward (car regexp-search-ring))) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
203 |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
204 (defun nonincremental-repeat-re-search-backward () |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
205 "Search backward for the previous regular expression." |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
206 (interactive) |
18484 | 207 (if (null regexp-search-ring) |
18483
4d66cfbc5735
(nonincremental-repeat-search-forward)
Richard M. Stallman <rms@gnu.org>
parents:
18288
diff
changeset
|
208 (error "No previous search")) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
209 (re-search-backward (car regexp-search-ring))) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
210 |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
211 (define-key menu-bar-search-menu [query-replace-regexp] |
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
212 '("Query Replace Regexp..." . query-replace-regexp)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
213 (define-key menu-bar-search-menu [query-replace] |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
214 '("Query Replace..." . query-replace)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
215 (define-key menu-bar-search-menu [find-tag] |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
216 '("Find Tag..." . find-tag)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
217 (define-key menu-bar-search-menu [bookmark] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
218 '("Bookmarks" . menu-bar-bookmark-map)) |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
219 |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
220 (define-key menu-bar-search-menu [separator-search] |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
221 '("--")) |
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
222 |
14291
3eb791861e23
(menu-bar-search-menu): Clean up key symbols.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
223 (define-key menu-bar-search-menu [repeat-regexp-back] |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
224 '("Repeat Regexp Backwards" . nonincremental-repeat-re-search-backward)) |
14291
3eb791861e23
(menu-bar-search-menu): Clean up key symbols.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
225 (define-key menu-bar-search-menu [repeat-search-back] |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
226 '("Repeat Backwards" . nonincremental-repeat-search-backward)) |
14291
3eb791861e23
(menu-bar-search-menu): Clean up key symbols.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
227 (define-key menu-bar-search-menu [repeat-regexp-fwd] |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
228 '("Repeat Regexp" . nonincremental-repeat-re-search-forward)) |
14291
3eb791861e23
(menu-bar-search-menu): Clean up key symbols.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
229 (define-key menu-bar-search-menu [repeat-search-fwd] |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
230 '("Repeat Search" . nonincremental-repeat-search-forward)) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
231 |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
232 (define-key menu-bar-search-menu [separator-repeat] |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
233 '("--")) |
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
234 |
14291
3eb791861e23
(menu-bar-search-menu): Clean up key symbols.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
235 (define-key menu-bar-search-menu [re-search-backward] |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
236 '("Regexp Search Backwards..." . nonincremental-re-search-backward)) |
14291
3eb791861e23
(menu-bar-search-menu): Clean up key symbols.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
237 (define-key menu-bar-search-menu [search-backward] |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
238 '("Search Backwards..." . nonincremental-search-backward)) |
14291
3eb791861e23
(menu-bar-search-menu): Clean up key symbols.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
239 (define-key menu-bar-search-menu [re-search-forward] |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
240 '("Regexp Search..." . nonincremental-re-search-forward)) |
14291
3eb791861e23
(menu-bar-search-menu): Clean up key symbols.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
241 (define-key menu-bar-search-menu [search-forward] |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
242 '("Search..." . nonincremental-search-forward)) |
11067
a73305d0a6b4
(menu-bar-files-menu): Renamed from ...-file-menu.
Richard M. Stallman <rms@gnu.org>
parents:
11044
diff
changeset
|
243 |
11309
c584bf36429f
(menu-bar-edit-menu): Don't define ispell item unless start-process is fboundp.
Richard M. Stallman <rms@gnu.org>
parents:
11293
diff
changeset
|
244 (if (fboundp 'start-process) |
c584bf36429f
(menu-bar-edit-menu): Don't define ispell item unless start-process is fboundp.
Richard M. Stallman <rms@gnu.org>
parents:
11293
diff
changeset
|
245 (define-key menu-bar-edit-menu [spell] '("Spell" . ispell-menu-map))) |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
246 (define-key menu-bar-edit-menu [fill] '("Fill" . fill-region)) |
11118
238b3b5adefd
Add Text Properties submenu to Edit menu.
Boris Goldowsky <boris@gnu.org>
parents:
11067
diff
changeset
|
247 (define-key menu-bar-edit-menu [props] '("Text Properties" . facemenu-menu)) |
8010
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
248 |
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
249 (define-key menu-bar-edit-menu [separator-edit] |
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
250 '("--")) |
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
251 |
e199eda519b5
Rearrange the edit and file menus, and add separators.
Richard M. Stallman <rms@gnu.org>
parents:
7811
diff
changeset
|
252 (define-key menu-bar-edit-menu [clear] '("Clear" . delete-region)) |
8767
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
253 |
11182
9fdd7498250f
(menu-bar-edit-menu): Capitalize an item name.
Richard M. Stallman <rms@gnu.org>
parents:
11118
diff
changeset
|
254 (define-key menu-bar-edit-menu [paste] '("Paste Most Recent" . yank)) |
8767
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
255 |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
256 (defvar yank-menu (cons "Select Yank" nil)) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
257 (fset 'yank-menu (cons 'keymap yank-menu)) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
258 (define-key menu-bar-edit-menu [select-paste] '("Select and Paste" . yank-menu)) |
10721
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
259 (define-key menu-bar-edit-menu [copy] '("Copy" . menu-bar-kill-ring-save)) |
2847
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
260 (define-key menu-bar-edit-menu [cut] '("Cut" . kill-region)) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
261 (define-key menu-bar-edit-menu [undo] '("Undo" . undo)) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
262 |
10721
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
263 (defun menu-bar-kill-ring-save (beg end) |
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
264 (interactive "r") |
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
265 (if (mouse-region-match) |
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
266 (message "Select a region with the mouse does `copy' automatically") |
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
267 (kill-ring-save beg end))) |
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
268 |
12427
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
269 (put 'fill-region 'menu-enable '(and mark-active (not buffer-read-only))) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
270 (put 'kill-region 'menu-enable '(and mark-active (not buffer-read-only))) |
10721
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
271 (put 'menu-bar-kill-ring-save 'menu-enable 'mark-active) |
12427
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
272 (put 'yank 'menu-enable '(and (x-selection-exists-p) (not buffer-read-only))) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
273 (put 'yank-menu 'menu-enable '(and (cdr yank-menu) (not buffer-read-only))) |
10721
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
274 (put 'delete-region 'menu-enable '(and mark-active |
12427
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
275 (not buffer-read-only) |
10721
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
276 (not (mouse-region-match)))) |
12427
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
277 (put 'undo 'menu-enable '(and (not buffer-read-only) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
278 (if (eq last-command 'undo) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
279 pending-undo-list |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
280 (consp buffer-undo-list)))) |
9356
28c6c3d7efb4
(query-replace): Add missing quote.
Richard M. Stallman <rms@gnu.org>
parents:
8977
diff
changeset
|
281 (put 'query-replace 'menu-enable '(not buffer-read-only)) |
12427
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
282 (put 'query-replace-regexp 'menu-enable '(not buffer-read-only)) |
2175 | 283 |
4061
7279958409fe
(ispell-menu-map): New autoload definition.
Richard M. Stallman <rms@gnu.org>
parents:
4048
diff
changeset
|
284 (autoload 'ispell-menu-map "ispell" nil t 'keymap) |
7279958409fe
(ispell-menu-map): New autoload definition.
Richard M. Stallman <rms@gnu.org>
parents:
4048
diff
changeset
|
285 |
6699
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
286 ;; These are alternative definitions for the cut, paste and copy |
10721
3d056c5a8319
(menu-bar-kill-ring-save): New function--use as `copy'.
Richard M. Stallman <rms@gnu.org>
parents:
10590
diff
changeset
|
287 ;; menu items. Use them if your system expects these to use the clipboard. |
6699
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
288 |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
289 (put 'clipboard-kill-region 'menu-enable 'mark-active) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
290 (put 'clipboard-kill-ring-save 'menu-enable 'mark-active) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
291 (put 'clipboard-yank 'menu-enable |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
292 '(or (x-selection-exists-p) (x-selection-exists-p 'CLIPBOARD))) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
293 |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
294 (defun clipboard-yank () |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
295 "Reinsert the last stretch of killed text, or the clipboard contents." |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
296 (interactive) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
297 (let ((x-select-enable-clipboard t)) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
298 (yank))) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
299 |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
300 (defun clipboard-kill-ring-save (beg end) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
301 "Copy region to kill ring, and save in the X clipboard." |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
302 (interactive "r") |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
303 (let ((x-select-enable-clipboard t)) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
304 (kill-ring-save beg end))) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
305 |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
306 (defun clipboard-kill-region (beg end) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
307 "Kill the region, and save it in the X clipboard." |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
308 (interactive "r") |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
309 (let ((x-select-enable-clipboard t)) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
310 (kill-region beg end))) |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
311 |
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
312 (defun menu-bar-enable-clipboard () |
8391
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
313 "Make CUT, PASTE and COPY (keys and menu bar items) use the clipboard. |
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
314 Do the same for the keys of the same name." |
6699
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
315 (interactive) |
6948
54b252f540ea
(menu-bar-enable-clipboard): Construct new cons cells.
Richard M. Stallman <rms@gnu.org>
parents:
6843
diff
changeset
|
316 ;; We can't use constant list structure here because it becomes pure, |
54b252f540ea
(menu-bar-enable-clipboard): Construct new cons cells.
Richard M. Stallman <rms@gnu.org>
parents:
6843
diff
changeset
|
317 ;; and because it gets modified with cache data. |
54b252f540ea
(menu-bar-enable-clipboard): Construct new cons cells.
Richard M. Stallman <rms@gnu.org>
parents:
6843
diff
changeset
|
318 (define-key menu-bar-edit-menu [paste] |
54b252f540ea
(menu-bar-enable-clipboard): Construct new cons cells.
Richard M. Stallman <rms@gnu.org>
parents:
6843
diff
changeset
|
319 (cons "Paste" 'clipboard-yank)) |
54b252f540ea
(menu-bar-enable-clipboard): Construct new cons cells.
Richard M. Stallman <rms@gnu.org>
parents:
6843
diff
changeset
|
320 (define-key menu-bar-edit-menu [copy] |
54b252f540ea
(menu-bar-enable-clipboard): Construct new cons cells.
Richard M. Stallman <rms@gnu.org>
parents:
6843
diff
changeset
|
321 (cons "Copy" 'clipboard-kill-ring-save)) |
54b252f540ea
(menu-bar-enable-clipboard): Construct new cons cells.
Richard M. Stallman <rms@gnu.org>
parents:
6843
diff
changeset
|
322 (define-key menu-bar-edit-menu [cut] |
8391
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
323 (cons "Cut" 'clipboard-kill-region)) |
6745
469d679ca338
(global-map): Bind function keys f16, f18 and f20,
Richard M. Stallman <rms@gnu.org>
parents:
6699
diff
changeset
|
324 |
8391
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
325 (define-key global-map [f20] 'clipboard-kill-region) |
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
326 (define-key global-map [f16] 'clipboard-kill-ring-save) |
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
327 (define-key global-map [f18] 'clipboard-yank) |
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
328 ;; X11R6 versions |
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
329 (define-key global-map [cut] 'clipboard-kill-region) |
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
330 (define-key global-map [copy] 'clipboard-kill-ring-save) |
bb9718e6e844
(menu-bar-enable-clipboard): Moved here the
Richard M. Stallman <rms@gnu.org>
parents:
8347
diff
changeset
|
331 (define-key global-map [paste] 'clipboard-yank)) |
6699
59e74bc34228
(clipboard-yank, clipboard-kill-ring-save)
Richard M. Stallman <rms@gnu.org>
parents:
6513
diff
changeset
|
332 |
17341
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
parents:
17099
diff
changeset
|
333 |
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
parents:
17099
diff
changeset
|
334 ;;; Menu support |
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
parents:
17099
diff
changeset
|
335 |
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
parents:
17099
diff
changeset
|
336 (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>
parents:
17099
diff
changeset
|
337 |
18700
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
338 (define-key menu-bar-custom-menu [customize-apropos-groups] |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
339 '("Apropos Groups..." . customize-apropos-groups)) |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
340 (define-key menu-bar-custom-menu [customize-apropos-faces] |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
341 '("Apropos Faces..." . customize-apropos-faces)) |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
342 (define-key menu-bar-custom-menu [customize-apropos-options] |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
343 '("Apropos Options..." . customize-apropos-options)) |
17341
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
parents:
17099
diff
changeset
|
344 (define-key menu-bar-custom-menu [customize-apropos] |
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
parents:
17099
diff
changeset
|
345 '("Apropos..." . customize-apropos)) |
18700
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
346 (define-key menu-bar-custom-menu [separator-2] |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
347 '("--")) |
17615
32f90c43d1d2
(menu-bar-custom-menu):
Richard M. Stallman <rms@gnu.org>
parents:
17341
diff
changeset
|
348 (define-key menu-bar-custom-menu [customize-group] |
32f90c43d1d2
(menu-bar-custom-menu):
Richard M. Stallman <rms@gnu.org>
parents:
17341
diff
changeset
|
349 '("Specific Group..." . customize-group)) |
17341
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
parents:
17099
diff
changeset
|
350 (define-key menu-bar-custom-menu [customize-face] |
17615
32f90c43d1d2
(menu-bar-custom-menu):
Richard M. Stallman <rms@gnu.org>
parents:
17341
diff
changeset
|
351 '("Specific Face..." . customize-face)) |
18700
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
352 (define-key menu-bar-custom-menu [customize-option] |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
353 '("Specific Option..." . customize-option)) |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
354 (define-key menu-bar-custom-menu [separator-3] |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
355 '("--")) |
18602
9b34ca7eb8ef
Fix previous change.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18601
diff
changeset
|
356 (define-key menu-bar-custom-menu [customize-browse] |
18700
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
357 '("Browse Customization Groups" . customize-browse)) |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
358 (define-key menu-bar-custom-menu [customize] |
cb17c9cd025b
(menu-bar-custom-menu): Add several more menu items.
Richard M. Stallman <rms@gnu.org>
parents:
18637
diff
changeset
|
359 '("Top-level Customization Group" . customize)) |
17341
995c8b7bf6df
(menu-bar-custom-menu): New variable; add it as a submenu of the Help menu.
Richard M. Stallman <rms@gnu.org>
parents:
17099
diff
changeset
|
360 |
19617
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
361 ;; Options menu |
19731
920d0a7b5930
(menu-bar-help-menu): Rename info item to "Info (Browse Manuals)".
Richard M. Stallman <rms@gnu.org>
parents:
19617
diff
changeset
|
362 (defvar menu-bar-options-menu (make-sparse-keymap "Global Options")) |
19617
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
363 |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
364 (defmacro menu-bar-make-toggle (name variable doc message &rest body) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
365 `(progn |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
366 (defun ,name () |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
367 ,(concat doc ".") |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
368 (interactive) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
369 (if ,(if body `(progn . ,body) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
370 `(setq ,variable (not ,variable))) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
371 (message ,message "enabled") |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
372 (message ,message "disabled"))) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
373 '(,doc . ,name))) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
374 |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
375 (define-key menu-bar-options-menu [debug-on-quit] |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
376 (menu-bar-make-toggle toggle-debug-on-quit debug-on-quit |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
377 "Toggle Debug on Quit" "Debug on Quit %s")) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
378 (define-key menu-bar-options-menu [debug-on-error] |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
379 (menu-bar-make-toggle toggle-debug-on-error debug-on-error |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
380 "Toggle Debug on Error" "Debug on Error %s")) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
381 (define-key menu-bar-options-menu [options-separator] |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
382 '("--")) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
383 (define-key menu-bar-options-menu [save-place] |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
384 (menu-bar-make-toggle toggle-save-place-globally save-place |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
385 "Toggle Saving Place in Files between Sessions" |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
386 "Saving place in files %s" |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
387 (setq-default save-place (not (default-value save-place))))) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
388 (define-key menu-bar-options-menu [uniquify] |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
389 (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
390 "Toggle Directory Names in Buffer Names" |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
391 "Directory name in buffer names (uniquify) %s" |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
392 (require 'uniquify) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
393 (setq uniquify-buffer-name-style |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
394 (if (not uniquify-buffer-name-style) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
395 'forward)))) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
396 (define-key menu-bar-options-menu [transient-mark-mode] |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
397 (menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
398 "Toggle Transient Mark Mode (highlights region)" |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
399 "Transient Mark mode %s")) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
400 (define-key menu-bar-options-menu [toggle-auto-compression] |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
401 '("Toggle Automatic File De/compression" . auto-compression-mode)) |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
402 (define-key menu-bar-options-menu [auto-fill-mode] |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
403 '("Toggle Auto Fill (word wrap) in Text modes" |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
404 . toggle-text-mode-auto-fill)) |
19793
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
405 (define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode] |
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
406 (menu-bar-make-toggle toggle-global-lazy-font-lock-mode nil |
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
407 "Toggle Global Font Lock (highlights syntax)" |
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
408 "Global Font Lock mode %s" |
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
409 ;; Make sure a support mode is used; |
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
410 ;; otherwise Font Lock will be too slow. |
19731
920d0a7b5930
(menu-bar-help-menu): Rename info item to "Info (Browse Manuals)".
Richard M. Stallman <rms@gnu.org>
parents:
19617
diff
changeset
|
411 (require 'font-lock) |
19793
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
412 (if (not global-font-lock-mode) |
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
413 (or font-lock-support-mode |
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
414 (setq font-lock-support-mode 'lazy-lock-mode))) |
8c5aca90861b
(menu-bar-options-menu): Simplify global-font-lock-mode
Richard M. Stallman <rms@gnu.org>
parents:
19731
diff
changeset
|
415 (global-font-lock-mode))) |
19617
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
416 |
7153
4e0683b070f8
(menu-bar-help-menu): Add item for emacs-version.
Richard M. Stallman <rms@gnu.org>
parents:
7150
diff
changeset
|
417 (define-key menu-bar-help-menu [emacs-version] |
4e0683b070f8
(menu-bar-help-menu): Add item for emacs-version.
Richard M. Stallman <rms@gnu.org>
parents:
7150
diff
changeset
|
418 '("Show Version" . emacs-version)) |
7154
47987d8aba3d
(menu-bar-help-menu): Add item for report-emacs-bug.
Richard M. Stallman <rms@gnu.org>
parents:
7153
diff
changeset
|
419 (define-key menu-bar-help-menu [report-emacs-bug] |
12041
b0970a642589
(menu-bar-help-menu): Add "..."
Karl Heuer <kwzh@gnu.org>
parents:
11891
diff
changeset
|
420 '("Send Bug Report..." . report-emacs-bug)) |
12558
98c9ac60aa20
(menu-bar-help-menu): Add finder-by-keyword.
Karl Heuer <kwzh@gnu.org>
parents:
12434
diff
changeset
|
421 (define-key menu-bar-help-menu [finder-by-keyword] |
98c9ac60aa20
(menu-bar-help-menu): Add finder-by-keyword.
Karl Heuer <kwzh@gnu.org>
parents:
12434
diff
changeset
|
422 '("Find Lisp Packages..." . finder-by-keyword)) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
423 (define-key menu-bar-help-menu [emacs-tutorial] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
424 '("Emacs Tutorial" . help-with-tutorial)) |
12558
98c9ac60aa20
(menu-bar-help-menu): Add finder-by-keyword.
Karl Heuer <kwzh@gnu.org>
parents:
12434
diff
changeset
|
425 (define-key menu-bar-help-menu [man] |
98c9ac60aa20
(menu-bar-help-menu): Add finder-by-keyword.
Karl Heuer <kwzh@gnu.org>
parents:
12434
diff
changeset
|
426 '("Man..." . manual-entry)) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
427 (define-key menu-bar-help-menu [describe-variable] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
428 '("Describe Variable..." . describe-variable)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
429 (define-key menu-bar-help-menu [describe-function] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
430 '("Describe Function..." . describe-function)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
431 (define-key menu-bar-help-menu [describe-key] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
432 '("Describe Key..." . describe-key)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
433 (define-key menu-bar-help-menu [list-keybindings] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
434 '("List Keybindings" . describe-bindings)) |
2177
942a63709e37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2175
diff
changeset
|
435 (define-key menu-bar-help-menu [command-apropos] |
2175 | 436 '("Command Apropos..." . command-apropos)) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
437 (define-key menu-bar-help-menu [describe-mode] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
438 '("Describe Mode" . describe-mode)) |
19731
920d0a7b5930
(menu-bar-help-menu): Rename info item to "Info (Browse Manuals)".
Richard M. Stallman <rms@gnu.org>
parents:
19617
diff
changeset
|
439 (define-key menu-bar-help-menu [info] '("Info (Browse Manuals)" . info)) |
10924
0d6841b9a132
(menu-bar-help-menu): Binding for view-emacs-FAQ.
Richard M. Stallman <rms@gnu.org>
parents:
10721
diff
changeset
|
440 (define-key menu-bar-help-menu [emacs-faq] '("Emacs FAQ" . view-emacs-FAQ)) |
0d6841b9a132
(menu-bar-help-menu): Binding for view-emacs-FAQ.
Richard M. Stallman <rms@gnu.org>
parents:
10721
diff
changeset
|
441 (define-key menu-bar-help-menu [emacs-news] '("Emacs News" . view-emacs-news)) |
19617
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
442 (define-key menu-bar-help-menu [options-menu] |
6337e9a0ed92
(menu-bar-make-toggle): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
18700
diff
changeset
|
443 (cons "Options" menu-bar-options-menu)) |
17696
a30300999b49
(menu-bar-help-menu): Move "Customize" to the top.
Richard M. Stallman <rms@gnu.org>
parents:
17665
diff
changeset
|
444 (define-key menu-bar-help-menu [customize-menu] |
a30300999b49
(menu-bar-help-menu): Move "Customize" to the top.
Richard M. Stallman <rms@gnu.org>
parents:
17665
diff
changeset
|
445 (cons "Customize" menu-bar-custom-menu)) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
446 |
2175 | 447 (defun kill-this-buffer () ; for the menubar |
448 "Kills the current buffer." | |
449 (interactive) | |
450 (kill-buffer (current-buffer))) | |
451 | |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
452 (defun kill-this-buffer-enabled-p () |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
453 (let ((count 0) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
454 (buffers (buffer-list))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
455 (while buffers |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
456 (or (string-match "^ " (buffer-name (car buffers))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
457 (setq count (1+ count))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
458 (setq buffers (cdr buffers))) |
16619
4f8448158c10
In enable predicates in Files menu, use menu-updating-frame.
Richard M. Stallman <rms@gnu.org>
parents:
15996
diff
changeset
|
459 (and (not (window-minibuffer-p (frame-selected-window menu-updating-frame))) |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
460 (> count 1)))) |
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
461 |
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
462 (put 'kill-this-buffer 'menu-enable '(kill-this-buffer-enabled-p)) |
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
463 |
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
464 (put 'save-buffer 'menu-enable |
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
465 '(and (buffer-modified-p) |
16619
4f8448158c10
In enable predicates in Files menu, use menu-updating-frame.
Richard M. Stallman <rms@gnu.org>
parents:
15996
diff
changeset
|
466 (not (window-minibuffer-p (frame-selected-window menu-updating-frame))))) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
467 |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
468 (put 'write-file 'menu-enable |
16619
4f8448158c10
In enable predicates in Files menu, use menu-updating-frame.
Richard M. Stallman <rms@gnu.org>
parents:
15996
diff
changeset
|
469 '(not (window-minibuffer-p (frame-selected-window menu-updating-frame)))) |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
470 |
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
471 (put 'find-file 'menu-enable |
16619
4f8448158c10
In enable predicates in Files menu, use menu-updating-frame.
Richard M. Stallman <rms@gnu.org>
parents:
15996
diff
changeset
|
472 '(not (window-minibuffer-p (frame-selected-window menu-updating-frame)))) |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
473 |
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
474 (put 'dired 'menu-enable |
16619
4f8448158c10
In enable predicates in Files menu, use menu-updating-frame.
Richard M. Stallman <rms@gnu.org>
parents:
15996
diff
changeset
|
475 '(not (window-minibuffer-p (frame-selected-window menu-updating-frame)))) |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
476 |
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
477 (put 'insert-file 'menu-enable |
16619
4f8448158c10
In enable predicates in Files menu, use menu-updating-frame.
Richard M. Stallman <rms@gnu.org>
parents:
15996
diff
changeset
|
478 '(not (window-minibuffer-p (frame-selected-window menu-updating-frame)))) |
11525
3bd7735bba9b
Disable many Files menu items in minibuffer.
Richard M. Stallman <rms@gnu.org>
parents:
11325
diff
changeset
|
479 |
4114
5746e25610f8
(revert-buffer): Make menu-enable form more accurate
Richard M. Stallman <rms@gnu.org>
parents:
4101
diff
changeset
|
480 (put 'revert-buffer 'menu-enable |
5746e25610f8
(revert-buffer): Make menu-enable form more accurate
Richard M. Stallman <rms@gnu.org>
parents:
4101
diff
changeset
|
481 '(or revert-buffer-function revert-buffer-insert-file-contents-function |
5746e25610f8
(revert-buffer): Make menu-enable form more accurate
Richard M. Stallman <rms@gnu.org>
parents:
4101
diff
changeset
|
482 (and (buffer-file-name) |
4742
cafb372921c3
(revert-buffer): Enable menu item when the buffer is modified.
Roland McGrath <roland@gnu.org>
parents:
4668
diff
changeset
|
483 (or (buffer-modified-p) |
cafb372921c3
(revert-buffer): Enable menu item when the buffer is modified.
Roland McGrath <roland@gnu.org>
parents:
4668
diff
changeset
|
484 (not (verify-visited-file-modtime (current-buffer))))))) |
11891
937c7fced6ee
(delete-frame-enabled-p): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
11753
diff
changeset
|
485 |
4337
cda282328afd
(delete-frame): Permit it, if > 1 frame is vis or iconic.
Richard M. Stallman <rms@gnu.org>
parents:
4160
diff
changeset
|
486 ;; Permit deleting frame if it would leave a visible or iconified frame. |
cda282328afd
(delete-frame): Permit it, if > 1 frame is vis or iconic.
Richard M. Stallman <rms@gnu.org>
parents:
4160
diff
changeset
|
487 (put 'delete-frame 'menu-enable |
11891
937c7fced6ee
(delete-frame-enabled-p): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
11753
diff
changeset
|
488 '(delete-frame-enabled-p)) |
937c7fced6ee
(delete-frame-enabled-p): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
11753
diff
changeset
|
489 |
937c7fced6ee
(delete-frame-enabled-p): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
11753
diff
changeset
|
490 (defun delete-frame-enabled-p () |
937c7fced6ee
(delete-frame-enabled-p): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
11753
diff
changeset
|
491 "Return non-nil if `delete-frame' should be enabled in the menu bar." |
937c7fced6ee
(delete-frame-enabled-p): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
11753
diff
changeset
|
492 (let ((frames (frame-list)) |
15471 | 493 (count 0)) |
494 (while frames | |
495 (if (frame-visible-p (car frames)) | |
496 (setq count (1+ count))) | |
497 (setq frames (cdr frames))) | |
498 (> count 1))) | |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
499 |
2175 | 500 (put 'advertised-undo 'menu-enable |
501 '(and (not (eq t buffer-undo-list)) | |
502 (if (eq last-command 'undo) | |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
503 (and (boundp 'pending-undo-list) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
504 pending-undo-list) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
505 buffer-undo-list))) |
3795
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
506 |
17665 | 507 (defcustom yank-menu-length 20 |
508 "*Maximum length to display in the yank-menu." | |
509 :type 'integer | |
510 :group 'mouse) | |
3795
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
511 |
8767
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
512 (defun menu-bar-update-yank-menu (string old) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
513 (let ((front (car (cdr yank-menu))) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
514 (menu-string (if (<= (length string) yank-menu-length) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
515 string |
10590
9f68d8d6357b
(menu-bar-update-yank-menu): If string is too long,
Richard M. Stallman <rms@gnu.org>
parents:
9667
diff
changeset
|
516 (concat |
9f68d8d6357b
(menu-bar-update-yank-menu): If string is too long,
Richard M. Stallman <rms@gnu.org>
parents:
9667
diff
changeset
|
517 (substring string 0 (/ yank-menu-length 2)) |
9f68d8d6357b
(menu-bar-update-yank-menu): If string is too long,
Richard M. Stallman <rms@gnu.org>
parents:
9667
diff
changeset
|
518 "..." |
9f68d8d6357b
(menu-bar-update-yank-menu): If string is too long,
Richard M. Stallman <rms@gnu.org>
parents:
9667
diff
changeset
|
519 (substring string (- (/ yank-menu-length 2))))))) |
12610
2e1cc7fae2ba
(menu-bar-update-yank-menu): Treat all-dashes specially.
Richard M. Stallman <rms@gnu.org>
parents:
12588
diff
changeset
|
520 ;; Don't let the menu string be all dashes |
2e1cc7fae2ba
(menu-bar-update-yank-menu): Treat all-dashes specially.
Richard M. Stallman <rms@gnu.org>
parents:
12588
diff
changeset
|
521 ;; because that has a special meaning in a menu. |
2e1cc7fae2ba
(menu-bar-update-yank-menu): Treat all-dashes specially.
Richard M. Stallman <rms@gnu.org>
parents:
12588
diff
changeset
|
522 (if (string-match "\\`-+\\'" menu-string) |
2e1cc7fae2ba
(menu-bar-update-yank-menu): Treat all-dashes specially.
Richard M. Stallman <rms@gnu.org>
parents:
12588
diff
changeset
|
523 (setq menu-string (concat menu-string " "))) |
8767
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
524 ;; If we're supposed to be extending an existing string, and that |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
525 ;; string really is at the front of the menu, then update it in place. |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
526 (if (and old (or (eq old (car front)) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
527 (string= old (car front)))) |
3942
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
528 (progn |
8767
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
529 (setcar front string) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
530 (setcar (cdr front) menu-string)) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
531 (setcdr yank-menu |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
532 (cons |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
533 (cons string (cons menu-string 'menu-bar-select-yank)) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
534 (cdr yank-menu))))) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
535 (if (> (length (cdr yank-menu)) kill-ring-max) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
536 (setcdr (nthcdr kill-ring-max yank-menu) nil))) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
537 |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
538 (defun menu-bar-select-yank () |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
539 (interactive "*") |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
540 (push-mark (point)) |
441af4b664ac
(yank-menu): New variable; kill-ring in menu format.
Karl Heuer <kwzh@gnu.org>
parents:
8525
diff
changeset
|
541 (insert last-command-event)) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
542 |
12633
c05399b944ab
(menu-bar-buffer-menu): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
12610
diff
changeset
|
543 ;; This definition is just to show what this looks like. |
c05399b944ab
(menu-bar-buffer-menu): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
12610
diff
changeset
|
544 ;; It gets overridden below when menu-bar-update-buffers is called. |
c05399b944ab
(menu-bar-buffer-menu): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
12610
diff
changeset
|
545 (define-key global-map [menu-bar buffer] |
c05399b944ab
(menu-bar-buffer-menu): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
12610
diff
changeset
|
546 (cons "Buffers" (make-sparse-keymap "Buffers"))) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
547 |
4628
e55cc9fdaa92
(list-buffers-directory): Add declaration.
Richard M. Stallman <rms@gnu.org>
parents:
4603
diff
changeset
|
548 (defvar list-buffers-directory nil) |
e55cc9fdaa92
(list-buffers-directory): Add declaration.
Richard M. Stallman <rms@gnu.org>
parents:
4603
diff
changeset
|
549 |
9667
49eee3cb0ffa
(menu-bar-file-menu): Add item `Make Frame On Display'.
Richard M. Stallman <rms@gnu.org>
parents:
9518
diff
changeset
|
550 (defvar menu-bar-update-buffers-maxbuf) |
49eee3cb0ffa
(menu-bar-file-menu): Add item `Make Frame On Display'.
Richard M. Stallman <rms@gnu.org>
parents:
9518
diff
changeset
|
551 |
7150
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
552 (defun menu-bar-select-buffer () |
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
553 (interactive) |
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
554 (switch-to-buffer last-command-event)) |
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
555 |
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
556 (defun menu-bar-select-frame () |
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
557 (interactive) |
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
558 (make-frame-visible last-command-event) |
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
559 (raise-frame last-command-event) |
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
560 (select-frame last-command-event)) |
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
561 |
9518
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
562 (defun menu-bar-update-buffers-1 (elt) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
563 (cons (format |
9667
49eee3cb0ffa
(menu-bar-file-menu): Add item `Make Frame On Display'.
Richard M. Stallman <rms@gnu.org>
parents:
9518
diff
changeset
|
564 (format "%%%ds %%s%%s %%s" menu-bar-update-buffers-maxbuf) |
9518
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
565 (cdr elt) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
566 (if (buffer-modified-p (car elt)) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
567 "*" " ") |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
568 (save-excursion |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
569 (set-buffer (car elt)) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
570 (if buffer-read-only "%" " ")) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
571 (let ((file |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
572 (or (buffer-file-name (car elt)) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
573 (save-excursion |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
574 (set-buffer (car elt)) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
575 list-buffers-directory) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
576 ""))) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
577 (setq file (or (file-name-directory file) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
578 "")) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
579 (if (> (length file) 20) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
580 (setq file (concat "..." (substring file -17)))) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
581 file)) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
582 (car elt))) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
583 |
11325
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
584 (defvar menu-bar-buffers-menu-list-buffers-entry nil) |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
585 |
7150
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
586 (defun menu-bar-update-buffers () |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
587 ;; 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>
parents:
8320
diff
changeset
|
588 (and (lookup-key (current-global-map) [menu-bar buffer]) |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
589 (frame-or-buffer-changed-p) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
590 (let ((buffers (buffer-list)) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
591 (frames (frame-list)) |
15996
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
592 (maxlen 0) |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
593 buffers-menu frames-menu) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
594 ;; If requested, list only the N most recently selected buffers. |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
595 (if (and (integerp buffers-menu-max-size) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
596 (> buffers-menu-max-size 1)) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
597 (if (> (length buffers) buffers-menu-max-size) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
598 (setcdr (nthcdr buffers-menu-max-size buffers) nil))) |
7150
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
599 |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
600 ;; Make the menu of buffers proper. |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
601 (setq buffers-menu |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
602 (cons "Select Buffer" |
9518
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
603 (let* ((buffer-list |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
604 (mapcar 'list buffers)) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
605 tail |
9667
49eee3cb0ffa
(menu-bar-file-menu): Add item `Make Frame On Display'.
Richard M. Stallman <rms@gnu.org>
parents:
9518
diff
changeset
|
606 (menu-bar-update-buffers-maxbuf 0) |
9518
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
607 alist |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
608 head) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
609 ;; Put into each element of buffer-list |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
610 ;; the name for actual display, |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
611 ;; perhaps truncated in the middle. |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
612 (setq tail buffer-list) |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
613 (while tail |
9518
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
614 (let ((name (buffer-name (car (car tail))))) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
615 (setcdr (car tail) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
616 (if (> (length name) 27) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
617 (concat (substring name 0 12) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
618 "..." |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
619 (substring name -12)) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
620 name))) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
621 (setq tail (cdr tail))) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
622 ;; Compute the maximum length of any name. |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
623 (setq tail buffer-list) |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
624 (while tail |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
625 (or (eq ?\ (aref (cdr (car tail)) 0)) |
9667
49eee3cb0ffa
(menu-bar-file-menu): Add item `Make Frame On Display'.
Richard M. Stallman <rms@gnu.org>
parents:
9518
diff
changeset
|
626 (setq menu-bar-update-buffers-maxbuf |
49eee3cb0ffa
(menu-bar-file-menu): Add item `Make Frame On Display'.
Richard M. Stallman <rms@gnu.org>
parents:
9518
diff
changeset
|
627 (max menu-bar-update-buffers-maxbuf |
9518
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
628 (length (cdr (car tail)))))) |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
629 (setq tail (cdr tail))) |
9518
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
630 ;; Set ALIST to an alist of the form |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
631 ;; ITEM-STRING . BUFFER |
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
632 (setq tail buffer-list) |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
633 (while tail |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
634 (let ((elt (car tail))) |
9518
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
635 (or (eq ?\ (aref (cdr elt) 0)) |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
636 (setq alist (cons |
9518
69072971d37e
(menu-bar-update-buffers-1): New subroutine
Richard M. Stallman <rms@gnu.org>
parents:
9422
diff
changeset
|
637 (menu-bar-update-buffers-1 elt) |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
638 alist))) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
639 (and alist (> (length (car (car alist))) maxlen) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
640 (setq maxlen (length (car (car alist)))))) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
641 (setq tail (cdr tail))) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
642 (setq alist (nreverse alist)) |
11325
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
643 ;; Make the menu item for list-buffers |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
644 ;; or reuse the one we already have. |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
645 ;; The advantage in reusing one |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
646 ;; is that it already has the keyboard equivalent |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
647 ;; cached, so we save the time to look that up again. |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
648 (or menu-bar-buffers-menu-list-buffers-entry |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
649 (setq menu-bar-buffers-menu-list-buffers-entry |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
650 (cons |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
651 'list-buffers |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
652 (cons |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
653 "" |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
654 'list-buffers)))) |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
655 ;; Update the item string for menu's new width. |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
656 (setcar (cdr menu-bar-buffers-menu-list-buffers-entry) |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
657 (concat (make-string (max (- (/ maxlen 2) 8) 0) |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
658 ?\ ) |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
659 "List All Buffers")) |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
660 ;; Now make the actual list of items, |
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
661 ;; ending with the list-buffers item. |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
662 (nconc (mapcar '(lambda (pair) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
663 ;; This is somewhat risque, to use |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
664 ;; the buffer name itself as the event |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
665 ;; type to define, but it works. |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
666 ;; It would not work to use the buffer |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
667 ;; since a buffer as an event has its |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
668 ;; own meaning. |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
669 (nconc (list (buffer-name (cdr pair)) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
670 (car pair) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
671 (cons nil nil)) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
672 'menu-bar-select-buffer)) |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
673 alist) |
11325
032239e758c4
(menu-bar-update-buffers): Reuse the entry for
Richard M. Stallman <rms@gnu.org>
parents:
11309
diff
changeset
|
674 (list menu-bar-buffers-menu-list-buffers-entry))))) |
7150
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
675 |
7239
385ac6718f28
(menu-bar-update-buffers): Fix misspelled variable.
Karl Heuer <kwzh@gnu.org>
parents:
7234
diff
changeset
|
676 |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
677 ;; Make a Frames menu if we have more than one frame. |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
678 (if (cdr frames) |
15996
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
679 (let ((name (concat (make-string (max (- (/ maxlen 2) 3) 0) |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
680 ?\ ) |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
681 "Frames")) |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
682 (frames-menu |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
683 (cons 'keymap |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
684 (cons "Select Frame" |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
685 (mapcar '(lambda (frame) |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
686 (nconc (list frame |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
687 (cdr (assq 'name |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
688 (frame-parameters frame))) |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
689 (cons nil nil)) |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
690 'menu-bar-select-frame)) |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
691 frames))))) |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
692 ;; Put it underneath the Buffers menu. |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
693 (setq buffers-menu (cons (cons 'frames (cons name frames-menu)) |
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
694 buffers-menu)))) |
8316
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
695 (if buffers-menu |
abf26f5c67e4
(menu-bar-update-buffers): If Buffers item is gone,
Richard M. Stallman <rms@gnu.org>
parents:
8229
diff
changeset
|
696 (setq buffers-menu (cons 'keymap buffers-menu))) |
8347
0fff2106fa43
(menu-bar-update-buffers): Use (current-global-map), not global-map.
Richard M. Stallman <rms@gnu.org>
parents:
8320
diff
changeset
|
697 (define-key (current-global-map) [menu-bar buffer] |
15996
0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
Richard M. Stallman <rms@gnu.org>
parents:
15471
diff
changeset
|
698 (cons "Buffers" buffers-menu))))) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
699 |
7150
b78bfe054561
Make a sub-keymap for the Buffers menu bar item.
Richard M. Stallman <rms@gnu.org>
parents:
6948
diff
changeset
|
700 (add-hook 'menu-bar-update-hook 'menu-bar-update-buffers) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
701 |
12633
c05399b944ab
(menu-bar-buffer-menu): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
12610
diff
changeset
|
702 (menu-bar-update-buffers) |
c05399b944ab
(menu-bar-buffer-menu): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
12610
diff
changeset
|
703 |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
704 ;; this version is too slow |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
705 ;;;(defun format-buffers-menu-line (buffer) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
706 ;;; "Returns a string to represent the given buffer in the Buffer menu. |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
707 ;;;nil means the buffer shouldn't be listed. You can redefine this." |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
708 ;;; (if (string-match "\\` " (buffer-name buffer)) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
709 ;;; nil |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
710 ;;; (save-excursion |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
711 ;;; (set-buffer buffer) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
712 ;;; (let ((size (buffer-size))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
713 ;;; (format "%s%s %-19s %6s %-15s %s" |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
714 ;;; (if (buffer-modified-p) "*" " ") |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
715 ;;; (if buffer-read-only "%" " ") |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
716 ;;; (buffer-name) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
717 ;;; size |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
718 ;;; mode-name |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
719 ;;; (or (buffer-file-name) "")))))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
720 |
12427
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
721 ;;; Set up a menu bar menu for the minibuffer. |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
722 |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
723 (mapcar |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
724 (function |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
725 (lambda (map) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
726 (define-key map [menu-bar minibuf] |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
727 (cons "Minibuf" (make-sparse-keymap "Minibuf"))))) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
728 (list minibuffer-local-ns-map |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
729 minibuffer-local-must-match-map |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
730 minibuffer-local-isearch-map |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
731 minibuffer-local-map |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
732 minibuffer-local-completion-map)) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
733 |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
734 (mapcar |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
735 (function |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
736 (lambda (map) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
737 (define-key map [menu-bar minibuf ?\?] |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
738 '("List Completions" . minibuffer-completion-help)) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
739 (define-key map [menu-bar minibuf space] |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
740 '("Complete Word" . minibuffer-complete-word)) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
741 (define-key map [menu-bar minibuf tab] |
13567
051b4ffca31f
(minibuffer maps): Delete extra quote.
Richard M. Stallman <rms@gnu.org>
parents:
13506
diff
changeset
|
742 '("Complete" . minibuffer-complete)) |
12427
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
743 )) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
744 (list minibuffer-local-must-match-map |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
745 minibuffer-local-completion-map)) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
746 |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
747 (mapcar |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
748 (function |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
749 (lambda (map) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
750 (define-key map [menu-bar minibuf quit] |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
751 '("Quit" . keyboard-escape-quit)) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
752 (define-key map [menu-bar minibuf return] |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
753 '("Enter" . exit-minibuffer)) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
754 )) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
755 (list minibuffer-local-ns-map |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
756 minibuffer-local-must-match-map |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
757 minibuffer-local-isearch-map |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
758 minibuffer-local-map |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
759 minibuffer-local-completion-map)) |
04bcad1807b9
Make more menu-enables check (not buffer-read-only).
Richard M. Stallman <rms@gnu.org>
parents:
12199
diff
changeset
|
760 |
8055
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
761 (defvar menu-bar-mode nil) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
762 |
2847
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
763 (defun menu-bar-mode (flag) |
3007
e41b3dc686bb
(menu-bar-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
2847
diff
changeset
|
764 "Toggle display of a menu bar on each frame. |
2847
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
765 This command applies to all frames that exist and frames to be |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
766 created in the future. |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
767 With a numeric argument, if the argument is negative, |
3007
e41b3dc686bb
(menu-bar-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
2847
diff
changeset
|
768 turn off menu bars; otherwise, turn on menu bars." |
4470
6dd518d1f5aa
(menu-bar-mode): Defvar removed.
Roland McGrath <roland@gnu.org>
parents:
4337
diff
changeset
|
769 (interactive "P") |
6dd518d1f5aa
(menu-bar-mode): Defvar removed.
Roland McGrath <roland@gnu.org>
parents:
4337
diff
changeset
|
770 |
8055
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
771 ;; Make menu-bar-mode and default-frame-alist consistent. |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
772 (let ((default (assq 'menu-bar-lines default-frame-alist))) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
773 (if default |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
774 (setq menu-bar-mode (not (eq (cdr default) 0))) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
775 (setq default-frame-alist |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
776 (cons (cons 'menu-bar-lines (if menu-bar-mode 1 0)) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
777 default-frame-alist)))) |
4470
6dd518d1f5aa
(menu-bar-mode): Defvar removed.
Roland McGrath <roland@gnu.org>
parents:
4337
diff
changeset
|
778 |
8055
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
779 ;; Toggle or set the mode, according to FLAG. |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
780 (setq menu-bar-mode (if (null flag) (not menu-bar-mode) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
781 (> (prefix-numeric-value flag) 0))) |
4470
6dd518d1f5aa
(menu-bar-mode): Defvar removed.
Roland McGrath <roland@gnu.org>
parents:
4337
diff
changeset
|
782 |
8055
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
783 ;; Apply it to default-frame-alist. |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
784 (let ((parameter (assq 'menu-bar-lines default-frame-alist))) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
785 (if (consp parameter) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
786 (setcdr parameter (if menu-bar-mode 1 0)) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
787 (setq default-frame-alist |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
788 (cons (cons 'menu-bar-lines (if menu-bar-mode 1 0)) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
789 default-frame-alist)))) |
4470
6dd518d1f5aa
(menu-bar-mode): Defvar removed.
Roland McGrath <roland@gnu.org>
parents:
4337
diff
changeset
|
790 |
8055
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
791 ;; Apply it to existing frames. |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
792 (let ((frames (frame-list))) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
793 (while frames |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
794 (let ((height (cdr (assq 'height (frame-parameters (car frames)))))) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
795 (modify-frame-parameters (car frames) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
796 (list (cons 'menu-bar-lines |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
797 (if menu-bar-mode 1 0)))) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
798 (modify-frame-parameters (car frames) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
799 (list (cons 'height height)))) |
6a0af6085c1a
(menu-bar-mode): Make this a global variable.
Richard M. Stallman <rms@gnu.org>
parents:
8010
diff
changeset
|
800 (setq frames (cdr frames))))) |
2485 | 801 |
2765 | 802 (provide 'menu-bar) |
803 | |
2488
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
804 ;;; menu-bar.el ends here |