annotate lisp/x-menubar.el @ 233:52952cbfc5b5 r20-5b15

Import from CVS: tag r20-5b15
author cvs
date Mon, 13 Aug 2007 10:14:14 +0200
parents 557eaa0339bf
children 89ec2bb86eea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1 ;;; x-menubar.el --- Menubar and popup-menu support for X.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
2
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
3 ;; Copyright (C) 1991-5, 1997 Free Software Foundation, Inc.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995 Sun Microsystems.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
6 ;; Copyright (C) 1995, 1996 Ben Wing.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
7 ;; Copyright (C) 1997 MORIOKA Tomohiko
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
8
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
9 ;; Maintainer: XEmacs Development Team
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
10 ;; Keywords: extensions, internal, dumped
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
11
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
12 ;; This file is part of XEmacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
13
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
14 ;; XEmacs is free software; you can redistribute it and/or modify it
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
15 ;; under the terms of the GNU General Public License as published by
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
16 ;; the Free Software Foundation; either version 2, or (at your option)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
17 ;; any later version.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
18
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
19 ;; XEmacs is distributed in the hope that it will be useful, but
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
22 ;; General Public License for more details.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
23
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
25 ;; along with Xmacs; see the file COPYING. If not, write to the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
26 ;; Free Software Foundation, 59 Temple Place - Suite 330,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
27 ;; Boston, MA 02111-1307, USA.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
28
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
29 ;;; Commentary:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
30
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
31 ;; This file is dumped with XEmacs (when X11 and menubar support is compiled
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
32 ;; in).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
33
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
34 ;;; Code:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
35
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
36 ;;; Warning-free compile
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
37 (eval-when-compile
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
38 (defvar language-environment-list))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
39
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
40 (defconst default-menubar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
41 (purecopy-menubar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
42 ;; note backquote.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
43 `(
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
44 ("File"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
45 :filter file-menu-filter
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
46 ["Open..." find-file t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
47 ["Open in Other Window..." find-file-other-window t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
48 ["Open in New Frame..." find-file-other-frame t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
49 ["Insert File..." insert-file t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
50 ["View File..." view-file t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
51 "------"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
52 ["Save" save-buffer t nil]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
53 ["Save As..." write-file t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
54 ["Save Some Buffers" save-some-buffers t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
55 "-----"
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
56 ;; Ugly, ugly. The following two items _must_ be written in deprecated
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
57 ;; form due to braindamage in the `file-menu-filter' function.
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
58 ["Print Buffer" lpr-buffer (fboundp 'lpr-buffer) nil]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
59 ["Pretty-Print Buffer" ps-print-buffer-with-faces (fboundp 'ps-print-buffer-with-faces) nil]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
60 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
61 ["New Frame" make-frame t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
62 ["Frame on Other Display..."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
63 make-frame-on-display t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
64 ["Delete Frame" delete-frame t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
65 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
66 ["Split Window" split-window-vertically t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
67 ["Un-Split (Keep This)" delete-other-windows (not (one-window-p t))]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
68 ["Un-Split (Keep Others)" delete-window (not (one-window-p t))]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
69 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
70 ["Revert Buffer" revert-buffer t nil]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
71 ["Delete Buffer" kill-this-buffer t nil]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
72 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
73 ["Exit XEmacs" save-buffers-kill-emacs t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
74 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
75
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
76 ("Edit"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
77 :filter edit-menu-filter
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
78 ["Undo" advertised-undo t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
79 ["Cut" x-kill-primary-selection t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
80 ["Copy" x-copy-primary-selection t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
81 ["Paste" x-yank-clipboard-selection t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
82 ["Clear" x-delete-primary-selection t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
83 "----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
84 ["Search..." isearch-forward t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
85 ["Search Backward..." isearch-backward t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
86 ["Replace..." query-replace t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
87 "----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
88 ["Search (Regexp)..." isearch-forward-regexp t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
89 ["Search Backward (Regexp)..." isearch-backward-regexp t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
90 ["Replace (Regexp)..." query-replace-regexp t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
91 "----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
92 ["Goto Line..." goto-line t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
93 ["What Line" what-line t]
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
94 ("Bookmarks":filter bookmark-menu-filter)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
95 "----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
96 ["Start Macro Recording" start-kbd-macro (not defining-kbd-macro)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
97 ["End Macro Recording" end-kbd-macro defining-kbd-macro]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
98 ["Execute Last Macro" call-last-kbd-macro last-kbd-macro]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
99 "----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
100 ["Show Message Log" show-message-log t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
101 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
102
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
103 ,@(if (featurep 'mule)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
104 '(("Mule"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
105 ("Describe language support")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
106 ("Set language environment")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
107 "--"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
108 ["Toggle input method" toggle-input-method t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
109 ["Select input method" select-input-method t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
110 ["Describe input method" describe-input-method t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
111 "--"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
112 ["Describe current coding systems"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
113 describe-current-coding-system t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
114 ["Set coding system of buffer file"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
115 set-buffer-file-coding-system t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
116 ["Set coding system of terminal"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
117 set-terminal-coding-system nil] ; not implemented yet
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
118 ["Set coding system of keyboard"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
119 set-keyboard-coding-system nil] ; not implemented yet
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
120 ["Set coding system of process"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
121 set-current-process-coding-system nil] ; not implemented yet
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
122 "--"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
123 ["Show character table" view-charset-by-menu t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
124 ["Show diagnosis for MULE" mule-diag nil] ; not implemented yet
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
125 ["Show many languages" view-hello-file t])))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
126
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
127 ("Apps"
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
128 ["Read Mail (VM)..." vm
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
129 :active (fboundp 'vm-easy-menu-define)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
130 ["Read Mail (MH)..." (mh-rmail t)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
131 :active (fboundp 'mh-rmail)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
132 ["Send mail..." mail
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
133 :active (fboundp 'mail)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
134 ["Usenet News" gnus
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
135 :active (fboundp 'gnus)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
136 ["Browse the Web" w3
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
137 :active (fboundp 'w3)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
138 ["Gopher" gopher
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
139 :active (fboundp 'gopher)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
140 "----"
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
141 ["Spell-Check Buffer" ispell-buffer
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
142 :active (fboundp 'ispell-buffer)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
143 ["Toggle VI emulation" toggle-viper-mode
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
144 :active (fboundp 'toggle-viper-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
145 "----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
146 ("Calendar"
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
147 ["3-Month Calendar" calendar
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
148 :active (fboundp 'calendar)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
149 ["Diary" diary
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
150 :active (fboundp 'diary)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
151 ["Holidays" holidays
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
152 :active (fboundp 'holidays)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
153 ;; we're all pagans at heart ...
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
154 ["Phases of the Moon" phases-of-moon
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
155 :active (fboundp 'phases-of-moon)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
156 ["Sunrise/Sunset" sunrise-sunset
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
157 :active (fboundp 'sunrise-sunset)])
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
158
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
159 ("Games"
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
160 ["Mine Game" xmine
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
161 :active (fboundp 'xmine)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
162 ["Tetris" tetris
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
163 :active (fboundp 'tetris)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
164 ["Quote from Zippy" yow
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
165 :active (fboundp 'yow)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
166 ["Psychoanalyst" doctor
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
167 :active (fboundp 'doctor)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
168 ["Psychoanalyze Zippy!" psychoanalyze-pinhead
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
169 :active (fboundp 'psychoanalyze-pinhead)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
170 ["Random Flames" flame
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
171 :active (fboundp 'flame)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
172 ["Dunnet (Adventure)" dunnet
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
173 :active (fboundp 'dunnet)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
174 ["Towers of Hanoi" hanoi
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
175 :active (fboundp 'hanoi)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
176 ["Game of Life" life
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
177 :active (fboundp 'life)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
178 ["Multiplication Puzzle" mpuz
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
179 :active (fboundp 'mpuz)]))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
180
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
181 ("Options"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
182 ("Customize"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
183 ("Emacs" :filter (lambda (&rest junk)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
184 (cdr (custom-menu-create 'emacs))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
185 ["Group..." customize-group t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
186 ["Variable..." customize-variable t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
187 ["Face..." customize-face t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
188 ["Saved..." customize-saved t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
189 ["Set..." customize-customized t]
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
190 ["Apropos..." customize-apropos t]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
191 ["Browse..." customize-browse t])
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
192 ["Read Only" (toggle-read-only)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
193 :style toggle :selected buffer-read-only]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
194 ("Editing Options"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
195 ["Overstrike" (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
196 (overwrite-mode current-prefix-arg)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
197 (setq-default overwrite-mode overwrite-mode))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
198 :style toggle :selected overwrite-mode]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
199 ["Case Sensitive Search" (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
200 (setq case-fold-search (not case-fold-search))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
201 (setq-default case-fold-search
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
202 case-fold-search))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
203 :style toggle :selected (not case-fold-search)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
204 ["Case Matching Replace" (setq case-replace (not case-replace))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
205 :style toggle :selected case-replace]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
206 ["Auto Delete Selection" (pending-delete-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
207 (if pending-delete-mode 0 1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
208 :style toggle
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
209 :selected (and (boundp 'pending-delete-mode) pending-delete-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
210 :active (fboundp 'pending-delete-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
211 ["Active Regions" (setq zmacs-regions (not zmacs-regions))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
212 :style toggle :selected zmacs-regions]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
213 ["Mouse Paste At Text Cursor" (setq mouse-yank-at-point
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
214 (not mouse-yank-at-point))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
215 :style toggle :selected mouse-yank-at-point]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
216 ["Require Newline At End" (setq require-final-newline
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
217 (or (eq require-final-newline 'ask)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
218 (not require-final-newline)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
219 :style toggle :selected (eq require-final-newline 't)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
220 ["Add Newline When Moving Past End" (setq next-line-add-newlines
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
221 (not next-line-add-newlines))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
222 :style toggle :selected next-line-add-newlines]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
223 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
224 ("General Options"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
225 ["Teach Extended Commands" (setq teach-extended-commands-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
226 (not teach-extended-commands-p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
227 :style toggle :selected teach-extended-commands-p]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
228 ["Debug On Error" (setq debug-on-error (not debug-on-error))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
229 :style toggle :selected debug-on-error]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
230 ["Debug On Quit" (setq debug-on-quit (not debug-on-quit))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
231 :style toggle :selected debug-on-quit]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
232 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
233 ("Printing Options"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
234 ["Command-Line Switches for `lpr'/`lp'..."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
235 (setq lpr-switches
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
236 (read-expression "Switches for `lpr'/`lp': "
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
237 (format "%S" lpr-switches)))
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 219
diff changeset
238 (boundp 'lpr-switches)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
239 ("Pretty-Print Paper Size"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
240 ["Letter"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
241 (setq ps-paper-type 'letter)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
242 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
243 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
244 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
245 ["Letter-small"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
246 (setq ps-paper-type 'letter-small)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
247 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
248 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
249 (eq ps-paper-type 'letter-small))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
250 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
251 ["Legal"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
252 (setq ps-paper-type 'legal)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
253 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
254 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
255 (eq ps-paper-type 'legal))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
256 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
257 ["Statement"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
258 (setq ps-paper-type 'statement)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
259 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
260 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
261 (eq ps-paper-type 'statement))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
262 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
263 ["Executive"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
264 (setq ps-paper-type 'executive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
265 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
266 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
267 (eq ps-paper-type 'executive))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
268 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
269 ["Tabloid"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
270 (setq ps-paper-type 'tabloid)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
271 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
272 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
273 (eq ps-paper-type 'tabloid))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
274 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
275 ["Ledger"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
276 (setq ps-paper-type 'ledger)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
277 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
278 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
279 (eq ps-paper-type 'ledger))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
280 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
281 ["A3"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
282 (setq ps-paper-type 'a3)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
283 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
284 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
285 (eq ps-paper-type 'a3))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
286 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
287 ["A4"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
288 (setq ps-paper-type 'a4)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
289 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
290 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
291 (eq ps-paper-type 'a4))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
292 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
293 ["A4small"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
294 (setq ps-paper-type 'a4small)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
295 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
296 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
297 (eq ps-paper-type 'a4small))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
298 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
299 ["B4"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
300 (setq ps-paper-type 'b4)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
301 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
302 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
303 (eq ps-paper-type 'b4))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
304 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
305 ["B5"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
306 (setq ps-paper-type 'b5)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
307 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
308 :selected (and (boundp 'ps-paper-type)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
309 (eq ps-paper-type 'b5))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
310 :active (fboundp 'ps-print-buffer)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
311 )
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
312 ["Color Printing"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
313 (when (boundp 'ps-print-color-p)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
314 (if ps-print-color-p
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
315 (progn
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
316 (setq ps-print-color-p nil)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
317 (when (and (boundp 'original-face-background)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
318 original-face-background)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
319 (set-face-background 'default original-face-background)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
320 (setq original-face-background (face-background-instance 'default))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
321 (set-face-background 'default "white")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
322 (setq ps-print-color-p t)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
323 :style toggle :selected (and (boundp 'ps-print-color-p)
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
324 ps-print-color-p)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
325 :active (fboundp 'ps-print-buffer)])
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
326 ("\"Other Window\" Location"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
327 ["Always in Same Frame"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
328 (setq get-frame-for-buffer-default-instance-limit nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
329 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
330 :selected (null get-frame-for-buffer-default-instance-limit)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
331 ["Other Frame (2 Frames Max)"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
332 (setq get-frame-for-buffer-default-instance-limit 2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
333 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
334 :selected (eq 2 get-frame-for-buffer-default-instance-limit)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
335 ["Other Frame (3 Frames Max)"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
336 (setq get-frame-for-buffer-default-instance-limit 3)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
337 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
338 :selected (eq 3 get-frame-for-buffer-default-instance-limit)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
339 ["Other Frame (4 Frames Max)"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
340 (setq get-frame-for-buffer-default-instance-limit 4)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
341 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
342 :selected (eq 4 get-frame-for-buffer-default-instance-limit)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
343 ["Other Frame (5 Frames Max)"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
344 (setq get-frame-for-buffer-default-instance-limit 5)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
345 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
346 :selected (eq 5 get-frame-for-buffer-default-instance-limit)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
347 ["Always Create New Frame"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
348 (setq get-frame-for-buffer-default-instance-limit 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
349 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
350 :selected (eq 0 get-frame-for-buffer-default-instance-limit)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
351 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
352 ["Temp Buffers Always in Same Frame"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
353 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
354 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
355 :selected (eq temp-buffer-show-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
356 'show-temp-buffer-in-current-frame)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
357 ["Temp Buffers Like Other Buffers"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
358 (setq temp-buffer-show-function nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
359 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
360 :selected (null temp-buffer-show-function)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
361 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
362 ["Make current frame gnuserv target"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
363 (setq gnuserv-frame
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
364 (if (equal gnuserv-frame (selected-frame))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
365 'new
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
366 (selected-frame)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
367 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
368 :selected (equal gnuserv-frame (selected-frame))]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
369 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
370
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
371 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
372 ("Syntax Highlighting"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
373 ["In This Buffer" (font-lock-mode)
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
374 :style toggle :selected (and (boundp 'font-lock-mode) font-lock-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
375 :active (fboundp 'font-lock-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
376 ["Automatic" (if (not (featurep 'font-lock))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
377 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
378 (setq font-lock-auto-fontify t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
379 (require 'font-lock))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
380 (setq font-lock-auto-fontify
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
381 (not font-lock-auto-fontify)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
382 :style toggle
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
383 :selected (and (featurep 'font-lock) font-lock-auto-fontify)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
384 :active (fboundp 'font-lock-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
385 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
386 ["Fonts" (progn (require 'font-lock)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
387 (font-lock-use-default-fonts)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
388 (setq font-lock-use-fonts t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
389 font-lock-use-colors nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
390 (font-lock-mode 1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
391 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
392 :selected (and (boundp 'font-lock-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
393 font-lock-mode
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
394 font-lock-use-fonts)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
395 :active (fboundp 'font-lock-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
396 ["Colors" (progn (require 'font-lock)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
397 (font-lock-use-default-colors)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
398 (setq font-lock-use-colors t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
399 font-lock-use-fonts nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
400 (font-lock-mode 1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
401 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
402 :selected (and (boundp 'font-lock-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
403 font-lock-mode
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
404 font-lock-use-colors)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
405 :active (fboundp 'font-lock-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
406 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
407 ["Least" (if (or (and (not (integerp font-lock-maximum-decoration))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
408 (not (eq t font-lock-maximum-decoration)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
409 (and (integerp font-lock-maximum-decoration)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
410 (<= font-lock-maximum-decoration 0)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
411 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
412 (setq font-lock-maximum-decoration nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
413 (font-lock-recompute-variables))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
414 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
415 :active (and (boundp 'font-lock-mode) font-lock-mode)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
416 :selected (and font-lock-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
417 (or (and (not (integerp font-lock-maximum-decoration))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
418 (not (eq t font-lock-maximum-decoration)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
419 (and (integerp font-lock-maximum-decoration)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
420 (<= font-lock-maximum-decoration 0))))]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
421 ["More" (if (and (integerp font-lock-maximum-decoration)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
422 (= 1 font-lock-maximum-decoration))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
423 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
424 (setq font-lock-maximum-decoration 1)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
425 (font-lock-recompute-variables))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
426 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
427 :active (and (boundp 'font-lock-mode) font-lock-mode)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
428 :selected (and font-lock-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
429 (integerp font-lock-maximum-decoration)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
430 (= 1 font-lock-maximum-decoration))]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
431 ["Even More" (if (and (integerp font-lock-maximum-decoration)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
432 (= 2 font-lock-maximum-decoration))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
433 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
434 (setq font-lock-maximum-decoration 2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
435 (font-lock-recompute-variables))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
436 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
437 :active (and (boundp 'font-lock-mode) font-lock-mode)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
438 :selected (and font-lock-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
439 (integerp font-lock-maximum-decoration)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
440 (= 2 font-lock-maximum-decoration))]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
441 ["Most" (if (or (eq font-lock-maximum-decoration t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
442 (and (integerp font-lock-maximum-decoration)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
443 (>= font-lock-maximum-decoration 3)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
444 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
445 (setq font-lock-maximum-decoration t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
446 (font-lock-recompute-variables))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
447 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
448 :active (and (boundp 'font-lock-mode) font-lock-mode)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
449 :selected (and font-lock-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
450 (or (eq font-lock-maximum-decoration t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
451 (and (integerp font-lock-maximum-decoration)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
452 (>= font-lock-maximum-decoration 3))))]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
453 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
454 ["Lazy" (progn (require 'lazy-shot)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
455 (if (and (boundp 'lazy-shot-mode) lazy-shot-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
456 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
457 (lazy-shot-mode 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
458 ;; this shouldn't be necessary so there has to
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
459 ;; be a redisplay bug lurking somewhere (or
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
460 ;; possibly another event handler bug)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
461 (redraw-modeline)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
462 (remove-hook 'font-lock-mode-hook
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
463 'turn-on-lazy-shot))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
464 (if font-lock-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
465 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
466 (lazy-shot-mode 1)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
467 (redraw-modeline)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
468 (add-hook 'font-lock-mode-hook
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
469 'turn-on-lazy-shot)))))
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
470 :active (and (boundp 'font-lock-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
471 (boundp 'lazy-shot-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
472 font-lock-mode)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
473 :style toggle
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
474 :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
475 ["Caching" (progn (require 'fast-lock)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
476 (if fast-lock-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
477 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
478 (fast-lock-mode 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
479 ;; this shouldn't be necessary so there has to
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
480 ;; be a redisplay bug lurking somewhere (or
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
481 ;; possibly another event handler bug)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
482 (redraw-modeline))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
483 (if font-lock-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
484 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
485 (fast-lock-mode 1)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
486 (redraw-modeline)))))
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
487 :active (and (boundp 'font-lock-mode) font-lock-mode)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
488 :style toggle
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
489 :selected (and (boundp 'fast-lock-mode) fast-lock-mode)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
490 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
491 ("Paren Highlighting"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
492 ["None" (paren-set-mode -1)
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
493 :style radio :selected (and (boundp 'paren-mode) (not paren-mode))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
494 :active (fboundp 'paren-set-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
495 ["Blinking Paren" (paren-set-mode 'blink-paren)
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
496 :style radio :selected (and (boundp 'paren-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
497 (eq paren-mode 'blink-paren))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
498 :active (fboundp 'paren-set-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
499 ["Steady Paren" (paren-set-mode 'paren)
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
500 :style radio :selected (and (boundp 'paren-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
501 (eq paren-mode 'paren))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
502 :active (fboundp 'paren-set-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
503 ["Expression" (paren-set-mode 'sexp)
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
504 :style radio :selected (and (boundp 'paren-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
505 (eq paren-mode 'sexp))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
506 :active (fboundp 'paren-set-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
507 ;;; ["Nested Shading" (paren-set-mode 'nested)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
508 ;;; :style radio :selected (eq paren-mode 'nested)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
509 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
510 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
511 ("Frame Appearance"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
512 ,@(if (featurep 'scrollbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
513 '(["Scrollbars" (if (= (specifier-instance scrollbar-width) 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
514 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
515 (set-specifier scrollbar-width 15)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
516 (set-specifier scrollbar-height 15))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
517 (set-specifier scrollbar-width 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
518 (set-specifier scrollbar-height 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
519 :style toggle :selected (> (specifier-instance scrollbar-width) 0)]))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
520 ["3D Modeline"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
521 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
522 (if (zerop (specifier-instance modeline-shadow-thickness))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
523 (set-specifier modeline-shadow-thickness 2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
524 (set-specifier modeline-shadow-thickness 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
525 (redraw-modeline t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
526 :style toggle :selected
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
527 (let ((thickness
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
528 (specifier-instance modeline-shadow-thickness)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
529 (and (integerp thickness)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
530 (> thickness 0)))]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
531 ["Truncate Lines" (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
532 (setq truncate-lines (not truncate-lines))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
533 (setq-default truncate-lines truncate-lines))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
534 :style toggle :selected truncate-lines]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
535 ["Bar Cursor" (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
536 (setq bar-cursor
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
537 (if (not bar-cursor) 2 nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
538 (force-cursor-redisplay))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
539 :style toggle :selected bar-cursor]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
540 ["Blinking Cursor" (blink-cursor-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
541 :style toggle
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
542 :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
543 ["Frame-Local Font Menu" (setq font-menu-this-frame-only-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
544 (not font-menu-this-frame-only-p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
545 :style toggle :selected font-menu-this-frame-only-p]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
546 ; ["Line Numbers" (line-number-mode nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
547 ; :style toggle :selected line-number-mode]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
548 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
549 ("Menubar Appearance"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
550 ["Buffers Menu Length..."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
551 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
552 (setq buffers-menu-max-size
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
553 (read-number
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
554 "Enter number of buffers to display (or 0 for unlimited): "))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
555 (if (eq buffers-menu-max-size 0) (setq buffers-menu-max-size nil)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
556 t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
557 ["Multi-Operation Buffers Sub-Menus"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
558 (setq complex-buffers-menu-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
559 (not complex-buffers-menu-p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
560 :style toggle :selected complex-buffers-menu-p]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
561 ("Buffers Menu Sorting"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
562 ["Most Recently Used"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
563 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
564 (setq buffers-menu-sort-function nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
565 (setq buffers-menu-grouping-function nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
566 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
567 :selected (null buffers-menu-sort-function)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
568 ["Alphabetically"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
569 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
570 (setq buffers-menu-sort-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
571 'sort-buffers-menu-alphabetically)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
572 (setq buffers-menu-grouping-function nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
573 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
574 :selected (eq 'sort-buffers-menu-alphabetically
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
575 buffers-menu-sort-function)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
576 ["By Major Mode, Then Alphabetically"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
577 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
578 (setq buffers-menu-sort-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
579 'sort-buffers-menu-by-mode-then-alphabetically)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
580 (setq buffers-menu-grouping-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
581 'group-buffers-menu-by-mode-then-alphabetically))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
582 :style radio
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
583 :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
584 buffers-menu-sort-function)])
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
585 ["Submenus for Buffer Groups"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
586 (setq buffers-menu-submenus-for-groups-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
587 (not buffers-menu-submenus-for-groups-p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
588 :style toggle
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
589 :selected buffers-menu-submenus-for-groups-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
590 :active (not (null buffers-menu-grouping-function))]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
591 "---"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
592 ["Ignore Scaled Fonts" (setq font-menu-ignore-scaled-fonts
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
593 (not font-menu-ignore-scaled-fonts))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
594 :style toggle :selected font-menu-ignore-scaled-fonts]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
595 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
596 ,@(if (featurep 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
597 '(("Toolbar Appearance"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
598 ["Visible" (set-specifier default-toolbar-visible-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
599 (not (specifier-instance
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
600 default-toolbar-visible-p)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
601 :style toggle
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
602 :selected (specifier-instance default-toolbar-visible-p)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
603 ["Captioned" (set-specifier toolbar-buttons-captioned-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
604 (not (specifier-instance
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
605 toolbar-buttons-captioned-p)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
606 :style toggle
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
607 :selected
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
608 (specifier-instance toolbar-buttons-captioned-p)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
609 ("Default Location"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
610 ["Top" (set-default-toolbar-position 'top)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
611 :style radio :selected (eq (default-toolbar-position) 'top)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
612 ["Bottom" (set-default-toolbar-position 'bottom)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
613 :style radio :selected (eq (default-toolbar-position) 'bottom)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
614 ["Left" (set-default-toolbar-position 'left)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
615 :style radio :selected (eq (default-toolbar-position) 'left)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
616 ["Right" (set-default-toolbar-position 'right)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
617 :style radio :selected (eq (default-toolbar-position) 'right)]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
618 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
619 )))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
620 ("Mouse"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
621 ["Avoid-Text"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
622 (if (equal (device-type) 'x)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
623 (if mouse-avoidance-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
624 (mouse-avoidance-mode 'none)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
625 (mouse-avoidance-mode 'banish))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
626 (beep)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
627 (message "This option requires a window system."))
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
628 :style toggle :selected (and (boundp 'mouse-avoidance-mode)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
629 mouse-avoidance-mode
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
630 window-system)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
631 :active (fboundp 'mouse-avoidance-mode)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
632 ["strokes-mode"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
633 (if (equal (device-type) 'x)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
634 (strokes-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
635 (beep)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
636 (message "This option requires a window system."))
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents: 211
diff changeset
637 :style toggle :selected (and (boundp 'strokes-mode)
211
78478c60bfcd Import from CVS: tag r20-4b4
cvs
parents: 209
diff changeset
638 strokes-mode
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
639 window-system)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
640 :active (fboundp 'strokes-mode)])
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
641 ("Open URLs With"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
642 ["Emacs-W3" (setq browse-url-browser-function 'browse-url-w3)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
643 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
644 :selected (and (boundp 'browse-url-browser-function)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
645 (eq browse-url-browser-function 'browse-url-w3))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
646 :active (and (fboundp 'browse-url-w3)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
647 (fboundp 'w3-fetch))]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
648 ["Netscape" (setq browse-url-browser-function 'browse-url-netscape)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
649 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
650 :selected (and (boundp 'browse-url-browser-function)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
651 (eq browse-url-browser-function 'browse-url-netscape))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
652 :active (fboundp 'browse-url-netscape)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
653 ["Mosaic" (setq browse-url-browser-function 'browse-url-mosaic)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
654 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
655 :selected (and (boundp 'browse-url-browser-function)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
656 (eq browse-url-browser-function 'browse-url-mosaic))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
657 :active (fboundp 'browse-url-mosaic)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
658 ["Mosaic (CCI)" (setq browse-url-browser-function 'browse-url-cci)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
659 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
660 :selected (and (boundp 'browse-url-browser-function)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
661 (eq browse-url-browser-function 'browse-url-iximosaic))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
662 :active (fboundp 'browse-url-iximosaic)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
663 ["IXI Mosaic" (setq browse-url-browser-function 'browse-url-iximosaic)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
664 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
665 :selected (and (boundp 'browse-url-browser-function)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
666 (eq browse-url-browser-function 'browse-url-iximosaic))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
667 :active (fboundp 'browse-url-iximosaic)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
668 ["Lynx (xterm)" (setq browse-url-browser-function 'browse-url-lynx-xterm)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
669 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
670 :selected (and (boundp 'browse-url-browser-function)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
671 (eq browse-url-browser-function 'browse-url-lynx-xterm))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
672 :active (fboundp 'browse-url-lynx-xterm)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
673 ["Lynx (xemacs)" (setq browse-url-browser-function 'browse-url-lynx-emacs)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
674 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
675 :selected (and (boundp 'browse-url-browser-function)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
676 (eq browse-url-browser-function 'browse-url-lynx-emacs))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
677 :active (fboundp 'browse-url-lynx-emacs)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
678 ["Grail" (setq browse-url-browser-function 'browse-url-grail)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
679 :style radio
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
680 :selected (and (boundp 'browse-url-browser-function)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
681 (eq browse-url-browser-function 'browse-url-grail))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
682 :active (fboundp 'browse-url-grail)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
683 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
684 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
685 ["Browse Faces..." edit-faces t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
686 ("Font" :filter font-menu-family-constructor)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
687 ("Size" :filter font-menu-size-constructor)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
688 ("Weight" :filter font-menu-weight-constructor)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
689 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
690 ["Save Options" save-options-menu-settings t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
691 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
692
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
693 ("Buffers"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
694 :filter buffers-menu-filter
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
695 ["List All Buffers" list-buffers t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
696 "--"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
697 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
698
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
699 ("Tools"
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
700 ["Grep..." grep
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
701 :active (fboundp 'grep)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
702 ["Compile..." compile
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
703 :active (fboundp 'compile)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
704 ["Shell" shell
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
705 :active (fboundp 'shell)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
706 ["Shell Command..." shell-command
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
707 :active (fboundp 'shell-command)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
708 ["Shell Command on Region..." shell-command-on-region
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
709 :active (and (fboundp 'shell-command-on-region)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
710 (region-exists-p))]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
711 ["Debug (GDB)..." gdb
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
712 :active (fboundp 'gdb)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
713 ["Debug (DBX)..." dbx
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
714 :active (fboundp 'dbx)]
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
715 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
716 ("Tags"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
717 ["Find Tag..." find-tag t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
718 ["Find Other Window..." find-tag-other-window t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
719 ["Next Tag..." (find-tag nil) t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
720 ["Next Other Window..." (find-tag-other-window nil) t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
721 ["Next File" next-file t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
722 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
723 ["Tags Search..." tags-search t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
724 ["Tags Replace..." tags-query-replace t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
725 ["Continue Search/Replace" tags-loop-continue t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
726 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
727 ["Pop stack" pop-tag-mark t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
728 ["Apropos..." tags-apropos t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
729 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
730 ["Set Tags Table File..." visit-tags-table t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
731 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
732
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
733 nil ; the partition: menus after this are flushright
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
734
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
735 ("Help"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
736 ["About XEmacs..." about-xemacs t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
737 ("Basics"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
738 ["Tutorial" help-with-tutorial t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
739 ["News" view-emacs-news t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
740 ["Packages" finder-by-keyword t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
741 ["Splash" xemacs-splash-buffer t])
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
742 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
743 ("XEmacs FAQ"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
744 ["FAQ (local)" xemacs-local-faq t]
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
745 ["FAQ via WWW" xemacs-www-faq (boundp 'browse-url-browser-function)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
746 ["Home Page" xemacs-www-page (boundp 'browse-url-browser-function)])
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
747 ("Samples"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
748 ["Sample" (find-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
749 (expand-file-name "sample.emacs"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
750 data-directory))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
751 t ".emacs"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
752 ["Sample" (find-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
753 (expand-file-name "sample.Xdefaults"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
754 data-directory))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
755 t ".Xdefaults"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
756 ["Sample" (find-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
757 (expand-file-name "enriched.doc"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
758 data-directory))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
759 t "enriched"])
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
760 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
761 ("Lookup in Info"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
762 ["Key Binding..." Info-goto-emacs-key-command-node t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
763 ["Command..." Info-goto-emacs-command-node t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
764 ["Function..." Info-elisp-ref t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
765 ["Topic..." Info-query t])
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
766 ("Manuals"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
767 ["Info" info t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
768 ["Unix Manual..." manual-entry t])
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
769 ("Commands & Keys"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
770 ["Mode" describe-mode t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
771 ["Apropos..." hyper-apropos t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
772 ["Apropos Docs..." apropos-documentation t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
773 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
774 ["Key..." describe-key t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
775 ["Bindings" describe-bindings t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
776 ["Mouse Bindings" describe-pointer t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
777 ["Recent Keys" view-lossage t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
778 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
779 ["Function..." describe-function t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
780 ["Variable..." describe-variable t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
781 ["Locate Command..." where-is t])
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
782 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
783 ["Recent Messages" view-lossage t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
784 ("Misc"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
785 ["No Warranty" describe-no-warranty t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
786 ["XEmacs License" describe-copying t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
787 ["The Latest Version" describe-distribution t])
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
788 ["Submit Bug Report" send-pr t]))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
789
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
790
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
791 (defun maybe-add-init-button ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
792 "Don't call this.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
793 Adds `Load .emacs' button to menubar when starting up with -q."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
794 ;; by Stig@hackvan.com
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
795 (cond
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
796 (init-file-user nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
797 ((file-exists-p (cond
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
798 ((eq system-type 'ms-dos)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
799 (concat "~" (user-login-name) "/_emacs"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
800 ((eq system-type 'vax-vms)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
801 "sys$login:.emacs")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
802 (t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
803 (concat "~" (user-login-name) "/.emacs"))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
804 (add-menu-button nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
805 ["Load .emacs"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
806 (progn (delete-menu-item '("Load .emacs"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
807 (load-user-init-file (user-login-name)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
808 t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
809 "Help"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
810 (t nil)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
811
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
812 (add-hook 'before-init-hook 'maybe-add-init-button)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
813
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
814
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
815 ;;; The File and Edit menus
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
816
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
817 (defvar put-buffer-names-in-file-menu t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
818
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
819 ;; The sensitivity part of this function could be done by just adding forms
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
820 ;; to evaluate to the menu items themselves; that would be marginally less
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
821 ;; efficient but not perceptibly so (I think). But in order to change the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
822 ;; names of the Undo menu item and the various things on the File menu item,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
823 ;; we need to use a hook.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
824
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
825 (defun file-menu-filter (menu-items)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
826 "Incrementally update the file menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
827 This function changes the arguments and sensitivity of these File menu items:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
828
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
829 Delete Buffer has the name of the current buffer appended to it.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
830 Print Buffer has the name of the current buffer appended to it.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
831 Pretty-Print Buffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
832 has the name of the current buffer appended to it.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
833 Save has the name of the current buffer appended to it, and is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
834 sensitive only when the current buffer is modified.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
835 Revert Buffer has the name of the current buffer appended to it, and is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
836 sensitive only when the current buffer has a file.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
837 Delete Frame sensitive only when there is more than one frame.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
838
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
839 The name of the current buffer is only appended to the menu items if
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
840 `put-buffer-names-in-file-menu' is non-nil. This behavior is the default."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
841 (let* ((bufname (buffer-name))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
842 (result menu-items) ; save pointer to start of menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
843 name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
844 item)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
845 ;; the contents of the menu items in the file menu are destructively
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
846 ;; modified so that there is as little consing as possible. This is okay.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
847 ;; As soon as the result is returned, it is converted to widget_values
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
848 ;; inside lwlib and the lisp menu-items can be safely modified again.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
849 (while (setq item (pop menu-items))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
850 (if (vectorp item)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
851 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
852 (setq name (aref item 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
853 (and put-buffer-names-in-file-menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
854 (member name '("Save" "Revert Buffer" "Print Buffer"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
855 "Pretty-Print Buffer" "Delete Buffer"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
856 (>= (length item) 4)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
857 (aset item 3 bufname))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
858 (and (string= "Save" name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
859 (aset item 2 (buffer-modified-p)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
860 (and (string= "Revert Buffer" name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
861 (aset item 2 (not (not (or buffer-file-name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
862 revert-buffer-function)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
863 (and (string= "Delete Frame" name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
864 (aset item 2 (not (eq (next-frame (selected-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
865 'nomini 'window-system)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
866 (selected-frame)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
867 )))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
868 result))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
869
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
870 (defun edit-menu-filter (menu-items)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
871 "For use as an incremental menu construction filter.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
872 This function changes the sensitivity of these Edit menu items:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
873
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
874 Cut sensitive only when emacs owns the primary X Selection.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
875 Copy sensitive only when emacs owns the primary X Selection.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
876 Clear sensitive only when emacs owns the primary X Selection.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
877 Paste sensitive only when there is an owner for the X Clipboard Selection.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
878 Undo sensitive only when there is undo information.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
879 While in the midst of an undo, this is changed to \"Undo More\"."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
880 (let* (item
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
881 name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
882 (result menu-items) ; save pointer to head of list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
883 (x-dev (eq 'x (device-type (selected-device))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
884 (emacs-owns-selection-p (and x-dev (x-selection-owner-p)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
885 (clipboard-exists-p (and x-dev (x-selection-exists-p 'CLIPBOARD)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
886 ;;; undo-available undoing-more
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
887 ;;; (undo-info-available (not (null (and (not (eq t buffer-undo-list))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
888 ;;; (if (eq last-command 'undo)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
889 ;;; (setq undoing-more
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
890 ;;; (and (boundp 'pending-undo-list)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
891 ;;; pending-undo-list)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
892 ;;; buffer-undo-list))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
893 undo-name undo-state
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
894 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
895 ;; As with file-menu-filter, menu-items are destructively modified.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
896 ;; This is OK.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
897 (while (setq item (pop menu-items))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
898 (if (vectorp item)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
899 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
900 (setq name (aref item 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
901 (and (member name '("Cut" "Copy" "Clear"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
902 (aset item 2 emacs-owns-selection-p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
903 (and (string= name "Paste")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
904 (aset item 2 clipboard-exists-p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
905 (and (member name '("Undo" "Undo More"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
906 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
907 ;; we could also do this with the third field of the item.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
908 (if (eq last-command 'undo)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
909 (setq undo-name "Undo More"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
910 undo-state (not (null (and (boundp 'pending-undo-list)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
911 pending-undo-list))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
912 (setq undo-name "Undo"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
913 undo-state (and (not (eq buffer-undo-list t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
914 (not (null
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
915 (or buffer-undo-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
916 (and (boundp 'pending-undo-list)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
917 pending-undo-list)))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
918 (if buffer-read-only (setq undo-state nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
919 (aset item 0 undo-name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
920 (aset item 2 undo-state)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
921 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
922 )))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
923 result))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
924
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
925
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
926 ;;; The Bookmarks menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
927
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
928 (defun bookmark-menu-filter (&rest ignore)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
929 (let ((definedp (and (boundp 'bookmark-alist)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
930 bookmark-alist
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
931 t)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
932 `(,(if definedp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
933 '("Jump to Bookmark"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
934 :filter (lambda (&rest junk)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
935 (mapcar #'(lambda (bmk)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
936 `[,bmk (bookmark-jump ',bmk) t])
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
937 (bookmark-all-names))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
938 ["Jump to Bookmark" nil nil])
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
939 ["Set bookmark" bookmark-set
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
940 :active (fboundp 'bookmark-set)]
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
941 "---"
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
942 ["Insert contents" bookmark-menu-insert
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
943 :active (fboundp 'bookmark-menu-insert)]
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
944 ["Insert location" bookmark-menu-locate
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
945 :active (fboundp 'bookmark-menu-locate)]
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
946 "---"
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
947 ["Rename bookmark" bookmark-menu-rename
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
948 :active (fboundp 'bookmark-menu-rename)]
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
949 ,(if definedp
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
950 '("Delete Bookmark"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
951 :filter (lambda (&rest junk)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
952 (mapcar #'(lambda (bmk)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
953 `[,bmk (bookmark-delete ',bmk) t])
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
954 (bookmark-all-names))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
955 ["Delete Bookmark" nil nil])
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
956 ["Edit Bookmark List" bookmark-bmenu-list ,definedp]
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
957 "---"
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
958 ["Save bookmarks" bookmark-save ,definedp]
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 213
diff changeset
959 ["Save bookmarks as..." bookmark-write ,definedp]
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
960 ["Load a bookmark file" bookmark-load
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
961 :active (fboundp 'bookmark-load)])))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
962
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
963 ;;; The Buffers menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
964
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
965 (defgroup buffers-menu nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
966 "Customization of `Buffers' menu."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
967 :group 'menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
968
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
969 (defcustom buffers-menu-max-size 25
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
970 "*Maximum number of entries which may appear on the \"Buffers\" menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
971 If this is 10, then only the ten most-recently-selected buffers will be
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
972 shown. If this is nil, then all buffers will be shown. Setting this to
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
973 a large number or nil will slow down menu responsiveness."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
974 :type '(choice (const :tag "Show all" nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
975 (integer 10))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
976 :group 'buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
977
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
978 (defcustom complex-buffers-menu-p nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
979 "*If non-nil, the buffers menu will contain several commands.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
980 Commands will be presented as submenus of each buffer line. If this
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
981 is false, then there will be only one command: select that buffer."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
982 :type 'boolean
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
983 :group 'buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
984
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
985 (defcustom buffers-menu-submenus-for-groups-p nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
986 "*If non-nil, the buffers menu will contain one submenu per group of buffers.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
987 The grouping function is specified in `buffers-menu-grouping-function'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
988 If this is an integer, do not build submenus if the number of buffers
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
989 is not larger than this value."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
990 :type '(choice (const :tag "No Subgroups" nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
991 (integer :tag "Max. submenus" 10)
233
52952cbfc5b5 Import from CVS: tag r20-5b15
cvs
parents: 231
diff changeset
992 (const :tag "Allow Subgroups" t))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
993 :group 'buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
994
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
995 (defcustom buffers-menu-switch-to-buffer-function 'switch-to-buffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
996 "*The function to call to select a buffer from the buffers menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
997 `switch-to-buffer' is a good choice, as is `pop-to-buffer'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
998 :type '(radio (function-item switch-to-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
999 (function-item pop-to-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1000 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1001 :group 'buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1002
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1003 (defcustom buffers-menu-omit-function 'buffers-menu-omit-invisible-buffers
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1004 "*If non-nil, a function specifying the buffers to omit from the buffers menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1005 This is passed a buffer and should return non-nil if the buffer should be
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1006 omitted. The default value `buffers-menu-omit-invisible-buffers' omits
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1007 buffers that are normally considered \"invisible\" (those whose name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1008 begins with a space)."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1009 :type '(choice (const :tag "None" nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1010 function)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1011 :group 'buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1012
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1013 (defcustom buffers-menu-format-buffer-line-function 'format-buffers-menu-line
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1014 "*The function to call to return a string to represent a buffer in the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1015 buffers menu. The function is passed a buffer and should return a string.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1016 The default value `format-buffers-menu-line' just returns the name of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1017 the buffer. Also check out `slow-format-buffers-menu-line' which
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1018 returns a whole bunch of info about a buffer."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1019 :type 'function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1020 :group 'buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1021
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1022 (defcustom buffers-menu-sort-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1023 'sort-buffers-menu-by-mode-then-alphabetically
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1024 "*If non-nil, a function to sort the list of buffers in the buffers menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1025 It will be passed two arguments (two buffers to compare) and should return
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1026 T if the first is \"less\" than the second. One possible value is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1027 `sort-buffers-menu-alphabetically'; another is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1028 `sort-buffers-menu-by-mode-then-alphabetically'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1029 :type '(choice (const :tag "None" nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1030 function)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1031 :group 'buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1032
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1033 (defcustom buffers-menu-grouping-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1034 'group-buffers-menu-by-mode-then-alphabetically
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1035 "*If non-nil, a function to group buffers in the buffers menu together.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1036 It will be passed two arguments, successive members of the sorted buffers
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1037 list after being passed through `buffers-menu-sort-function'. It should
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1038 return non-nil if the second buffer begins a new group. The return value
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1039 should be the name of the old group, which may be used in hierarchical
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1040 buffers menus. The last invocation of the function contains nil as the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1041 second argument, so that the name of the last group can be determined.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1042
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1043 The sensible values of this function are dependent on the value specified
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1044 for `buffers-menu-sort-function'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1045 :type '(choice (const :tag "None" nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1046 function)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1047 :group 'buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1048
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1049 (defun buffers-menu-omit-invisible-buffers (buf)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1050 "For use as a value of `buffers-menu-omit-function'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1051 Omits normally invisible buffers (those whose name begins with a space)."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1052 (not (null (string-match "\\` " (buffer-name buf)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1053
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1054 (defun sort-buffers-menu-alphabetically (buf1 buf2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1055 "For use as a value of `buffers-menu-sort-function'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1056 Sorts the buffers in alphabetical order by name, but puts buffers beginning
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1057 with a star at the end of the list."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1058 (let* ((nam1 (buffer-name buf1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1059 (nam2 (buffer-name buf2))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1060 (star1p (not (null (string-match "\\`*" nam1))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1061 (star2p (not (null (string-match "\\`*" nam2)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1062 (if (not (eq star1p star2p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1063 (not star1p)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1064 (string-lessp nam1 nam2))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1065
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1066 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1067 "For use as a value of `buffers-menu-sort-function'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1068 Sorts first by major mode and then alphabetically by name, but puts buffers
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1069 beginning with a star at the end of the list."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1070 (let* ((nam1 (buffer-name buf1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1071 (nam2 (buffer-name buf2))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1072 (star1p (not (null (string-match "\\`*" nam1))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1073 (star2p (not (null (string-match "\\`*" nam2))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1074 (mode1 (symbol-value-in-buffer 'major-mode buf1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1075 (mode2 (symbol-value-in-buffer 'major-mode buf2)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1076 (cond ((not (eq star1p star2p)) (not star1p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1077 ((and star1p star2p (string-lessp nam1 nam2)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1078 ((string-lessp mode1 mode2) t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1079 ((string-lessp mode2 mode1) nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1080 (t (string-lessp nam1 nam2)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1081
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1082 ;; this version is too slow on some machines.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1083 (defun slow-format-buffers-menu-line (buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1084 "For use as a value of `buffers-menu-format-buffer-line-function'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1085 This returns a string containing a bunch of info about the buffer."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1086 (format "%s%s %-19s %6s %-15s %s"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1087 (if (buffer-modified-p buffer) "*" " ")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1088 (if (symbol-value-in-buffer 'buffer-read-only buffer) "%" " ")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1089 (buffer-name buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1090 (buffer-size buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1091 (symbol-value-in-buffer 'mode-name buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1092 (or (buffer-file-name buffer) "")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1093
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1094 (defun format-buffers-menu-line (buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1095 "For use as a value of `buffers-menu-format-buffer-line-function'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1096 This just returns the buffer's name."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1097 (buffer-name buffer))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1098
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1099 (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1100 "For use as a value of `buffers-menu-grouping-function'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1101 This groups buffers by major mode. It only really makes sense if
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1102 `buffers-menu-sorting-function' is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1103 `sort-buffers-menu-by-mode-then-alphabetically'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1104 (cond ((string-match "\\`*" (buffer-name buf1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1105 (and (null buf2) "*Misc*"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1106 ((or (null buf2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1107 (string-match "\\`*" (buffer-name buf2))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1108 (not (eq (symbol-value-in-buffer 'major-mode buf1)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1109 (symbol-value-in-buffer 'major-mode buf2))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1110 (symbol-value-in-buffer 'mode-name buf1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1111 (t nil)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1112
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1113 (defun buffer-menu-save-buffer (buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1114 (save-excursion
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1115 (set-buffer buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1116 (save-buffer)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1117
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1118 (defun buffer-menu-write-file (buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1119 (save-excursion
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1120 (set-buffer buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1121 (write-file (read-file-name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1122 (format "Write %s to file: "
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1123 (buffer-name (current-buffer)))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1124
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1125 (defsubst build-buffers-menu-internal (buffers)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1126 (let (name line)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1127 (mapcar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1128 #'(lambda (buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1129 (if (eq buffer t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1130 "---"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1131 (setq line (funcall buffers-menu-format-buffer-line-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1132 buffer))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1133 (if complex-buffers-menu-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1134 (delq nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1135 (list line
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1136 (vector "Switch to Buffer"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1137 (list buffers-menu-switch-to-buffer-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1138 (setq name (buffer-name buffer)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1139 t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1140 (if (eq buffers-menu-switch-to-buffer-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1141 'switch-to-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1142 (vector "Switch to Buffer, Other Frame"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1143 (list 'switch-to-buffer-other-frame
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1144 (setq name (buffer-name buffer)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1145 t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1146 nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1147 (if (and (buffer-modified-p buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1148 (buffer-file-name buffer))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1149 (vector "Save Buffer"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1150 (list 'buffer-menu-save-buffer name) t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1151 ["Save Buffer" nil nil]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1152 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1153 (vector "Save As..."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1154 (list 'buffer-menu-write-file name) t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1155 (vector "Delete Buffer" (list 'kill-buffer name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1156 t)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1157 ;; ### We don't want buffer names to be translated,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1158 ;; ### so we put the buffer name in the suffix.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1159 ;; ### Also, avoid losing with non-ASCII buffer names.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1160 ;; ### We still lose, however, if complex-buffers-menu-p. --mrb
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1161 (vector ""
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1162 (list buffers-menu-switch-to-buffer-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1163 (buffer-name buffer))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1164 t line))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1165 buffers)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1166
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1167 (defun buffers-menu-filter (menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1168 "This is the menu filter for the top-level buffers \"Buffers\" menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1169 It dynamically creates a list of buffers to use as the contents of the menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1170 Only the most-recently-used few buffers will be listed on the menu, for
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1171 efficiency reasons. You can control how many buffers will be shown by
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1172 setting `buffers-menu-max-size'. You can control the text of the menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1173 items by redefining the function `format-buffers-menu-line'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1174 (let ((buffers (delete-if buffers-menu-omit-function (buffer-list))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1175 (and (integerp buffers-menu-max-size)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1176 (> buffers-menu-max-size 1)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1177 (> (length buffers) buffers-menu-max-size)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1178 ;; shorten list of buffers (not with submenus!)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1179 (not (and buffers-menu-grouping-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1180 buffers-menu-submenus-for-groups-p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1181 (setcdr (nthcdr buffers-menu-max-size buffers) nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1182 (if buffers-menu-sort-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1183 (setq buffers (sort buffers buffers-menu-sort-function)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1184 (if (and buffers-menu-grouping-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1185 buffers-menu-submenus-for-groups-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1186 (or (not (integerp buffers-menu-submenus-for-groups-p))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1187 (> (length buffers) buffers-menu-submenus-for-groups-p)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1188 (let (groups groupnames current-group)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1189 (mapl
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1190 #'(lambda (sublist)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1191 (let ((groupname (funcall buffers-menu-grouping-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1192 (car sublist) (cadr sublist))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1193 (setq current-group (cons (car sublist) current-group))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1194 (if groupname
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1195 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1196 (setq groups (cons (nreverse current-group)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1197 groups))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1198 (setq groupnames (cons groupname groupnames))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1199 (setq current-group nil)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1200 buffers)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1201 (setq buffers
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1202 (mapcar*
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1203 #'(lambda (groupname group)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1204 (cons groupname (build-buffers-menu-internal group)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1205 (nreverse groupnames)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1206 (nreverse groups))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1207 (if buffers-menu-grouping-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1208 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1209 (setq buffers
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1210 (mapcon
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1211 #'(lambda (sublist)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1212 (cond ((funcall buffers-menu-grouping-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1213 (car sublist) (cadr sublist))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1214 (list (car sublist) t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1215 (t (list (car sublist)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1216 buffers))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1217 ;; remove a trailing separator.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1218 (and (>= (length buffers) 2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1219 (let ((lastcdr (nthcdr (- (length buffers) 2) buffers)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1220 (if (eq t (cadr lastcdr))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1221 (setcdr lastcdr nil))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1222 (setq buffers (build-buffers-menu-internal buffers)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1223 (append menu buffers)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1224 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1225
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1226 (defun language-environment-menu-filter (menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1227 "This is the menu filter for the \"Language Environment\" submenu."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1228 (mapcar (lambda (env-sym)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1229 `[ ,(capitalize (symbol-name env-sym))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1230 (set-language-environment ',env-sym) t])
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1231 language-environment-list))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1232
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1233
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1234 ;;; The Options menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1235
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1236 (defvar options-save-faces nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1237 "if t, save-options will save all the face information.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1238 Set to nil to avoid this. This is recommended on XEmacs 19.15
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1239 and above as we have a much more powerful (read: working) way
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1240 of changing and saving faces via cu-edit-faces.el & custom.el.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1241
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1242 (defconst options-menu-saved-forms
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1243 ;; This is really quite a kludge, but it gets the job done.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1244 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1245 ;; remember that we have to conditionalize on default features
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1246 ;; both in the forms to evaluate and in the forms output to
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1247 ;; .emacs, in case the .emacs is loaded into an XEmacs with
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1248 ;; different features.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1249 (purecopy
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1250 '(
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1251 ;; Editing Options menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1252 ;; put case-fold-search first to defeat a bug in the backquote
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1253 ;; processing mechanism. Feh!
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1254 case-fold-search
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1255 `(setq-default overwrite-mode ,(default-value 'overwrite-mode))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1256 (if (default-value 'overwrite-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1257 '(overwrite-mode 1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1258 `(setq-default case-fold-search ,(default-value 'case-fold-search))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1259 case-replace
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1260 (if (and (boundp 'pending-delete-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1261 pending-delete-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1262 '(pending-delete-mode 1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1263 zmacs-regions
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1264 mouse-yank-at-point
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1265 require-final-newline
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1266 next-line-add-newlines
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1267
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1268 ;; General Options menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1269 teach-extended-commands-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1270 ;; (#### not actually on Options menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1271 teach-extended-commands-timeout
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1272 debug-on-error
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1273 debug-on-quit
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1274
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1275 ;; Printing Options menu.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1276 lpr-switches
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1277 ps-print-color-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1278 ps-paper-type
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1279
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1280 ;; Other Window Location
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1281 get-frame-for-buffer-default-instance-limit
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1282 temp-buffer-show-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1283 (if gnuserv-frame
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1284 '(setq gnuserv-frame (selected-frame)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1285
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1286 ;; Syntax Highlighting
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1287 font-lock-auto-fontify
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1288 font-lock-use-fonts
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1289 font-lock-use-colors
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1290 font-lock-maximum-decoration
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1291 font-lock-maximum-size
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1292 ;; (#### the next two not on Options menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1293 font-lock-mode-enable-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1294 font-lock-mode-disable-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1295 ;; #### - this structure is clearly broken. There's no way to ever
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1296 ;; un-require font-lock via the menus. --Stig
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1297 (if (featurep 'font-lock)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1298 '(require 'font-lock))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1299 (if (and (boundp 'font-lock-mode-hook)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1300 (memq 'turn-on-fast-lock font-lock-mode-hook))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1301 '(add-hook 'font-lock-mode-hook 'turn-on-fast-lock)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1302 '(remove-hook 'font-lock-mode-hook 'turn-on-fast-lock))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1303 (if (and (boundp 'font-lock-mode-hook)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1304 (memq 'turn-on-lazy-shot font-lock-mode-hook))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1305 '(add-hook 'font-lock-mode-hook 'turn-on-lazy-shot)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1306 '(remove-hook 'font-lock-mode-hook 'turn-on-lazy-shot))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1307
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1308 ;; Paren Highlighting
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1309 (if paren-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1310 `(progn (require 'paren) (paren-set-mode ',paren-mode)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1311
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1312 ;; For specifiers, we only save global settings since the others
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1313 ;; will belong to objects which only exist during this session.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1314
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1315 ;; Frame Appearance
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1316 (if (featurep 'scrollbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1317 `(if (featurep 'scrollbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1318 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1319 (add-spec-list-to-specifier
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1320 scrollbar-width
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1321 ',(specifier-spec-list scrollbar-width 'global))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1322 (add-spec-list-to-specifier
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1323 scrollbar-height
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1324 ',(specifier-spec-list scrollbar-height 'global)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1325 `(add-spec-list-to-specifier
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1326 modeline-shadow-thickness
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1327 ',(specifier-spec-list modeline-shadow-thickness 'global))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1328 `(setq-default truncate-lines ,(default-value 'truncate-lines))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1329 bar-cursor
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1330 (if (and (boundp 'blink-cursor-mode) blink-cursor-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1331 '(blink-cursor-mode t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1332
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1333 ;; Menubar Appearance
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1334 buffers-menu-max-size
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1335 complex-buffers-menu-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1336 buffers-menu-sort-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1337 buffers-menu-grouping-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1338 buffers-menu-submenus-for-groups-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1339 font-menu-ignore-scaled-fonts
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1340 font-menu-this-frame-only-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1341
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1342 ;; Toolbar Appearance
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1343 (if (featurep 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1344 `(if (featurep 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1345 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1346 (set-default-toolbar-position
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1347 ',(default-toolbar-position))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1348 (add-spec-list-to-specifier
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1349 default-toolbar-visible-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1350 ',(specifier-spec-list default-toolbar-visible-p 'global))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1351 (add-spec-list-to-specifier
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1352 toolbar-buttons-captioned-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1353 ',(specifier-spec-list toolbar-buttons-captioned-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1354 'global)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1355
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1356 ;; mouse
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1357 mouse-avoidance-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1358
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1359 ;; Open URLs With
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1360 browse-url-browser-function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1361
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1362 ;; Now save all faces.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1363
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1364 ;; Setting this in lisp conflicts with X resources. Bad move. --Stig
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1365 ;; (list 'set-face-font ''default (face-font-name 'default))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1366 ;; (list 'set-face-font ''modeline (face-font-name 'modeline))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1367 (if options-save-faces
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1368 (cons 'progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1369 (mapcar #'(lambda (face)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1370 `(make-face ',face))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1371 (save-options-non-customized-face-list))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1372
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1373 (if options-save-faces
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1374 (cons 'progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1375 (apply 'nconc
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1376 (mapcar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1377 #'(lambda (face)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1378 (delq nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1379 (mapcar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1380 #'(lambda (property)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1381 (if (specifier-spec-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1382 (face-property face property))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1383 `(add-spec-list-to-specifier
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1384 (face-property ',face ',property)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1385 ',(save-options-specifier-spec-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1386 face property))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1387 (delq 'display-table
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1388 (copy-sequence
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1389 built-in-face-specifiers)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1390 (save-options-non-customized-face-list)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1391
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1392 ;; Mule-specific:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1393 (if (featurep 'mule)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1394 `(if (featurep 'mule)
211
78478c60bfcd Import from CVS: tag r20-4b4
cvs
parents: 209
diff changeset
1395 (set-language-environment ',current-language-environment)))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1396 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1397 "The variables to save; or forms to evaluate to get forms to write out.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1398 This is used by `save-options-menu-settings' and should mirror the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1399 options listed in the Options menu.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1400
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1401 (defun save-options-non-customized-face-list ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1402 "This function will return a list of all faces that have not been
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1403 'customized'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1404 (delq nil (mapcar '(lambda (face)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1405 (unless (get face 'saved-face)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1406 face))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1407 (face-list))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1408
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1409 (defun save-options-specifier-spec-list (face property)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1410 (if (not (or (eq property 'font) (eq property 'color)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1411 (specifier-spec-list (face-property face property) 'global)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1412 (let* ((retlist (specifier-spec-list (face-property face property)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1413 'global))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1414 (entry (cdr (car retlist)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1415 item)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1416 (while entry
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1417 (setq item (car entry))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1418 (if (eq property 'font)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1419 (if (font-instance-p (cdr item))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1420 (setcdr item (font-instance-name (cdr item))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1421 (if (color-instance-p (cdr item))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1422 (setcdr item (color-instance-name (cdr item)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1423 (setq entry (cdr entry)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1424 retlist)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1425
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1426 (defvar save-options-init-file nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1427 "File into which to save forms to load the options file (nil for .emacs).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1428 Normally this is nil, which means save into your .emacs file (the value
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1429 of `user-init-file'.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1430
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1431 (defvar save-options-file ".xemacs-options"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1432 "File to save options into.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1433 This file is loaded from your .emacs file.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1434 If this is a relative filename, it is put into the same directory as your
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1435 .emacs file.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1436
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1437 (defun save-options-menu-settings ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1438 "Saves the current settings of the `Options' menu to your `.emacs' file."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1439 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1440 ;; we compute the actual filenames now because x-menubar is loaded
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1441 ;; at dump time, when the identity of the user running XEmacs is not known.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1442 (let* ((actual-save-options-init-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1443 (or save-options-init-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1444 (and (not (equal user-init-file ""))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1445 user-init-file)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1446 (and (eq system-type 'ms-dos)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1447 (concat "~" (user-login-name) "/_emacs"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1448 (concat "~" (user-login-name) "/.emacs")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1449 (actual-save-options-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1450 (abbreviate-file-name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1451 (expand-file-name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1452 save-options-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1453 (file-name-directory actual-save-options-init-file))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1454 ;; Don't hack-homedir in abbreviate-file-name. This will
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1455 ;; cause an incorrect expansion if the save-options variables
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1456 ;; have ~ in them.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1457 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1458 (init-output-buffer (find-file-noselect
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1459 actual-save-options-init-file))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1460 init-output-marker
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1461 (options-output-buffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1462 (find-file-noselect actual-save-options-file))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1463 options-output-marker)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1464
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1465 (save-excursion
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1466 (set-buffer options-output-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1467 (erase-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1468 (setq options-output-marker (point-marker)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1469
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1470 ;; run with current-buffer unchanged so that variables are evaluated in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1471 ;; the current context, instead of in the context of the ".emacs" buffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1472 ;; or the ".xemacs-options" buffer.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1473
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1474 ;; first write out .xemacs-options.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1475
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1476 (let ((standard-output options-output-marker))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1477 (princ ";; -*- Mode: Emacs-Lisp -*-\n\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1478 (princ "(setq options-file-xemacs-version '(")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1479 (princ emacs-major-version)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1480 (princ " ")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1481 (princ emacs-minor-version)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1482 (princ "))\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1483 (let ((print-readably t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1484 (print-escape-newlines t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1485 (mapcar #'(lambda (var)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1486 (princ " ")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1487 (if (symbolp var)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1488 (prin1 (list 'setq-default var
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1489 (let ((val (symbol-value var)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1490 (if (or (memq val '(t nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1491 (and (not (symbolp val))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1492 (not (consp val))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1493 val
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1494 (list 'quote val)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1495 (setq var (eval var))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1496 (cond ((eq (car-safe var) 'progn)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1497 (while (setq var (cdr var))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1498 (prin1 (car var))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1499 (princ "\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1500 (if (cdr var) (princ " "))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1501 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1502 (var
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1503 (prin1 var))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1504 (if var (princ "\n")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1505 options-menu-saved-forms)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1506 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1507 (set-marker options-output-marker nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1508 (save-excursion
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1509 (set-buffer options-output-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1510 (save-buffer))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1511
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1512 ;; then fix .emacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1513
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1514 (save-excursion
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1515 (set-buffer init-output-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1516 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1517 ;; Find and delete the previously saved data, and position to write.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1518 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1519 (goto-char (point-min))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1520 (if (re-search-forward "^;; Options Menu Settings *\n" nil 'move)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1521 (let ((p (match-beginning 0)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1522 (goto-char p)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1523 (or (re-search-forward
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1524 "^;; End of Options Menu Settings *\\(\n\\|\\'\\)"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1525 nil t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1526 (error "can't find END of saved state in .emacs"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1527 (delete-region p (match-end 0)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1528 (goto-char (point-max))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1529 (insert "\n"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1530 (setq init-output-marker (point-marker)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1531
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1532 (let ((standard-output init-output-marker))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1533 (princ ";; Options Menu Settings\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1534 (princ ";; =====================\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1535 (princ "(cond\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1536 (princ " ((and (string-match \"XEmacs\" emacs-version)\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1537 (princ " (boundp 'emacs-major-version)\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1538 (princ " (or (and\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1539 (princ " (= emacs-major-version 19)\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1540 (princ " (>= emacs-minor-version 14))\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1541 (princ " (= emacs-major-version 20))\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1542 (princ " (fboundp 'load-options-file))\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1543 (princ " (load-options-file \"")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1544 (princ actual-save-options-file)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1545 (princ "\")))\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1546 (princ ";; ============================\n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1547 (princ ";; End of Options Menu Settings\n"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1548
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1549 (set-marker init-output-marker nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1550 (save-excursion
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1551 (set-buffer init-output-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1552 (save-buffer))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1553 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1554
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1555
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1556 (set-menubar default-menubar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1557
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1558
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1559 ;;; Popup menus.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1560
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1561 (defconst default-popup-menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1562 '("XEmacs Commands"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1563 :filter edit-menu-filter
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1564 ["Undo" advertised-undo t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1565 ["Cut" x-kill-primary-selection t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1566 ["Copy" x-copy-primary-selection t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1567 ["Paste" x-yank-clipboard-selection t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1568 ["Clear" x-delete-primary-selection t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1569 "-----"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1570 ["Select Block" mark-paragraph t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1571 ["Split Window" (split-window) t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1572 ["Unsplit Window" delete-other-windows t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1573 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1574
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1575 (defvar global-popup-menu nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1576 "The global popup menu. This is present in all modes.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1577 See the function `popup-menu' for a description of menu syntax.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1578
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1579 (defvar mode-popup-menu nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1580 "The mode-specific popup menu. Automatically buffer local.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1581 This is appended to the default items in `global-popup-menu'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1582 See the function `popup-menu' for a description of menu syntax.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1583 (make-variable-buffer-local 'mode-popup-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1584
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1585 ;; In an effort to avoid massive menu clutter, this mostly worthless menu is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1586 ;; superceded by any local popup menu...
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1587 (setq-default mode-popup-menu default-popup-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1588
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1589 (defvar activate-popup-menu-hook nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1590 "Function or functions run before a mode-specific popup menu is made visible.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1591 These functions are called with no arguments, and should interrogate and
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1592 modify the value of `global-popup-menu' or `mode-popup-menu' as desired.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1593 Note: this hook is only run if you use `popup-mode-menu' for activating the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1594 global and mode-specific commands; if you have your own binding for button3,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1595 this hook won't be run.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1596
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1597 (defun popup-mode-menu ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1598 "Pop up a menu of global and mode-specific commands.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1599 The menu is computed by combining `global-popup-menu' and `mode-popup-menu'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1600 (interactive "@_")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1601 (run-hooks 'activate-popup-menu-hook)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1602 (popup-menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1603 (cond ((and global-popup-menu mode-popup-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1604 (check-menu-syntax mode-popup-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1605 (let* ((title (car mode-popup-menu))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1606 (items (cdr mode-popup-menu))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1607 filters)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1608 ;; Strip keywords from local menu for attaching them at the top
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1609 (while (and items
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1610 (symbolp (car items)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1611 (setq items (append filters (list (car items))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1612 (setq items (cdr items)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1613 ;; If filters contains a keyword already present in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1614 ;; `global-popup-menu' you will probably lose.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1615 (append (list (car global-popup-menu))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1616 filters
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1617 (cdr global-popup-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1618 '("---" "---")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1619 (if popup-menu-titles (list title))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1620 (if popup-menu-titles '("---" "---"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1621 items)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1622 (t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1623 (or mode-popup-menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1624 global-popup-menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1625 (error "No menu here."))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1626
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1627 (defun popup-buffer-menu (event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1628 "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1629 (interactive "e")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1630 (let ((window (and (event-over-text-area-p event) (event-window event)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1631 (bmenu nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1632 (or window
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1633 (error "Pointer must be in a normal window"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1634 (select-window window)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1635 (if current-menubar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1636 (setq bmenu (assoc "Buffers" current-menubar)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1637 (if (null bmenu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1638 (setq bmenu (assoc "Buffers" default-menubar)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1639 (if (null bmenu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1640 (error "Can't find the Buffers menu"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1641 (popup-menu bmenu)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1642
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1643 (defun popup-menubar-menu (event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1644 "Pop up a copy of menu that also appears in the menubar"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1645 ;; by Stig@hackvan.com
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1646 (interactive "e")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1647 (let ((window (and (event-over-text-area-p event) (event-window event)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1648 popup-menubar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1649 (or window
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1650 (error "Pointer must be in a normal window"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1651 (select-window window)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1652 (and current-menubar (run-hooks 'activate-menubar-hook))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1653 ;; ##### Instead of having to copy this just to safely get rid of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1654 ;; any nil what we should really do is fix up the internal menubar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1655 ;; code to just ignore nil if generating a popup menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1656 (setq popup-menubar (delete nil (copy-sequence (or current-menubar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1657 default-menubar))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1658 (popup-menu (cons "Menubar Menu" popup-menubar))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1659 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1660
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1661 (global-set-key 'button3 'popup-mode-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1662 ;; shift button3 and shift button2 are reserved for Hyperbole
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1663 (global-set-key '(meta control button3) 'popup-buffer-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1664 ;; The following command is way too dangerous with Custom.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1665 ;; (global-set-key '(meta shift button3) 'popup-menubar-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1666
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1667 ;; Here's a test of the cool new menu features (from Stig).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1668
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1669 ;(setq mode-popup-menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1670 ; '("Test Popup Menu"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1671 ; :filter cdr
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1672 ; ["this item won't appear because of the menu filter" ding t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1673 ; "--:singleLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1674 ; "singleLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1675 ; "--:doubleLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1676 ; "doubleLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1677 ; "--:singleDashedLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1678 ; "singleDashedLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1679 ; "--:doubleDashedLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1680 ; "doubleDashedLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1681 ; "--:noLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1682 ; "noLine"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1683 ; "--:shadowEtchedIn"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1684 ; "shadowEtchedIn"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1685 ; "--:shadowEtchedOut"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1686 ; "shadowEtchedOut"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1687 ; "--:shadowDoubleEtchedIn"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1688 ; "shadowDoubleEtchedIn"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1689 ; "--:shadowDoubleEtchedOut"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1690 ; "shadowDoubleEtchedOut"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1691 ; "--:shadowEtchedInDash"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1692 ; "shadowEtchedInDash"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1693 ; "--:shadowEtchedOutDash"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1694 ; "shadowEtchedOutDash"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1695 ; "--:shadowDoubleEtchedInDash"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1696 ; "shadowDoubleEtchedInDash"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1697 ; "--:shadowDoubleEtchedOutDash"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1698 ; "shadowDoubleEtchedOutDash"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1699 ; ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1700
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1701 (defun xemacs-splash-buffer ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1702 "Redisplay XEmacs splash screen in a buffer."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1703 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1704 (let ((buffer (get-buffer-create "*Splash*")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1705 (set-buffer buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1706 (erase-buffer buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1707 (startup-splash-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1708 (pop-to-buffer buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1709 (delete-other-windows)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1710
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1711 (provide 'x-menubar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1712
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1713 ;;; x-menubar.el ends here.