Mercurial > emacs
annotate lisp/menu-bar.el @ 3952:f9dfc2872fb0
(describe_map_tree): Insert key_heading here.
New arg TITLE.
(describe_buffer_bindings): Corresponding changes.
(shadow_lookup): New function.
(describe_map_2): Call it. SHADOW is now a list of maps.
(describe_vector): Likewise.
(describe_map): SHADOW is now a list of maps.
(describe_map_tree): Likewise.
(describe_buffer_bindings): Build suitable list to pass as SHADOW.
(Faccessible_keymaps): New arg PREFIX. Callers changed.
(describe_map_tree): New arg PREFIX.
(Fdescribe_bindings): New arg PREFIX.
Pass to describe_buffer_bindings along with buffer.
(describe_buffer_bindings): Extract PREFIX and pass along.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 02 Jul 1993 05:21:05 +0000 |
parents | 877f540d9717 |
children | aa3a8669cdda |
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 |
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
3 ;; Author: RMS |
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
4 ;; Keywords: internals |
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
5 |
2485 | 6 ;; Copyright (C) 1993 Free Software Foundation, Inc. |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
23 | |
2488
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
24 ;;; Code: |
2485 | 25 |
2175 | 26 (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
|
27 (defvar menu-bar-help-menu (make-sparse-keymap "Help")) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
28 (define-key global-map [menu-bar help] (cons "Help" menu-bar-help-menu)) |
3504
5fb4eefbd7ac
(menu-bar-help-menu): Add defvar.
Richard M. Stallman <rms@gnu.org>
parents:
3500
diff
changeset
|
29 (defvar menu-bar-edit-menu (make-sparse-keymap "Edit")) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
30 (define-key global-map [menu-bar edit] (cons "Edit" menu-bar-edit-menu)) |
3504
5fb4eefbd7ac
(menu-bar-help-menu): Add defvar.
Richard M. Stallman <rms@gnu.org>
parents:
3500
diff
changeset
|
31 (defvar menu-bar-file-menu (make-sparse-keymap "File")) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
32 (define-key global-map [menu-bar file] (cons "File" menu-bar-file-menu)) |
2175 | 33 |
2177
942a63709e37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2175
diff
changeset
|
34 (define-key menu-bar-file-menu [exit-emacs] |
2175 | 35 '("Exit Emacs" . save-buffers-kill-emacs)) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
36 (define-key menu-bar-file-menu [kill-buffer] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
37 '("Kill Buffer" . kill-this-buffer)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
38 (define-key menu-bar-file-menu [delete-frame] '("Delete Frame" . delete-frame)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
39 (define-key menu-bar-file-menu [print-buffer] '("Print Buffer" . print-buffer)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
40 (define-key menu-bar-file-menu [revert-buffer] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
41 '("Revert Buffer" . revert-buffer)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
42 (define-key menu-bar-file-menu [write-file] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
43 '("Save Buffer As..." . write-file)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
44 (define-key menu-bar-file-menu [save-buffer] '("Save Buffer" . save-buffer)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
45 (define-key menu-bar-file-menu [open-file] '("Open File..." . find-file)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
46 (define-key menu-bar-file-menu [new-frame] '("New Frame" . new-frame)) |
2175 | 47 |
2847
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
48 (define-key menu-bar-edit-menu [fill] '("Fill" . fill-region)) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
49 (define-key menu-bar-edit-menu [clear] '("Clear" . delete-region)) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
50 (define-key menu-bar-edit-menu [paste] '("Paste" . yank)) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
51 (define-key menu-bar-edit-menu [copy] '("Copy" . kill-ring-save)) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
52 (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
|
53 (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
|
54 |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
55 (put 'fill-region 'menu-enable 'mark-active) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
56 (put 'kill-region 'menu-enable 'mark-active) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
57 (put 'kill-ring-save 'menu-enable 'mark-active) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
58 (put 'yank 'menu-enable '(x-selection-exists-p)) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
59 (put 'delete-region 'menu-enable 'mark-active) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
60 (put 'undo 'menu-enable '(if (eq last-command 'undo) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
61 pending-undo-list |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
62 (consp buffer-undo-list))) |
2175 | 63 |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
64 (define-key menu-bar-help-menu [emacs-tutorial] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
65 '("Emacs Tutorial" . help-with-tutorial)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
66 (define-key menu-bar-help-menu [man] '("Man..." . manual-entry)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
67 (define-key menu-bar-help-menu [describe-variable] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
68 '("Describe Variable..." . describe-variable)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
69 (define-key menu-bar-help-menu [describe-function] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
70 '("Describe Function..." . describe-function)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
71 (define-key menu-bar-help-menu [describe-key] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
72 '("Describe Key..." . describe-key)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
73 (define-key menu-bar-help-menu [list-keybindings] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
74 '("List Keybindings" . describe-bindings)) |
2177
942a63709e37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2175
diff
changeset
|
75 (define-key menu-bar-help-menu [command-apropos] |
2175 | 76 '("Command Apropos..." . command-apropos)) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
77 (define-key menu-bar-help-menu [describe-mode] |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
78 '("Describe Mode" . describe-mode)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
79 (define-key menu-bar-help-menu [info] '("Info" . info)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
80 |
2177
942a63709e37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2175
diff
changeset
|
81 (define-key menu-bar-help-menu [emacs-news] '("Emacs News" . view-emacs-news)) |
2175 | 82 (defun kill-this-buffer () ; for the menubar |
83 "Kills the current buffer." | |
84 (interactive) | |
85 (kill-buffer (current-buffer))) | |
86 | |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
87 (defun kill-this-buffer-enabled-p () |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
88 (let ((count 0) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
89 (buffers (buffer-list))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
90 (while buffers |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
91 (or (string-match "^ " (buffer-name (car buffers))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
92 (setq count (1+ count))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
93 (setq buffers (cdr buffers))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
94 (> count 1))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
95 |
2175 | 96 (put 'save-buffer 'menu-enable '(buffer-modified-p)) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
97 (put 'revert-buffer 'menu-enable '(and (buffer-modified-p) (buffer-file-name))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
98 (put 'delete-frame 'menu-enable '(cdr (visible-frame-list))) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
99 (put 'kill-this-buffer 'menu-enable '(kill-this-buffer-enabled-p)) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
100 |
2175 | 101 (put 'advertised-undo 'menu-enable |
102 '(and (not (eq t buffer-undo-list)) | |
103 (if (eq last-command 'undo) | |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
104 (and (boundp 'pending-undo-list) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
105 pending-undo-list) |
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
106 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
|
107 |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
108 (defvar yank-menu-length 100 |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
109 "*Maximum length of an item in the menu for \ |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
110 \\[mouse-menu-choose-yank].") |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
111 |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
112 (defun mouse-menu-choose-yank (event) |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
113 "Pop up a menu of the kill-ring for selection with the mouse. |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
114 The kill-ring-yank-pointer is moved to the selected element. |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
115 A subsequent \\[yank] yanks the choice just selected." |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
116 (interactive "e") |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
117 (let* ((count 0) |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
118 (menu (mapcar (lambda (string) |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
119 (if (> (length string) yank-menu-length) |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
120 (setq string (substring string |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
121 0 yank-menu-length))) |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
122 (prog1 (cons string count) |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
123 (setq count (1+ count)))) |
3942
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
124 kill-ring)) |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
125 (arg (x-popup-menu event |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
126 (list "Yank Menu" |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
127 (cons "Pick Selection" menu))))) |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
128 ;; A mouse click outside the menu returns nil. |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
129 ;; Avoid a confusing error from passing nil to rotate-yank-pointer. |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
130 ;; XXX should this perhaps do something other than simply return? -rm |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
131 (if arg |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
132 (progn |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
133 (rotate-yank-pointer arg) |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
134 (if (interactive-p) |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
135 (message "The next yank will insert the selected text.") |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
136 (current-kill 0)))))) |
877f540d9717
(mouse-menu-choose-yank): Just return when x-popup-menu returns nil.
Roland McGrath <roland@gnu.org>
parents:
3898
diff
changeset
|
137 (put 'mouse-menu-choose-yank 'menu-enable 'kill-ring) |
3795
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
138 |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
139 (define-key menu-bar-edit-menu [choose-selection] |
d59af8c9bc65
(mouse-menu-choose-yank): New function. Put it in the edit menu.
Richard M. Stallman <rms@gnu.org>
parents:
3504
diff
changeset
|
140 '("Choose Pasting Selection" . mouse-menu-choose-yank)) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
141 |
3412
7d9b10bea55f
(mouse-menu-bar-buffers): Renamed from mouse-buffer-menu.
Richard M. Stallman <rms@gnu.org>
parents:
3007
diff
changeset
|
142 (define-key global-map [menu-bar buffer] '("Buffers" . mouse-menu-bar-buffers)) |
2178
76da020d14f8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2177
diff
changeset
|
143 |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
144 (defvar complex-buffers-menu-p nil |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
145 "*Non-nil says, offer a choice of actions after you pick a buffer. |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
146 This applies to the Buffers menu from the menu bar.") |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
147 |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
148 (defvar buffers-menu-max-size 10 |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
149 "*Maximum number of entries which may appear on the Buffers menu. |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
150 If this is 10, then only the ten most-recently-selected buffers are shown. |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
151 If this is nil, then all buffers are shown. |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
152 A large number or nil slows down menu responsiveness.") |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
153 |
3412
7d9b10bea55f
(mouse-menu-bar-buffers): Renamed from mouse-buffer-menu.
Richard M. Stallman <rms@gnu.org>
parents:
3007
diff
changeset
|
154 (defun mouse-menu-bar-buffers (event) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
155 "Pop up a menu of buffers for selection with the mouse. |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
156 This switches buffers in the window that you clicked on, |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
157 and selects that window." |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
158 (interactive "e") |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
159 (let ((buffers (buffer-list)) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
160 menu) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
161 ;; If requested, list only the N most recently selected buffers. |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
162 (if (and (integerp buffers-menu-max-size) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
163 (> buffers-menu-max-size 1)) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
164 (if (> (length buffers) buffers-menu-max-size) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
165 (setcdr (nthcdr buffers-menu-max-size buffers) nil))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
166 (setq menu |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
167 (list "Buffer Menu" |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
168 (cons "Select Buffer" |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
169 (let ((tail buffers) |
3898
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
170 (maxbuf 0) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
171 (maxlen 0) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
172 head) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
173 (while tail |
3898
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
174 (or (eq ?\ (aref (buffer-name (car tail)) 0)) |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
175 (setq maxbuf |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
176 (max maxbuf |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
177 (length (buffer-name (car tail)))))) |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
178 (setq tail (cdr tail))) |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
179 (setq tail buffers) |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
180 (while tail |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
181 (let ((elt (car tail))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
182 (if (not (string-match "^ " |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
183 (buffer-name elt))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
184 (setq head (cons |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
185 (cons |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
186 (format |
3898
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
187 (format "%%%ds %%s%%s %%s" |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
188 maxbuf) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
189 (buffer-name elt) |
3898
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
190 (if (buffer-modified-p elt) "*" " ") |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
191 (save-excursion |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
192 (set-buffer elt) |
92d25f36e8aa
(mouse-menu-bar-buffers): Include % and * in each item.
Richard M. Stallman <rms@gnu.org>
parents:
3795
diff
changeset
|
193 (if buffer-read-only "%" " ")) |
2181
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
194 (or (buffer-file-name elt) "")) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
195 elt) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
196 head))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
197 (and head (> (length (car (car head))) maxlen) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
198 (setq maxlen (length (car (car head)))))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
199 (setq tail (cdr tail))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
200 (nconc (reverse head) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
201 (list (cons (concat (make-string (- (/ maxlen 2) 8) ?\ ) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
202 "List All Buffers") |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
203 'list-buffers))))))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
204 |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
205 |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
206 (let ((buf (x-popup-menu (if (listp event) event |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
207 (cons '(0 0) (selected-frame))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
208 menu)) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
209 (window (and (listp event) (posn-window (event-start event))))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
210 (if (eq buf 'list-buffers) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
211 (list-buffers) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
212 (if buf |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
213 (if complex-buffers-menu-p |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
214 (let ((action (x-popup-menu (if (listp event) event |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
215 (cons '(0 0) (selected-frame))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
216 '("Buffer Action" |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
217 ("" |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
218 ("Save Buffer" . save-buffer) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
219 ("Kill Buffer" . kill-buffer) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
220 ("Select Buffer" . switch-to-buffer)))))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
221 (if (eq action 'save-buffer) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
222 (save-excursion |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
223 (set-buffer buf) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
224 (save-buffer)) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
225 (funcall action buf))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
226 (and (windowp window) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
227 (select-window window)) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
228 (switch-to-buffer buf))))))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
229 |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
230 ;; this version is too slow |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
231 ;;;(defun format-buffers-menu-line (buffer) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
232 ;;; "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
|
233 ;;;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
|
234 ;;; (if (string-match "\\` " (buffer-name buffer)) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
235 ;;; nil |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
236 ;;; (save-excursion |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
237 ;;; (set-buffer buffer) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
238 ;;; (let ((size (buffer-size))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
239 ;;; (format "%s%s %-19s %6s %-15s %s" |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
240 ;;; (if (buffer-modified-p) "*" " ") |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
241 ;;; (if buffer-read-only "%" " ") |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
242 ;;; (buffer-name) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
243 ;;; size |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
244 ;;; mode-name |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
245 ;;; (or (buffer-file-name) "")))))) |
5a9d9dcc4750
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
2178
diff
changeset
|
246 |
2847
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
247 (defvar menu-bar-mode nil) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
248 |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
249 (defun menu-bar-mode (flag) |
3007
e41b3dc686bb
(menu-bar-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
2847
diff
changeset
|
250 "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
|
251 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
|
252 created in the future. |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
253 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
|
254 turn off menu bars; otherwise, turn on menu bars." |
2847
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
255 (interactive "P") |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
256 (setq menu-bar-mode (if (null flag) (not menu-bar-mode) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
257 (or (not (numberp flag)) (>= flag 0)))) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
258 (let ((parameter (assq 'menu-bar-lines default-frame-alist))) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
259 (if (consp parameter) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
260 (setcdr parameter (if menu-bar-mode 1 0)) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
261 (setq default-frame-alist |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
262 (cons (cons 'menu-bar-lines (if menu-bar-mode 1 0)) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
263 default-frame-alist)))) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
264 (let ((frames (frame-list))) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
265 (while frames |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
266 ;; Turn menu bar on or off in existing frames. |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
267 ;; (Except for minibuffer-only frames.) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
268 (or (eq 'only (cdr (assq 'minibuffer (frame-parameters (car frames))))) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
269 (modify-frame-parameters |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
270 (car frames) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
271 (list (if menu-bar-mode |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
272 '(menu-bar-lines . 1) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
273 '(menu-bar-lines . 0))))) |
01a46a8f1e1b
(fill-region, kill-region, delete-region)
Richard M. Stallman <rms@gnu.org>
parents:
2765
diff
changeset
|
274 (setq frames (cdr frames))))) |
2485 | 275 |
276 ;; Make frames created from now on have a menu bar. | |
3500
78c1c1e9f4d2
(window-system): Enable menu bars only if
Richard M. Stallman <rms@gnu.org>
parents:
3412
diff
changeset
|
277 (if window-system |
78c1c1e9f4d2
(window-system): Enable menu bars only if
Richard M. Stallman <rms@gnu.org>
parents:
3412
diff
changeset
|
278 (menu-bar-mode t)) |
2485 | 279 |
2765 | 280 (provide 'menu-bar) |
281 | |
2488
278580be9b4a
Added and corrected library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2485
diff
changeset
|
282 ;;; menu-bar.el ends here |