428
|
1 ;;; menubar-items.el --- Menubar and popup-menu content for XEmacs.
|
|
2
|
|
3 ;; Copyright (C) 1991-1995, 1997-1998 Free Software Foundation, Inc.
|
|
4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
|
|
5 ;; Copyright (C) 1995 Sun Microsystems.
|
442
|
6 ;; Copyright (C) 1995, 1996, 2000 Ben Wing.
|
|
7 ;; Copyright (C) 1997 MORIOKA Tomohiko.
|
428
|
8
|
|
9 ;; Maintainer: XEmacs Development Team
|
|
10 ;; Keywords: frames, extensions, internal, dumped
|
|
11
|
|
12 ;; This file is part of XEmacs.
|
|
13
|
|
14 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
15 ;; under the terms of the GNU General Public License as published by
|
|
16 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
17 ;; any later version.
|
|
18
|
|
19 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
22 ;; General Public License for more details.
|
|
23
|
|
24 ;; You should have received a copy of the GNU General Public License
|
|
25 ;; along with Xmacs; see the file COPYING. If not, write to the
|
|
26 ;; Free Software Foundation, 59 Temple Place - Suite 330,
|
|
27 ;; Boston, MA 02111-1307, USA.
|
|
28
|
442
|
29 ;;; Authorship:
|
|
30
|
|
31 ;; Created c. 1991 for Lucid Emacs. Originally called x-menubar.el.
|
|
32 ;; Contained four menus -- File, Edit, Buffers, Help.
|
|
33 ;; Dynamic menu changes possible only through activate-menubar-hook.
|
|
34 ;; Also contained menu manipulation funs, e.g. find-menu-item, add-menu.
|
|
35 ;; Options menu added for 19.9 by Jamie Zawinski, late 1993.
|
|
36 ;; Major reorganization c. 1994 by Ben Wing; added many items and moved
|
|
37 ;; some items to two new menus, Apps and Tools. (for 19.10?)
|
|
38 ;; Generic menubar functions moved to new file, menubar.el, by Ben Wing,
|
|
39 ;; 1995, for 19.12; also, creation of current buffers menu options,
|
|
40 ;; and buffers menu changed from purely most-recent to sorted alphabetical,
|
|
41 ;; by mode. Also added mode-popup-menu support.
|
|
42 ;; New API (add-submenu, add-menu-button) and menu filter support added
|
|
43 ;; late summer 1995 by Stig, for 19.13. Also popup-menubar-menu.
|
|
44 ;; Renamed to menubar-items.el c. 1998, with MS Win support.
|
|
45 ;; Options menu rewritten to use custom c. 1999 by ? (Jan Vroonhof?).
|
|
46 ;; Major reorganization Mar. 2000 by Ben Wing; added many items and changed
|
|
47 ;; top-level menus to File, Edit, View, Cmds, Tools, Options, Buffers.
|
|
48 ;; Accelerator spec functionality added Mar. 2000 by Ben Wing.
|
|
49
|
428
|
50 ;;; Commentary:
|
|
51
|
|
52 ;; This file is dumped with XEmacs (when window system and menubar support is
|
|
53 ;; compiled in).
|
|
54
|
|
55 ;;; Code:
|
|
56
|
464
|
57 (defun Menubar-items-truncate-list (list n)
|
|
58 (mapcar #'(lambda (x)
|
|
59 (if (<= (length x) 50) x (concat "..." (substring x -50))))
|
|
60 (if (<= (length list) n)
|
|
61 list
|
|
62 (butlast list (- (length list) n)))))
|
442
|
63
|
|
64 (defun submenu-generate-accelerator-spec (list &optional omit-chars-list)
|
|
65 "Add auto-generated accelerator specifications to a submenu.
|
|
66 This can be used to add accelerators to the return value of a menu filter
|
|
67 function. It correctly ignores unselectable items. It will destructively
|
|
68 modify the list passed to it. If an item already has an auto-generated
|
|
69 accelerator spec, this will be removed before the new one is added, making
|
|
70 this function idempotent.
|
|
71
|
|
72 If OMIT-CHARS-LIST is given, it should be a list of lowercase characters,
|
|
73 which will not be used as accelerators."
|
|
74 (let ((n 0))
|
|
75 (dolist (item list list)
|
|
76 (cond
|
|
77 ((vectorp item)
|
|
78 (setq n (1+ n))
|
|
79 (aset item 0
|
|
80 (concat
|
|
81 (menu-item-generate-accelerator-spec n omit-chars-list)
|
|
82 (menu-item-strip-accelerator-spec (aref item 0)))))
|
|
83 ((consp item)
|
|
84 (setq n (1+ n))
|
|
85 (setcar item
|
|
86 (concat
|
|
87 (menu-item-generate-accelerator-spec n omit-chars-list)
|
|
88 (menu-item-strip-accelerator-spec (car item)))))))))
|
|
89
|
|
90 (defun menu-item-strip-accelerator-spec (item)
|
|
91 "Strip an auto-generated accelerator spec off of ITEM.
|
|
92 ITEM should be a string. This removes specs added by
|
|
93 `menu-item-generate-accelerator-spec' and `submenu-generate-accelerator-spec'."
|
|
94 (if (string-match "%_. " item)
|
|
95 (substring item 4)
|
|
96 item))
|
|
97
|
|
98 (defun menu-item-generate-accelerator-spec (n &optional omit-chars-list)
|
|
99 "Return an accelerator specification for use with auto-generated menus.
|
|
100 This should be concat'd onto the beginning of each menu line. The spec
|
|
101 allows the Nth line to be selected by the number N. '0' is used for the
|
|
102 10th line, and 'a' through 'z' are used for the following 26 lines.
|
|
103
|
|
104 If OMIT-CHARS-LIST is given, it should be a list of lowercase characters,
|
|
105 which will not be used as accelerators."
|
|
106 (cond ((< n 10) (concat "%_" (int-to-string n) " "))
|
|
107 ((= n 10) "%_0 ")
|
|
108 ((<= n 36)
|
|
109 (setq n (- n 10))
|
|
110 (let ((m 0))
|
|
111 (while (> n 0)
|
|
112 (setq m (1+ m))
|
|
113 (while (memq (int-to-char (+ m (- (char-to-int ?a) 1)))
|
|
114 omit-chars-list)
|
|
115 (setq m (1+ m)))
|
|
116 (setq n (1- n)))
|
|
117 (if (<= m 26)
|
|
118 (concat
|
|
119 "%_"
|
|
120 (char-to-string (int-to-char (+ m (- (char-to-int ?a) 1))))
|
|
121 " ")
|
|
122 "")))
|
|
123 (t "")))
|
428
|
124
|
|
125 (defconst default-menubar
|
444
|
126 ; (purecopy-menubar ;purespace is dead
|
428
|
127 ;; note backquote.
|
|
128 `(
|
442
|
129 ("%_File"
|
|
130 ["%_Open..." find-file]
|
|
131 ["Open in Other %_Window..." find-file-other-window]
|
|
132 ["Open in New %_Frame..." find-file-other-frame]
|
|
133 ["%_Hex Edit File..." hexl-find-file
|
|
134 :active (fboundp 'hexl-find-file)]
|
|
135 ["%_Insert File..." insert-file]
|
|
136 ["%_View File..." view-file]
|
428
|
137 "------"
|
442
|
138 ["%_Save" save-buffer
|
428
|
139 :active (buffer-modified-p)
|
|
140 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
|
442
|
141 ["Save %_As..." write-file]
|
|
142 ["Save So%_me Buffers" save-some-buffers]
|
428
|
143 "-----"
|
506
|
144 ,@(if (eq system-type 'windows-nt)
|
|
145 '(["Page Set%_up..." generic-page-setup]))
|
442
|
146 ["%_Print" generic-print-buffer
|
|
147 :active (or (valid-specifier-tag-p 'msprinter)
|
|
148 (and (not (eq system-type 'windows-nt))
|
506
|
149 (fboundp 'lpr-region)))
|
442
|
150 :suffix (if put-buffer-names-in-file-menu (concat (buffer-name) "...")
|
|
151 "...")]
|
506
|
152 ,@(unless (eq system-type 'windows-nt)
|
|
153 '(["Prett%_y-Print" ps-print-buffer-with-faces
|
|
154 :active (fboundp 'ps-print-buffer-with-faces)
|
|
155 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]))
|
428
|
156 "-----"
|
442
|
157 ["%_Revert Buffer" revert-buffer
|
428
|
158 :active (or buffer-file-name revert-buffer-function)
|
|
159 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
|
442
|
160 ["Re%_cover File..." recover-file]
|
|
161 ["Recover S%_ession..." recover-session]
|
428
|
162 "-----"
|
442
|
163 ["E%_xit XEmacs" save-buffers-kill-emacs]
|
428
|
164 )
|
|
165
|
442
|
166 ("%_Edit"
|
|
167 ["%_Undo" advertised-undo
|
428
|
168 :active (and (not (eq buffer-undo-list t))
|
|
169 (or buffer-undo-list pending-undo-list))
|
|
170 :suffix (if (or (eq last-command 'undo)
|
|
171 (eq last-command 'advertised-undo))
|
438
|
172 "More" "")]
|
442
|
173 ["%_Redo" redo
|
428
|
174 :included (fboundp 'redo)
|
|
175 :active (not (or (eq buffer-undo-list t)
|
438
|
176 (eq last-buffer-undo-list nil)
|
|
177 (not (or (eq last-buffer-undo-list buffer-undo-list)
|
|
178 (and (null (car-safe buffer-undo-list))
|
|
179 (eq last-buffer-undo-list
|
|
180 (cdr-safe buffer-undo-list)))))
|
|
181 (or (eq buffer-undo-list pending-undo-list)
|
|
182 (eq (cdr buffer-undo-list) pending-undo-list))))
|
428
|
183 :suffix (if (eq last-command 'redo) "More" "")]
|
442
|
184 "----"
|
|
185 ["Cu%_t" kill-primary-selection
|
428
|
186 :active (selection-owner-p)]
|
442
|
187 ["%_Copy" copy-primary-selection
|
|
188 :active (selection-owner-p)]
|
|
189 ["%_Paste" yank-clipboard-selection
|
428
|
190 :active (selection-exists-p 'CLIPBOARD)]
|
442
|
191 ["%_Delete" delete-primary-selection
|
428
|
192 :active (selection-owner-p)]
|
|
193 "----"
|
442
|
194 ["Select %_All" mark-whole-buffer]
|
|
195 ["Select Pa%_ge" mark-page]
|
502
|
196 ["Select Paragrap%_h" mark-paragraph]
|
|
197 ["Re%_select Region" activate-region :active (mark t)]
|
428
|
198 "----"
|
442
|
199 ["%_Find..." make-search-dialog]
|
|
200 ["R%_eplace..." query-replace]
|
|
201 ["Replace (Rege%_xp)..." query-replace-regexp]
|
|
202 ["%_List Matching Lines..." list-matching-lines]
|
|
203 ,@(when (featurep 'mule)
|
|
204 '("----"
|
|
205 ("%_Multilingual (\"Mule\")"
|
|
206 ("%_Describe Language Support")
|
|
207 ("%_Set Language Environment")
|
428
|
208 "--"
|
442
|
209 ["T%_oggle Input Method" toggle-input-method]
|
|
210 ["Select %_Input Method" set-input-method]
|
|
211 ["D%_escribe Input Method" describe-input-method]
|
428
|
212 "--"
|
442
|
213 ["Describe Current %_Coding Systems"
|
428
|
214 describe-current-coding-system]
|
442
|
215 ["Set Coding System of %_Buffer File..."
|
428
|
216 set-buffer-file-coding-system]
|
|
217 ;; not implemented yet
|
442
|
218 ["Set Coding System of %_Terminal..."
|
428
|
219 set-terminal-coding-system :active nil]
|
|
220 ;; not implemented yet
|
442
|
221 ["Set Coding System of %_Keyboard..."
|
428
|
222 set-keyboard-coding-system :active nil]
|
442
|
223 ["Set Coding System of %_Process..."
|
428
|
224 set-buffer-process-coding-system
|
|
225 :active (get-buffer-process (current-buffer))]
|
|
226 "--"
|
442
|
227 ["Show Cha%_racter Table" view-charset-by-menu]
|
428
|
228 ;; not implemented yet
|
442
|
229 ["Show Dia%_gnosis for MULE" mule-diag :active nil]
|
|
230 ["Show \"%_hello\" in Many Languages" view-hello-file]))
|
|
231 )
|
|
232 )
|
428
|
233
|
442
|
234 ("%_View"
|
|
235 ["%_New Frame" make-frame]
|
462
|
236 ["Frame on Other Displa%_y..." make-frame-on-display
|
|
237 :active (fboundp 'make-frame-on-display)]
|
442
|
238 ["%_Delete Frame" delete-frame
|
|
239 :active (not (eq (next-frame (selected-frame) 'nomini 'window-system)
|
|
240 (selected-frame)))]
|
|
241 "-----"
|
|
242 ["%_Split Window" split-window-vertically]
|
|
243 ["S%_plit Window (Side by Side)" split-window-horizontally]
|
|
244 ["%_Un-Split (Keep This)" delete-other-windows
|
|
245 :active (not (one-window-p t))]
|
|
246 ["Un-Split (Keep %_Others)" delete-window
|
|
247 :active (not (one-window-p t))]
|
428
|
248 "----"
|
442
|
249 ("N%_arrow"
|
|
250 ["%_Narrow to Region" narrow-to-region :active (region-exists-p)]
|
|
251 ["Narrow to %_Page" narrow-to-page]
|
|
252 ["Narrow to %_Defun" narrow-to-defun]
|
|
253 "----"
|
|
254 ["%_Widen" widen :active (or (/= (point-min) 1)
|
|
255 (/= (point-max) (1+ (buffer-size))))]
|
|
256 )
|
428
|
257 "----"
|
442
|
258 ["Show Message %_Log" show-message-log]
|
|
259 "----"
|
|
260 ["%_Goto Line..." goto-line]
|
|
261 ["%_What Line" what-line]
|
|
262 ("%_Bookmarks"
|
|
263 :filter bookmark-menu-filter)
|
|
264 "----"
|
|
265 ["%_Jump to Previous Mark" (set-mark-command t)
|
|
266 :active (mark t)]
|
|
267 )
|
428
|
268
|
442
|
269 ("C%_mds"
|
|
270 ["Repeat %_Last Complex Command..." repeat-complex-command]
|
|
271 ["E%_valuate Lisp Expression..." eval-expression]
|
|
272 ["Execute %_Named Command..." execute-extended-command]
|
|
273 "----"
|
|
274 ["Start %_Macro Recording" start-kbd-macro
|
|
275 :included (not defining-kbd-macro)]
|
|
276 ["End %_Macro Recording" end-kbd-macro
|
|
277 :included defining-kbd-macro]
|
|
278 ["E%_xecute Last Macro" call-last-kbd-macro
|
|
279 :active last-kbd-macro]
|
|
280 ("%_Other Macro"
|
|
281 ["%_Append to Last Macro" (start-kbd-macro t)
|
|
282 :active (and (not defining-kbd-macro) last-kbd-macro)]
|
|
283 ["%_Query User During Macro" kbd-macro-query
|
|
284 :active defining-kbd-macro]
|
|
285 ["Enter %_Recursive Edit During Macro" (kbd-macro-query t)
|
|
286 :active defining-kbd-macro]
|
|
287 "---"
|
|
288 ["E%_xecute Last Macro on Region Lines"
|
|
289 :active (and last-kbd-macro (region-exists-p))]
|
|
290 "---"
|
|
291 ["%_Name Last Macro..." name-last-kbd-macro
|
|
292 :active last-kbd-macro]
|
|
293 ["Assign Last Macro to %_Key..." assign-last-kbd-macro-to-key
|
|
294 :active (and last-kbd-macro
|
|
295 (fboundp 'assign-last-kbd-macro-to-key))]
|
|
296 "---"
|
|
297 ["%_Edit Macro..." edit-kbd-macro]
|
|
298 ["Edit %_Last Macro" edit-last-kbd-macro
|
|
299 :active last-kbd-macro]
|
|
300 "---"
|
|
301 ["%_Insert Named Macro into Buffer..." insert-kbd-macro]
|
|
302 ["Read Macro from Re%_gion" read-kbd-macro
|
|
303 :active (region-exists-p)]
|
|
304 )
|
|
305 "----"
|
|
306 ("%_Abbrev"
|
|
307 ["D%_ynamic Abbrev Expand" dabbrev-expand]
|
|
308 ["Dynamic Abbrev %_Complete" dabbrev-completion]
|
|
309 ["Dynamic Abbrev Complete in %_All Buffers" (dabbrev-completion 16)]
|
|
310 "----"
|
|
311 "----"
|
|
312 ["%_Define Global Abbrev for " add-global-abbrev
|
|
313 :suffix (abbrev-string-to-be-defined nil)
|
|
314 :active abbrev-mode]
|
|
315 ["Define %_Mode-Specific Abbrev for " add-mode-abbrev
|
|
316 :suffix (abbrev-string-to-be-defined nil)
|
|
317 :active abbrev-mode]
|
|
318 ["Define Global Ex%_pansion for " inverse-add-global-abbrev
|
|
319 :suffix (inverse-abbrev-string-to-be-defined 1)
|
|
320 :active abbrev-mode]
|
|
321 ["Define Mode-Specific Expa%_nsion for " inverse-add-mode-abbrev
|
|
322 :suffix (inverse-abbrev-string-to-be-defined 1)
|
|
323 :active abbrev-mode]
|
|
324 "---"
|
|
325 ["E%_xpand Abbrev" expand-abbrev]
|
|
326 ["Expand Abbrevs in Re%_gion" expand-region-abbrevs
|
|
327 :active (region-exists-p)]
|
|
328 ["%_Unexpand Last Abbrev" unexpand-abbrev
|
|
329 :active (and (stringp last-abbrev-text)
|
|
330 (> last-abbrev-location 0))]
|
|
331 "---"
|
|
332 ["%_Kill All Abbrevs" kill-all-abbrevs]
|
|
333 ["%_Insert All Abbrevs into Buffer" insert-abbrevs]
|
|
334 ["%_List Abbrevs" list-abbrevs]
|
|
335 "---"
|
|
336 ["%_Edit Abbrevs" edit-abbrevs]
|
|
337 ["%_Redefine Abbrevs from Buffer" edit-abbrevs-redefine
|
|
338 :active (eq major-mode 'edit-abbrevs-mode)]
|
|
339 "---"
|
|
340 ["%_Save Abbrevs As..." write-abbrev-file]
|
|
341 ["L%_oad Abbrevs..." read-abbrev-file]
|
|
342 )
|
502
|
343 ("%_Rectangles"
|
442
|
344 ["%_Kill Rectangle" kill-rectangle]
|
|
345 ["%_Yank Rectangle" yank-rectangle]
|
|
346 ["Rectangle %_to Register" copy-rectangle-to-register]
|
|
347 ["Rectangle %_from Register" insert-register]
|
|
348 ["%_Clear Rectangle" clear-rectangle]
|
|
349 ["%_Open Rectangle" open-rectangle]
|
|
350 ["%_Prefix Rectangle..." string-rectangle]
|
|
351 ["Rectangle %_Mousing"
|
|
352 (customize-set-variable 'mouse-track-rectangle-p
|
|
353 (not mouse-track-rectangle-p))
|
|
354 :style toggle :selected mouse-track-rectangle-p]
|
|
355 )
|
502
|
356 ("Re%_gister"
|
|
357 ["%_Copy to Register..." copy-to-register :active (region-exists-p)]
|
|
358 ["%_Paste Register..." insert-register]
|
|
359 "---"
|
|
360 ["%_Save Point to Register" point-to-register]
|
|
361 ["%_Jump to Register" register-to-point]
|
|
362 )
|
442
|
363 ("%_Sort"
|
|
364 ["%_Lines in Region" sort-lines :active (region-exists-p)]
|
|
365 ["%_Paragraphs in Region" sort-paragraphs :active (region-exists-p)]
|
|
366 ["P%_ages in Region" sort-pages :active (region-exists-p)]
|
|
367 ["%_Columns in Region" sort-columns :active (region-exists-p)]
|
|
368 ["%_Regexp..." sort-regexp-fields :active (region-exists-p)]
|
|
369 )
|
|
370 ("%_Change Case"
|
|
371 ["%_Upcase Region" upcase-region :active (region-exists-p)]
|
|
372 ["%_Downcase Region" downcase-region :active (region-exists-p)]
|
|
373 ["%_Capitalize Region" capitalize-region :active (region-exists-p)]
|
|
374 ["%_Title-Case Region" capitalize-region-as-title
|
|
375 :active (region-exists-p)]
|
|
376 )
|
|
377 ("Ce%_nter"
|
|
378 ["%_Line" center-line]
|
|
379 ["%_Paragraph" center-paragraph]
|
|
380 ["%_Region" center-region :active (region-exists-p)]
|
|
381 )
|
|
382 ("%_Indent"
|
|
383 ["%_As Previous Line" indent-relative]
|
|
384 ["%_To Column..." indent-to-column]
|
|
385 "---"
|
|
386 ["%_Region" indent-region :active (region-exists-p)]
|
|
387 ["%_Balanced Expression" indent-sexp]
|
|
388 ["%_C Expression" indent-c-exp]
|
|
389 )
|
502
|
390 ("%_Tabs"
|
|
391 ["%_Convert Tabs to Spaces" untabify :active (and (region-exists-p)
|
|
392 (fboundp 'untabify))]
|
|
393 ["Convert %_Spaces to Tabs" tabify :active (and (region-exists-p)
|
|
394 (fboundp 'tabify))]
|
|
395 "---"
|
|
396 ["%_Tab to Tab Stop" tab-to-tab-stop]
|
|
397 ["%_Move to Tab Stop" move-to-tab-stop]
|
|
398 ["%_Edit Tab Stops" edit-tab-stops]
|
|
399 )
|
442
|
400 ("S%_pell-Check"
|
|
401 ["%_Buffer" ispell-buffer
|
|
402 :active (fboundp 'ispell-buffer)]
|
|
403 "---"
|
|
404 ["%_Word" ispell-word]
|
|
405 ["%_Complete Word" ispell-complete-word]
|
|
406 ["%_Region" ispell-region]
|
|
407 )
|
|
408 )
|
428
|
409
|
442
|
410 ("%_Tools"
|
|
411 ("%_Packages"
|
|
412 ("%_Add Download Site"
|
428
|
413 :filter (lambda (&rest junk)
|
442
|
414 (submenu-generate-accelerator-spec
|
|
415 (package-get-download-menu))))
|
|
416 ["%_Update Package Index" package-get-update-base]
|
|
417 ["%_List and Install" pui-list-packages]
|
|
418 ["U%_pdate Installed Packages" package-get-update-all]
|
440
|
419 ;; hack-o-matic, we can't force a load of package-base here
|
428
|
420 ;; since it triggers dialog box interactions which we can't
|
440
|
421 ;; deal with while using a menu
|
454
|
422 ("Using %_Custom"
|
428
|
423 :filter (lambda (&rest junk)
|
|
424 (if package-get-base
|
442
|
425 (submenu-generate-accelerator-spec
|
|
426 (cdr (custom-menu-create 'packages)))
|
|
427 '("Please load Package Index"))))
|
454
|
428
|
442
|
429 ["%_Help" (Info-goto-node "(xemacs)Packages")])
|
|
430 ("%_Internet"
|
|
431 ["Read Mail %_1 (VM)..." vm
|
|
432 :active (fboundp 'vm)]
|
|
433 ["Read Mail %_2 (MH)..." (mh-rmail t)
|
|
434 :active (fboundp 'mh-rmail)]
|
|
435 ["Send %_Mail..." compose-mail
|
|
436 :active (fboundp 'compose-mail)]
|
|
437 ["Usenet %_News" gnus
|
|
438 :active (fboundp 'gnus)]
|
|
439 ["Browse the %_Web" w3
|
|
440 :active (fboundp 'w3)])
|
|
441 "---"
|
|
442 ("%_Grep"
|
|
443 :filter
|
|
444 (lambda (menu)
|
|
445 (if (or (not (boundp 'grep-history)) (null grep-history))
|
|
446 menu
|
|
447 (let ((items
|
|
448 (submenu-generate-accelerator-spec
|
|
449 (mapcar #'(lambda (string)
|
|
450 (vector string
|
|
451 (list 'grep string)))
|
464
|
452 (Menubar-items-truncate-list grep-history 10)))))
|
442
|
453 (append menu '("---") items))))
|
|
454 ["%_Grep..." grep :active (fboundp 'grep)]
|
|
455 ["%_Kill Grep" kill-compilation
|
|
456 :active (and (fboundp 'kill-compilation)
|
|
457 (fboundp 'compilation-find-buffer)
|
|
458 (let ((buffer (condition-case nil
|
|
459 (compilation-find-buffer)
|
|
460 (error nil))))
|
|
461 (and buffer (get-buffer-process buffer))))]
|
|
462 "---"
|
|
463 ["Grep %_All Files in Current Directory..."
|
|
464 (progn
|
|
465 (require 'compile)
|
|
466 (let ((grep-command
|
|
467 (cons (concat grep-command " *")
|
|
468 (length grep-command))))
|
|
469 (call-interactively 'grep)))
|
|
470 :active (fboundp 'grep)]
|
|
471 ["Grep %_C and C Header Files in Current Directory..."
|
|
472 (progn
|
|
473 (require 'compile)
|
|
474 (let ((grep-command
|
|
475 (cons (concat grep-command " *.[chCH]"
|
|
476 ; i wanted to also use *.cc and *.hh.
|
|
477 ; see long comment below under Perl.
|
|
478 )
|
|
479 (length grep-command))))
|
|
480 (call-interactively 'grep)))
|
|
481 :active (fboundp 'grep)]
|
|
482 ["Grep C Hea%_der Files in Current Directory..."
|
|
483 (progn
|
|
484 (require 'compile)
|
|
485 (let ((grep-command
|
|
486 (cons (concat grep-command " *.[hH]"
|
|
487 ; i wanted to also use *.hh.
|
|
488 ; see long comment below under Perl.
|
|
489 )
|
|
490 (length grep-command))))
|
|
491 (call-interactively 'grep)))
|
|
492 :active (fboundp 'grep)]
|
|
493 ["Grep %_E-Lisp Files in Current Directory..."
|
|
494 (progn
|
|
495 (require 'compile)
|
|
496 (let ((grep-command
|
|
497 (cons (concat grep-command " *.el")
|
|
498 (length grep-command))))
|
|
499 (call-interactively 'grep)))
|
|
500 :active (fboundp 'grep)]
|
|
501 ["Grep %_Perl Files in Current Directory..."
|
|
502 (progn
|
|
503 (require 'compile)
|
|
504 (let ((grep-command
|
|
505 (cons (concat grep-command " *.pl"
|
|
506 ; i wanted to use this:
|
|
507 ; " *.pl *.pm *.am"
|
|
508 ; but grep complains if it can't
|
|
509 ; match anything in a glob, and
|
|
510 ; that screws other things up.
|
|
511 ; perhaps we need to first scan
|
|
512 ; each separate glob in the directory
|
|
513 ; to see if there are any files in
|
|
514 ; that glob, and if not, omit it.
|
|
515 )
|
|
516 (length grep-command))))
|
|
517 (call-interactively 'grep)))
|
|
518 :active (fboundp 'grep)]
|
|
519 ["Grep %_HTML Files in Current Directory..."
|
|
520 (progn
|
|
521 (require 'compile)
|
|
522 (let ((grep-command
|
|
523 (cons (concat grep-command " *.*htm*")
|
|
524 (length grep-command))))
|
|
525 (call-interactively 'grep)))
|
|
526 :active (fboundp 'grep)]
|
|
527 "---"
|
|
528 ["%_Next Match" next-error
|
|
529 :active (and (fboundp 'compilation-errors-exist-p)
|
|
530 (compilation-errors-exist-p))]
|
|
531 ["Pre%_vious Match" previous-error
|
|
532 :active (and (fboundp 'compilation-errors-exist-p)
|
|
533 (compilation-errors-exist-p))]
|
|
534 ["%_First Match" first-error
|
|
535 :active (and (fboundp 'compilation-errors-exist-p)
|
|
536 (compilation-errors-exist-p))]
|
|
537 ["G%_oto Match" compile-goto-error
|
|
538 :active (and (fboundp 'compilation-errors-exist-p)
|
|
539 (compilation-errors-exist-p))]
|
|
540 "---"
|
|
541 ["%_Set Grep Command..."
|
|
542 (progn
|
|
543 (require 'compile)
|
|
544 (customize-set-variable
|
|
545 'grep-command
|
|
546 (read-shell-command "Default Grep Command: " grep-command)))
|
|
547 :active (fboundp 'grep)
|
|
548 ]
|
|
549 )
|
|
550 ("%_Compile"
|
|
551 :filter
|
|
552 (lambda (menu)
|
|
553 (if (or (not (boundp 'compile-history)) (null compile-history))
|
|
554 menu
|
|
555 (let ((items
|
|
556 (submenu-generate-accelerator-spec
|
|
557 (mapcar #'(lambda (string)
|
|
558 (vector string
|
|
559 (list 'compile string)))
|
464
|
560 (Menubar-items-truncate-list compile-history 10)))))
|
442
|
561 (append menu '("---") items))))
|
|
562 ["%_Compile..." compile :active (fboundp 'compile)]
|
|
563 ["%_Repeat Compilation" recompile :active (fboundp 'recompile)]
|
|
564 ["%_Kill Compilation" kill-compilation
|
|
565 :active (and (fboundp 'kill-compilation)
|
|
566 (fboundp 'compilation-find-buffer)
|
|
567 (let ((buffer (condition-case nil
|
|
568 (compilation-find-buffer)
|
|
569 (error nil))))
|
|
570 (and buffer (get-buffer-process buffer))))]
|
|
571 "---"
|
|
572 ["%_Next Error" next-error
|
|
573 :active (and (fboundp 'compilation-errors-exist-p)
|
|
574 (compilation-errors-exist-p))]
|
|
575 ["Pre%_vious Error" previous-error
|
|
576 :active (and (fboundp 'compilation-errors-exist-p)
|
|
577 (compilation-errors-exist-p))]
|
|
578 ["%_First Error" first-error
|
|
579 :active (and (fboundp 'compilation-errors-exist-p)
|
|
580 (compilation-errors-exist-p))]
|
|
581 ["G%_oto Error" compile-goto-error
|
|
582 :active (and (fboundp 'compilation-errors-exist-p)
|
|
583 (compilation-errors-exist-p))]
|
|
584 )
|
|
585 ("%_Debug"
|
|
586 ["%_GDB..." gdb
|
|
587 :active (fboundp 'gdb)]
|
|
588 ["%_DBX..." dbx
|
|
589 :active (fboundp 'dbx)])
|
|
590 ("%_Shell"
|
|
591 ["%_Shell" shell
|
|
592 :active (fboundp 'shell)]
|
|
593 ["S%_hell Command..." shell-command
|
|
594 :active (fboundp 'shell-command)]
|
|
595 ["Shell Command on %_Region..." shell-command-on-region
|
|
596 :active (and (fboundp 'shell-command-on-region) (region-exists-p))])
|
428
|
597
|
442
|
598 ("%_Tags"
|
|
599 ["%_Find Tag..." find-tag]
|
|
600 ["Find %_Other Window..." find-tag-other-window]
|
|
601 ["%_Next Tag..." (find-tag nil)]
|
|
602 ["N%_ext Other Window..." (find-tag-other-window nil)]
|
|
603 ["Next %_File" next-file]
|
|
604 "-----"
|
|
605 ["Tags %_Search..." tags-search]
|
|
606 ["Tags %_Replace..." tags-query-replace]
|
|
607 ["%_Continue Search/Replace" tags-loop-continue]
|
|
608 "-----"
|
|
609 ["%_Pop stack" pop-tag-mark]
|
|
610 ["%_Apropos..." tags-apropos]
|
|
611 "-----"
|
|
612 ["%_Set Tags Table File..." visit-tags-table]
|
|
613 )
|
|
614
|
|
615 "----"
|
|
616
|
|
617 ("Ca%_lendar"
|
|
618 ["%_3-Month Calendar" calendar
|
|
619 :active (fboundp 'calendar)]
|
|
620 ["%_Diary" diary
|
|
621 :active (fboundp 'diary)]
|
|
622 ["%_Holidays" holidays
|
|
623 :active (fboundp 'holidays)]
|
|
624 ;; we're all pagans at heart ...
|
|
625 ["%_Phases of the Moon" phases-of-moon
|
|
626 :active (fboundp 'phases-of-moon)]
|
|
627 ["%_Sunrise/Sunset" sunrise-sunset
|
|
628 :active (fboundp 'sunrise-sunset)])
|
428
|
629
|
442
|
630 ("Ga%_mes"
|
|
631 ["%_Mine Game" xmine
|
|
632 :active (fboundp 'xmine)]
|
|
633 ["%_Tetris" tetris
|
|
634 :active (fboundp 'tetris)]
|
|
635 ["%_Sokoban" sokoban
|
|
636 :active (fboundp 'sokoban)]
|
|
637 ["Quote from %_Zippy" yow
|
|
638 :active (fboundp 'yow)]
|
|
639 ["%_Psychoanalyst" doctor
|
|
640 :active (fboundp 'doctor)]
|
|
641 ["Ps%_ychoanalyze Zippy!" psychoanalyze-pinhead
|
|
642 :active (fboundp 'psychoanalyze-pinhead)]
|
|
643 ["%_Random Flames" flame
|
|
644 :active (fboundp 'flame)]
|
|
645 ["%_Dunnet (Adventure)" dunnet
|
|
646 :active (fboundp 'dunnet)]
|
|
647 ["Towers of %_Hanoi" hanoi
|
|
648 :active (fboundp 'hanoi)]
|
|
649 ["Game of %_Life" life
|
|
650 :active (fboundp 'life)]
|
|
651 ["M%_ultiplication Puzzle" mpuz
|
|
652 :active (fboundp 'mpuz)])
|
|
653
|
|
654 "----"
|
|
655 )
|
|
656
|
|
657 ("%_Options"
|
|
658 ("%_Advanced (Customize)"
|
|
659 ("%_Emacs" :filter (lambda (&rest junk)
|
|
660 (cdr (custom-menu-create 'emacs))))
|
|
661 ["%_Group..." customize-group]
|
|
662 ["%_Variable..." customize-variable]
|
|
663 ["%_Face..." customize-face]
|
|
664 ["%_Saved..." customize-saved]
|
|
665 ["Se%_t..." customize-customized]
|
|
666 ["%_Apropos..." customize-apropos]
|
|
667 ["%_Browse..." customize-browse])
|
|
668 "---"
|
|
669 ("%_Editing"
|
|
670 ["This Buffer %_Read Only" (toggle-read-only)
|
|
671 :style toggle :selected buffer-read-only]
|
|
672 ["%_Yank/Kill Interact With Clipboard"
|
|
673 (if (eq interprogram-cut-function 'own-clipboard)
|
|
674 (progn
|
|
675 (customize-set-variable 'interprogram-cut-function nil)
|
|
676 (customize-set-variable 'interprogram-paste-function nil))
|
|
677 (customize-set-variable 'interprogram-cut-function 'own-clipboard)
|
|
678 (customize-set-variable 'interprogram-paste-function 'get-clipboard))
|
|
679 :style toggle
|
|
680 :selected (eq interprogram-cut-function 'own-clipboard)]
|
|
681 ["%_Overstrike"
|
428
|
682 (progn
|
|
683 (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual))
|
|
684 (customize-set-variable 'overwrite-mode overwrite-mode))
|
|
685 :style toggle :selected overwrite-mode]
|
442
|
686 ["%_Abbrev Mode"
|
|
687 (customize-set-variable 'abbrev-mode
|
|
688 (not (default-value 'abbrev-mode)))
|
|
689 :style toggle
|
|
690 :selected (default-value 'abbrev-mode)]
|
|
691 ["Active Re%_gions"
|
|
692 (customize-set-variable 'zmacs-regions (not zmacs-regions))
|
|
693 :style toggle :selected zmacs-regions]
|
|
694 "---"
|
|
695 ["%_Case Sensitive Search"
|
428
|
696 (customize-set-variable 'case-fold-search
|
|
697 (setq case-fold-search (not case-fold-search)))
|
|
698 :style toggle :selected (not case-fold-search)]
|
442
|
699 ["Case %_Matching Replace"
|
428
|
700 (customize-set-variable 'case-replace (not case-replace))
|
|
701 :style toggle :selected case-replace]
|
442
|
702 "---"
|
|
703 ("%_Newline at End of File..."
|
|
704 ["%_Don't Require"
|
|
705 (customize-set-variable 'require-final-newline nil)
|
|
706 :style radio :selected (not require-final-newline)]
|
|
707 ["%_Require"
|
|
708 (customize-set-variable 'require-final-newline t)
|
|
709 :style radio :selected (eq require-final-newline t)]
|
|
710 ["%_Ask"
|
|
711 (customize-set-variable 'require-final-newline 'ask)
|
|
712 :style radio :selected (and require-final-newline
|
|
713 (not (eq require-final-newline t)))])
|
|
714 ["Add Newline When Moving Past %_End"
|
|
715 (customize-set-variable 'next-line-add-newlines
|
|
716 (not next-line-add-newlines))
|
|
717 :style toggle :selected next-line-add-newlines])
|
|
718 ("%_Keyboard and Mouse"
|
|
719 ["%_Delete Key Deletes Selection"
|
428
|
720 (customize-set-variable 'pending-delete-mode (not pending-delete-mode))
|
|
721 :style toggle
|
|
722 :selected (and (boundp 'pending-delete-mode) pending-delete-mode)
|
|
723 :active (boundp 'pending-delete-mode)]
|
462
|
724 ["`%_kill-line' Kills Whole Line at %_Beg"
|
|
725 (customize-set-variable 'kill-whole-line (not kill-whole-line))
|
|
726 :style toggle
|
|
727 :selected kill-whole-line]
|
442
|
728 ["Size for %_Block-Movement Commands..."
|
|
729 (customize-set-variable 'block-movement-size
|
|
730 (read-number "Block Movement Size: "
|
|
731 t block-movement-size))]
|
|
732 ["%_VI Emulation"
|
|
733 (progn
|
|
734 (toggle-viper-mode)
|
|
735 (customize-set-variable 'viper-mode viper-mode))
|
|
736 :style toggle :selected (and (boundp 'viper-mode) viper-mode)
|
|
737 :active (fboundp 'toggle-viper-mode)]
|
|
738 "----"
|
462
|
739 ["S%_hifted Motion Keys Select Region"
|
|
740 (customize-set-variable 'shifted-motion-keys-select-region
|
|
741 (not shifted-motion-keys-select-region))
|
|
742 :style toggle
|
|
743 :selected shifted-motion-keys-select-region]
|
|
744 ["%_After Shifted Motion, Unshifted Motion Keys Deselect"
|
|
745 (customize-set-variable 'unshifted-motion-keys-deselect-region
|
|
746 (not unshifted-motion-keys-deselect-region))
|
|
747 :style toggle
|
|
748 :selected unshifted-motion-keys-deselect-region]
|
|
749 "----"
|
442
|
750 ["%_Set Key..." global-set-key]
|
|
751 ["%_Unset Key..." global-unset-key]
|
|
752 "---"
|
|
753 ["%_Mouse Paste at Text Cursor (not Clicked Location)"
|
428
|
754 (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point))
|
|
755 :style toggle :selected mouse-yank-at-point]
|
442
|
756 "---"
|
|
757 ["%_Teach Extended Commands"
|
428
|
758 (customize-set-variable 'teach-extended-commands-p
|
|
759 (not teach-extended-commands-p))
|
|
760 :style toggle :selected teach-extended-commands-p]
|
|
761 )
|
442
|
762 ("%_Printing"
|
|
763 ["Set Printer %_Name for Generic Print Support..."
|
|
764 (customize-set-variable
|
|
765 'printer-name
|
|
766 (read-string "Set printer name: " printer-name))]
|
|
767 "---"
|
|
768 ["Command-Line %_Switches for `lpr'/`lp'..."
|
428
|
769 ;; better to directly open a customization buffer, since the value
|
|
770 ;; must be a list of strings, which is somewhat complex to prompt for.
|
|
771 (customize-variable 'lpr-switches)
|
|
772 (boundp 'lpr-switches)]
|
442
|
773 ("%_Pretty-Print Paper Size"
|
|
774 ["%_Letter"
|
428
|
775 (customize-set-variable 'ps-paper-type 'letter)
|
|
776 :style radio
|
|
777 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter))
|
|
778 :active (boundp 'ps-paper-type)]
|
442
|
779 ["Lette%_r-Small"
|
428
|
780 (customize-set-variable 'ps-paper-type 'letter-small)
|
|
781 :style radio
|
|
782 :selected (and (boundp 'ps-paper-type)
|
|
783 (eq ps-paper-type 'letter-small))
|
|
784 :active (boundp 'ps-paper-type)]
|
442
|
785 ["Le%_gal"
|
428
|
786 (customize-set-variable 'ps-paper-type 'legal)
|
|
787 :style radio
|
|
788 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'legal))
|
|
789 :active (boundp 'ps-paper-type)]
|
442
|
790 ["%_Statement"
|
428
|
791 (customize-set-variable 'ps-paper-type 'statement)
|
|
792 :style radio
|
|
793 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'statement))
|
|
794 :active (boundp 'ps-paper-type)]
|
442
|
795 ["%_Executive"
|
428
|
796 (customize-set-variable 'ps-paper-type 'executive)
|
|
797 :style radio
|
|
798 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'executive))
|
|
799 :active (boundp 'ps-paper-type)]
|
442
|
800 ["%_Tabloid"
|
428
|
801 (customize-set-variable 'ps-paper-type 'tabloid)
|
|
802 :style radio
|
|
803 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'tabloid))
|
|
804 :active (boundp 'ps-paper-type)]
|
442
|
805 ["Le%_dger"
|
428
|
806 (customize-set-variable 'ps-paper-type 'ledger)
|
|
807 :style radio
|
|
808 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'ledger))
|
|
809 :active (boundp 'ps-paper-type)]
|
442
|
810 ["A%_3"
|
428
|
811 (customize-set-variable 'ps-paper-type 'a3)
|
|
812 :style radio
|
|
813 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a3))
|
|
814 :active (boundp 'ps-paper-type)]
|
442
|
815 ["%_A4"
|
428
|
816 (customize-set-variable 'ps-paper-type 'a4)
|
|
817 :style radio
|
|
818 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4))
|
|
819 :active (boundp 'ps-paper-type)]
|
442
|
820 ["A4s%_mall"
|
428
|
821 (customize-set-variable 'ps-paper-type 'a4small)
|
|
822 :style radio
|
|
823 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4small))
|
|
824 :active (boundp 'ps-paper-type)]
|
442
|
825 ["B%_4"
|
428
|
826 (customize-set-variable 'ps-paper-type 'b4)
|
|
827 :style radio
|
|
828 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b4))
|
|
829 :active (boundp 'ps-paper-type)]
|
442
|
830 ["%_B5"
|
428
|
831 (customize-set-variable 'ps-paper-type 'b5)
|
|
832 :style radio
|
|
833 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b5))
|
|
834 :active (boundp 'ps-paper-type)]
|
|
835 )
|
442
|
836 ["%_Color Printing"
|
428
|
837 (cond (ps-print-color-p
|
|
838 (customize-set-variable 'ps-print-color-p nil)
|
440
|
839 ;; I'm wondering whether all this muck is useful.
|
428
|
840 (and (boundp 'original-face-background)
|
|
841 original-face-background
|
|
842 (set-face-background 'default original-face-background)))
|
|
843 (t
|
|
844 (customize-set-variable 'ps-print-color-p t)
|
|
845 (setq original-face-background
|
|
846 (face-background-instance 'default))
|
|
847 (set-face-background 'default "white")))
|
|
848 :style toggle
|
|
849 :selected (and (boundp 'ps-print-color-p) ps-print-color-p)
|
|
850 :active (boundp 'ps-print-color-p)])
|
442
|
851 ("%_Internet"
|
|
852 ("%_Compose Mail With"
|
|
853 ["Default Emacs Mailer"
|
|
854 (customize-set-variable 'mail-user-agent 'sendmail-user-agent)
|
|
855 :style radio
|
|
856 :selected (eq mail-user-agent 'sendmail-user-agent)]
|
|
857 ["MH"
|
|
858 (customize-set-variable 'mail-user-agent 'mh-e-user-agent)
|
|
859 :style radio
|
|
860 :selected (eq mail-user-agent 'mh-e-user-agent)
|
|
861 :active (get 'mh-e-user-agent 'composefunc)]
|
|
862 ["GNUS"
|
|
863 (customize-set-variable 'mail-user-agent 'message-user-agent)
|
|
864 :style radio
|
|
865 :selected (eq mail-user-agent 'message-user-agent)
|
|
866 :active (get 'message-user-agent 'composefunc)]
|
|
867 )
|
|
868 ["Set My %_Email Address..."
|
|
869 (customize-set-variable
|
|
870 'user-mail-address
|
|
871 (read-string "Set email address: " user-mail-address))]
|
|
872 ["Set %_Machine Email Name..."
|
428
|
873 (customize-set-variable
|
442
|
874 'mail-host-address
|
|
875 (read-string "Set machine email name: " mail-host-address))]
|
|
876 ["Set %_SMTP Server..."
|
|
877 (progn
|
|
878 (require 'smtpmail)
|
|
879 (customize-set-variable
|
|
880 'smtpmail-smtp-server
|
|
881 (read-string "Set SMTP server: " smtpmail-smtp-server)))
|
|
882 :active (and (boundp 'send-mail-function)
|
|
883 (eq send-mail-function 'smtpmail-send-it))]
|
|
884 ["SMTP %_Debug Info"
|
|
885 (progn
|
|
886 (require 'smtpmail)
|
|
887 (customize-set-variable 'smtpmail-debug-info
|
|
888 (not smtpmail-debug-info)))
|
428
|
889 :style toggle
|
442
|
890 :selected (and (boundp 'smtpmail-debug-info) smtpmail-debug-info)
|
|
891 :active (and (boundp 'send-mail-function)
|
|
892 (eq send-mail-function 'smtpmail-send-it))]
|
|
893 "---"
|
|
894 ("%_Open URLs With"
|
|
895 ["%_Emacs-W3"
|
|
896 (customize-set-variable 'browse-url-browser-function 'browse-url-w3)
|
|
897 :style radio
|
|
898 :selected (and (boundp 'browse-url-browser-function)
|
|
899 (eq browse-url-browser-function 'browse-url-w3))
|
|
900 :active (and (boundp 'browse-url-browser-function)
|
|
901 (fboundp 'browse-url-w3)
|
|
902 (fboundp 'w3-fetch))]
|
|
903 ["%_Netscape"
|
|
904 (customize-set-variable 'browse-url-browser-function
|
|
905 'browse-url-netscape)
|
|
906 :style radio
|
|
907 :selected (and (boundp 'browse-url-browser-function)
|
|
908 (eq browse-url-browser-function 'browse-url-netscape))
|
|
909 :active (and (boundp 'browse-url-browser-function)
|
|
910 (fboundp 'browse-url-netscape))]
|
|
911 ["%_Mosaic"
|
|
912 (customize-set-variable 'browse-url-browser-function
|
|
913 'browse-url-mosaic)
|
|
914 :style radio
|
|
915 :selected (and (boundp 'browse-url-browser-function)
|
|
916 (eq browse-url-browser-function 'browse-url-mosaic))
|
|
917 :active (and (boundp 'browse-url-browser-function)
|
|
918 (fboundp 'browse-url-mosaic))]
|
|
919 ["Mosaic (%_CCI)"
|
|
920 (customize-set-variable 'browse-url-browser-function 'browse-url-cci)
|
|
921 :style radio
|
|
922 :selected (and (boundp 'browse-url-browser-function)
|
|
923 (eq browse-url-browser-function 'browse-url-cci))
|
|
924 :active (and (boundp 'browse-url-browser-function)
|
|
925 (fboundp 'browse-url-cci))]
|
|
926 ["%_IXI Mosaic"
|
|
927 (customize-set-variable 'browse-url-browser-function
|
|
928 'browse-url-iximosaic)
|
|
929 :style radio
|
|
930 :selected (and (boundp 'browse-url-browser-function)
|
|
931 (eq browse-url-browser-function 'browse-url-iximosaic))
|
|
932 :active (and (boundp 'browse-url-browser-function)
|
|
933 (fboundp 'browse-url-iximosaic))]
|
|
934 ["%_Lynx (xterm)"
|
|
935 (customize-set-variable 'browse-url-browser-function
|
|
936 'browse-url-lynx-xterm)
|
|
937 :style radio
|
|
938 :selected (and (boundp 'browse-url-browser-function)
|
|
939 (eq browse-url-browser-function 'browse-url-lynx-xterm))
|
|
940 :active (and (boundp 'browse-url-browser-function)
|
|
941 (fboundp 'browse-url-lynx-xterm))]
|
|
942 ["L%_ynx (xemacs)"
|
|
943 (customize-set-variable 'browse-url-browser-function
|
|
944 'browse-url-lynx-emacs)
|
|
945 :style radio
|
|
946 :selected (and (boundp 'browse-url-browser-function)
|
|
947 (eq browse-url-browser-function 'browse-url-lynx-emacs))
|
|
948 :active (and (boundp 'browse-url-browser-function)
|
|
949 (fboundp 'browse-url-lynx-emacs))]
|
|
950 ["%_Grail"
|
|
951 (customize-set-variable 'browse-url-browser-function
|
|
952 'browse-url-grail)
|
|
953 :style radio
|
|
954 :selected (and (boundp 'browse-url-browser-function)
|
|
955 (eq browse-url-browser-function 'browse-url-grail))
|
|
956 :active (and (boundp 'browse-url-browser-function)
|
|
957 (fboundp 'browse-url-grail))]
|
454
|
958 ["%_Kfm"
|
442
|
959 (customize-set-variable 'browse-url-browser-function
|
|
960 'browse-url-kfm)
|
|
961 :style radio
|
|
962 :selected (and (boundp 'browse-url-browser-function)
|
|
963 (eq browse-url-browser-function 'browse-url-kfm))
|
|
964 :active (and (boundp 'browse-url-browser-function)
|
|
965 (fboundp 'browse-url-kfm))]
|
454
|
966 ))
|
442
|
967 ("%_Troubleshooting"
|
|
968 ["%_Debug on Error"
|
|
969 (customize-set-variable 'debug-on-error (not debug-on-error))
|
|
970 :style toggle :selected debug-on-error]
|
|
971 ["Debug on %_Quit"
|
|
972 (customize-set-variable 'debug-on-quit (not debug-on-quit))
|
|
973 :style toggle :selected debug-on-quit]
|
|
974 ["Debug on S%_ignal"
|
|
975 (customize-set-variable 'debug-on-signal (not debug-on-signal))
|
|
976 :style toggle :selected debug-on-signal]
|
|
977 ["%_Stack Trace on Error"
|
|
978 (customize-set-variable 'stack-trace-on-error
|
|
979 (not stack-trace-on-error))
|
|
980 :style toggle :selected stack-trace-on-error]
|
|
981 ["Stack Trace on Si%_gnal"
|
|
982 (customize-set-variable 'stack-trace-on-signal
|
|
983 (not stack-trace-on-signal))
|
|
984 :style toggle :selected stack-trace-on-signal]
|
428
|
985 )
|
|
986 "-----"
|
442
|
987 ("%_Display"
|
|
988 ,@(if (featurep 'scrollbar)
|
|
989 '(["%_Scrollbars"
|
|
990 (customize-set-variable 'scrollbars-visible-p
|
|
991 (not scrollbars-visible-p))
|
|
992 :style toggle
|
|
993 :selected scrollbars-visible-p]))
|
|
994 ["%_Wrap Long Lines"
|
|
995 (progn;; becomes buffer-local
|
|
996 (setq truncate-lines (not truncate-lines))
|
|
997 (customize-set-variable 'truncate-lines truncate-lines))
|
|
998 :style toggle
|
|
999 :selected (not truncate-lines)]
|
454
|
1000 "----"
|
|
1001 ["%_3D Modeline"
|
|
1002 (customize-set-variable 'modeline-3d-p
|
|
1003 (not modeline-3d-p))
|
|
1004 :style toggle
|
|
1005 :selected modeline-3d-p]
|
|
1006 ("Modeline %_Horizontal Scrolling"
|
|
1007 ["%_None"
|
|
1008 (customize-set-variable 'modeline-scrolling-method nil)
|
|
1009 :style radio
|
|
1010 :selected (not modeline-scrolling-method)]
|
|
1011 ["As %_Text"
|
|
1012 (customize-set-variable 'modeline-scrolling-method t)
|
|
1013 :style radio
|
|
1014 :selected (eq modeline-scrolling-method t)]
|
|
1015 ["As %_Scrollbar"
|
|
1016 (customize-set-variable 'modeline-scrolling-method 'scrollbar)
|
|
1017 :style radio
|
|
1018 :selected (eq modeline-scrolling-method 'scrollbar)]
|
|
1019 )
|
442
|
1020 ,@(if (featurep 'toolbar)
|
|
1021 '("---"
|
|
1022 ["%_Toolbars Visible"
|
|
1023 (customize-set-variable 'toolbar-visible-p
|
|
1024 (not toolbar-visible-p))
|
|
1025 :style toggle
|
|
1026 :selected toolbar-visible-p]
|
|
1027 ["Toolbars Ca%_ptioned"
|
|
1028 (customize-set-variable 'toolbar-captioned-p
|
|
1029 (not toolbar-captioned-p))
|
|
1030 :style toggle
|
|
1031 :active toolbar-visible-p
|
|
1032 :selected toolbar-captioned-p]
|
|
1033 ("Default Toolba%_r Location"
|
|
1034 ["%_Top"
|
|
1035 (customize-set-variable 'default-toolbar-position 'top)
|
|
1036 :style radio
|
|
1037 :active toolbar-visible-p
|
|
1038 :selected (eq default-toolbar-position 'top)]
|
|
1039 ["%_Bottom"
|
|
1040 (customize-set-variable 'default-toolbar-position 'bottom)
|
|
1041 :style radio
|
|
1042 :active toolbar-visible-p
|
|
1043 :selected (eq default-toolbar-position 'bottom)]
|
|
1044 ["%_Left"
|
|
1045 (customize-set-variable 'default-toolbar-position 'left)
|
|
1046 :style radio
|
|
1047 :active toolbar-visible-p
|
|
1048 :selected (eq default-toolbar-position 'left)]
|
|
1049 ["%_Right"
|
|
1050 (customize-set-variable 'default-toolbar-position 'right)
|
|
1051 :style radio
|
|
1052 :active toolbar-visible-p
|
|
1053 :selected (eq default-toolbar-position 'right)]
|
|
1054 )
|
|
1055 ))
|
|
1056 ,@(if (featurep 'gutter)
|
|
1057 '("---"
|
|
1058 ["B%_uffers Tab Visible"
|
|
1059 (customize-set-variable 'gutter-buffers-tab-visible-p
|
|
1060 (not gutter-buffers-tab-visible-p))
|
|
1061 :style toggle
|
|
1062 :selected gutter-buffers-tab-visible-p]
|
|
1063 ("Default %_Gutter Location"
|
|
1064 ["%_Top"
|
|
1065 (customize-set-variable 'default-gutter-position 'top)
|
|
1066 :style radio
|
|
1067 :selected (eq default-gutter-position 'top)]
|
|
1068 ["%_Bottom"
|
|
1069 (customize-set-variable 'default-gutter-position 'bottom)
|
|
1070 :style radio
|
|
1071 :selected (eq default-gutter-position 'bottom)]
|
|
1072 ["%_Left"
|
|
1073 (customize-set-variable 'default-gutter-position 'left)
|
|
1074 :style radio
|
|
1075 :selected (eq default-gutter-position 'left)]
|
|
1076 ["%_Right"
|
|
1077 (customize-set-variable 'default-gutter-position 'right)
|
|
1078 :style radio
|
|
1079 :selected (eq default-gutter-position 'right)]
|
|
1080 )
|
|
1081 ))
|
|
1082 "-----"
|
|
1083 ["%_Blinking Cursor"
|
|
1084 (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode))
|
|
1085 :style toggle
|
|
1086 :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)
|
|
1087 :active (boundp 'blink-cursor-mode)]
|
|
1088 ["Bl%_ock Cursor"
|
|
1089 (progn
|
|
1090 (customize-set-variable 'bar-cursor nil)
|
|
1091 (force-cursor-redisplay))
|
|
1092 :style radio
|
|
1093 :selected (null bar-cursor)]
|
|
1094 ["Bar Cursor (%_1 Pixel)"
|
|
1095 (progn
|
|
1096 (customize-set-variable 'bar-cursor t)
|
|
1097 (force-cursor-redisplay))
|
|
1098 :style radio
|
|
1099 :selected (eq bar-cursor t)]
|
|
1100 ["Bar Cursor (%_2 Pixels)"
|
|
1101 (progn
|
|
1102 (customize-set-variable 'bar-cursor 2)
|
|
1103 (force-cursor-redisplay))
|
|
1104 :style radio
|
|
1105 :selected (and bar-cursor (not (eq bar-cursor t)))]
|
|
1106 "----"
|
|
1107 ("Pa%_ren Highlighting"
|
|
1108 ["%_None"
|
|
1109 (customize-set-variable 'paren-mode nil)
|
|
1110 :style radio
|
|
1111 :selected (and (boundp 'paren-mode) (not paren-mode))
|
|
1112 :active (boundp 'paren-mode)]
|
|
1113 ["%_Blinking Paren"
|
|
1114 (customize-set-variable 'paren-mode 'blink-paren)
|
|
1115 :style radio
|
|
1116 :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren))
|
|
1117 :active (boundp 'paren-mode)]
|
|
1118 ["%_Steady Paren"
|
|
1119 (customize-set-variable 'paren-mode 'paren)
|
|
1120 :style radio
|
|
1121 :selected (and (boundp 'paren-mode) (eq paren-mode 'paren))
|
|
1122 :active (boundp 'paren-mode)]
|
|
1123 ["%_Expression"
|
|
1124 (customize-set-variable 'paren-mode 'sexp)
|
|
1125 :style radio
|
|
1126 :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp))
|
|
1127 :active (boundp 'paren-mode)]
|
|
1128 ;; ["Nes%_ted Shading"
|
|
1129 ;; (customize-set-variable 'paren-mode 'nested)
|
|
1130 ;; :style radio
|
|
1131 ;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested))
|
|
1132 ;; :active (boundp 'paren-mode)]
|
|
1133 )
|
|
1134 "------"
|
|
1135 ["%_Line Numbers"
|
|
1136 (progn
|
|
1137 (customize-set-variable 'line-number-mode (not line-number-mode))
|
|
1138 (redraw-modeline))
|
|
1139 :style toggle :selected line-number-mode]
|
|
1140 ["%_Column Numbers"
|
|
1141 (progn
|
|
1142 (customize-set-variable 'column-number-mode
|
|
1143 (not column-number-mode))
|
|
1144 (redraw-modeline))
|
|
1145 :style toggle :selected column-number-mode]
|
454
|
1146
|
442
|
1147 ("\"Other %_Window\" Location"
|
|
1148 ["%_Always in Same Frame"
|
|
1149 (customize-set-variable
|
|
1150 'get-frame-for-buffer-default-instance-limit nil)
|
|
1151 :style radio
|
|
1152 :selected (null get-frame-for-buffer-default-instance-limit)]
|
|
1153 ["Other Frame (%_2 Frames Max)"
|
|
1154 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
|
|
1155 2)
|
|
1156 :style radio
|
|
1157 :selected (eq 2 get-frame-for-buffer-default-instance-limit)]
|
|
1158 ["Other Frame (%_3 Frames Max)"
|
|
1159 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
|
|
1160 3)
|
|
1161 :style radio
|
|
1162 :selected (eq 3 get-frame-for-buffer-default-instance-limit)]
|
|
1163 ["Other Frame (%_4 Frames Max)"
|
|
1164 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
|
|
1165 4)
|
|
1166 :style radio
|
|
1167 :selected (eq 4 get-frame-for-buffer-default-instance-limit)]
|
|
1168 ["Other Frame (%_5 Frames Max)"
|
|
1169 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
|
|
1170 5)
|
|
1171 :style radio
|
|
1172 :selected (eq 5 get-frame-for-buffer-default-instance-limit)]
|
|
1173 ["Always Create %_New Frame"
|
|
1174 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
|
|
1175 0)
|
|
1176 :style radio
|
|
1177 :selected (eq 0 get-frame-for-buffer-default-instance-limit)]
|
|
1178 "-----"
|
|
1179 ["%_Temp Buffers Always in Same Frame"
|
|
1180 (customize-set-variable 'temp-buffer-show-function
|
|
1181 'show-temp-buffer-in-current-frame)
|
|
1182 :style radio
|
|
1183 :selected (eq temp-buffer-show-function
|
|
1184 'show-temp-buffer-in-current-frame)]
|
|
1185 ["Temp Buffers %_Like Other Buffers"
|
|
1186 (customize-set-variable 'temp-buffer-show-function nil)
|
|
1187 :style radio
|
|
1188 :selected (null temp-buffer-show-function)]
|
|
1189 "-----"
|
|
1190 ["%_Make Current Frame Gnuserv Target"
|
|
1191 (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil
|
|
1192 t))
|
|
1193 :style toggle
|
|
1194 :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t))
|
|
1195 :active (boundp 'gnuserv-frame)]
|
|
1196 )
|
454
|
1197 )
|
442
|
1198 ("%_Menubars"
|
|
1199 ["%_Frame-Local Font Menu"
|
|
1200 (customize-set-variable 'font-menu-this-frame-only-p
|
|
1201 (not font-menu-this-frame-only-p))
|
|
1202 :style toggle
|
|
1203 :selected (and (boundp 'font-menu-this-frame-only-p)
|
|
1204 font-menu-this-frame-only-p)]
|
|
1205 ["%_Alt/Meta Selects Menu Items"
|
|
1206 (if (eq menu-accelerator-enabled 'menu-force)
|
|
1207 (customize-set-variable 'menu-accelerator-enabled nil)
|
|
1208 (customize-set-variable 'menu-accelerator-enabled 'menu-force))
|
|
1209 :style toggle
|
|
1210 :selected (eq menu-accelerator-enabled 'menu-force)]
|
|
1211 "----"
|
|
1212 ["Buffers Menu %_Length..."
|
|
1213 (customize-set-variable
|
|
1214 'buffers-menu-max-size
|
|
1215 ;; would it be better to open a customization buffer ?
|
|
1216 (let ((val
|
|
1217 (read-number
|
|
1218 "Enter number of buffers to display (or 0 for unlimited): ")))
|
|
1219 (if (eq val 0) nil val)))]
|
|
1220 ["%_Multi-Operation Buffers Sub-Menus"
|
|
1221 (customize-set-variable 'complex-buffers-menu-p
|
|
1222 (not complex-buffers-menu-p))
|
|
1223 :style toggle
|
|
1224 :selected complex-buffers-menu-p]
|
|
1225 ["S%_ubmenus for Buffer Groups"
|
|
1226 (customize-set-variable 'buffers-menu-submenus-for-groups-p
|
|
1227 (not buffers-menu-submenus-for-groups-p))
|
|
1228 :style toggle
|
|
1229 :selected buffers-menu-submenus-for-groups-p]
|
|
1230 ["%_Verbose Buffer Menu Entries"
|
|
1231 (if (eq buffers-menu-format-buffer-line-function
|
|
1232 'slow-format-buffers-menu-line)
|
|
1233 (customize-set-variable 'buffers-menu-format-buffer-line-function
|
|
1234 'format-buffers-menu-line)
|
|
1235 (customize-set-variable 'buffers-menu-format-buffer-line-function
|
|
1236 'slow-format-buffers-menu-line))
|
|
1237 :style toggle
|
|
1238 :selected (eq buffers-menu-format-buffer-line-function
|
|
1239 'slow-format-buffers-menu-line)]
|
|
1240 ("Buffers Menu %_Sorting"
|
|
1241 ["%_Most Recently Used"
|
|
1242 (progn
|
|
1243 (customize-set-variable 'buffers-menu-sort-function nil)
|
|
1244 (customize-set-variable 'buffers-menu-grouping-function nil))
|
|
1245 :style radio
|
|
1246 :selected (null buffers-menu-sort-function)]
|
|
1247 ["%_Alphabetically"
|
|
1248 (progn
|
|
1249 (customize-set-variable 'buffers-menu-sort-function
|
|
1250 'sort-buffers-menu-alphabetically)
|
|
1251 (customize-set-variable 'buffers-menu-grouping-function nil))
|
|
1252 :style radio
|
|
1253 :selected (eq 'sort-buffers-menu-alphabetically
|
|
1254 buffers-menu-sort-function)]
|
|
1255 ["%_By Major Mode, Then Alphabetically"
|
|
1256 (progn
|
|
1257 (customize-set-variable
|
|
1258 'buffers-menu-sort-function
|
|
1259 'sort-buffers-menu-by-mode-then-alphabetically)
|
|
1260 (customize-set-variable
|
|
1261 'buffers-menu-grouping-function
|
|
1262 'group-buffers-menu-by-mode-then-alphabetically))
|
|
1263 :style radio
|
|
1264 :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically
|
|
1265 buffers-menu-sort-function)])
|
|
1266 "---"
|
|
1267 ["%_Ignore Scaled Fonts"
|
|
1268 (customize-set-variable 'font-menu-ignore-scaled-fonts
|
|
1269 (not font-menu-ignore-scaled-fonts))
|
|
1270 :style toggle
|
|
1271 :selected (and (boundp 'font-menu-ignore-scaled-fonts)
|
|
1272 font-menu-ignore-scaled-fonts)]
|
|
1273 )
|
|
1274 ("S%_yntax Highlighting"
|
|
1275 ["%_In This Buffer"
|
|
1276 (progn;; becomes buffer local
|
428
|
1277 (font-lock-mode)
|
|
1278 (customize-set-variable 'font-lock-mode font-lock-mode))
|
|
1279 :style toggle
|
|
1280 :selected (and (boundp 'font-lock-mode) font-lock-mode)
|
|
1281 :active (boundp 'font-lock-mode)]
|
442
|
1282 ["%_Automatic"
|
428
|
1283 (customize-set-variable 'font-lock-auto-fontify
|
|
1284 (not font-lock-auto-fontify))
|
|
1285 :style toggle
|
|
1286 :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify)
|
|
1287 :active (fboundp 'font-lock-mode)]
|
|
1288 "-----"
|
442
|
1289 ["Force %_Rehighlight in this Buffer"
|
|
1290 (customize-set-variable 'font-lock-auto-fontify
|
|
1291 (not font-lock-auto-fontify))
|
|
1292 :style toggle
|
|
1293 :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify)
|
|
1294 :active (fboundp 'font-lock-mode)]
|
|
1295 "-----"
|
|
1296 ["%_Fonts"
|
428
|
1297 (progn
|
|
1298 (require 'font-lock)
|
|
1299 (font-lock-use-default-fonts)
|
|
1300 (customize-set-variable 'font-lock-use-fonts t)
|
|
1301 (customize-set-variable 'font-lock-use-colors nil)
|
|
1302 (font-lock-mode 1))
|
|
1303 :style radio
|
|
1304 :selected (and (boundp 'font-lock-use-fonts) font-lock-use-fonts)
|
|
1305 :active (fboundp 'font-lock-mode)]
|
442
|
1306 ["%_Colors"
|
428
|
1307 (progn
|
|
1308 (require 'font-lock)
|
|
1309 (font-lock-use-default-colors)
|
|
1310 (customize-set-variable 'font-lock-use-colors t)
|
|
1311 (customize-set-variable 'font-lock-use-fonts nil)
|
|
1312 (font-lock-mode 1))
|
|
1313 :style radio
|
|
1314 :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors)
|
|
1315 :active (boundp 'font-lock-mode)]
|
|
1316 "-----"
|
442
|
1317 ["%_1 Least"
|
428
|
1318 (progn
|
|
1319 (require 'font-lock)
|
|
1320 (if (or (and (not (integerp font-lock-maximum-decoration))
|
|
1321 (not (eq t font-lock-maximum-decoration)))
|
|
1322 (and (integerp font-lock-maximum-decoration)
|
|
1323 (<= font-lock-maximum-decoration 0)))
|
|
1324 nil
|
|
1325 (customize-set-variable 'font-lock-maximum-decoration nil)
|
|
1326 (font-lock-recompute-variables)))
|
|
1327 :style radio
|
|
1328 :active (fboundp 'font-lock-mode)
|
442
|
1329 :selected (and (boundp 'font-lock-maximum-decoration)
|
428
|
1330 (or (and (not (integerp font-lock-maximum-decoration))
|
|
1331 (not (eq t font-lock-maximum-decoration)))
|
|
1332 (and (integerp font-lock-maximum-decoration)
|
|
1333 (<= font-lock-maximum-decoration 0))))]
|
442
|
1334 ["%_2 More"
|
428
|
1335 (progn
|
|
1336 (require 'font-lock)
|
|
1337 (if (and (integerp font-lock-maximum-decoration)
|
|
1338 (= 1 font-lock-maximum-decoration))
|
|
1339 nil
|
|
1340 (customize-set-variable 'font-lock-maximum-decoration 1)
|
|
1341 (font-lock-recompute-variables)))
|
|
1342 :style radio
|
|
1343 :active (fboundp 'font-lock-mode)
|
442
|
1344 :selected (and (boundp 'font-lock-maximum-decoration)
|
428
|
1345 (integerp font-lock-maximum-decoration)
|
|
1346 (= 1 font-lock-maximum-decoration))]
|
442
|
1347 ["%_3 Even More"
|
428
|
1348 (progn
|
|
1349 (require 'font-lock)
|
|
1350 (if (and (integerp font-lock-maximum-decoration)
|
|
1351 (= 2 font-lock-maximum-decoration))
|
|
1352 nil
|
|
1353 (customize-set-variable 'font-lock-maximum-decoration 2)
|
|
1354 (font-lock-recompute-variables)))
|
|
1355 :style radio
|
|
1356 :active (fboundp 'font-lock-mode)
|
|
1357 :selected (and (boundp 'font-lock-maximum-decoration)
|
|
1358 (integerp font-lock-maximum-decoration)
|
|
1359 (= 2 font-lock-maximum-decoration))]
|
442
|
1360 ["%_4 Most"
|
428
|
1361 (progn
|
|
1362 (require 'font-lock)
|
|
1363 (if (or (eq font-lock-maximum-decoration t)
|
|
1364 (and (integerp font-lock-maximum-decoration)
|
|
1365 (>= font-lock-maximum-decoration 3)))
|
|
1366 nil
|
|
1367 (customize-set-variable 'font-lock-maximum-decoration t)
|
|
1368 (font-lock-recompute-variables)))
|
|
1369 :style radio
|
|
1370 :active (fboundp 'font-lock-mode)
|
|
1371 :selected (and (boundp 'font-lock-maximum-decoration)
|
|
1372 (or (eq font-lock-maximum-decoration t)
|
|
1373 (and (integerp font-lock-maximum-decoration)
|
|
1374 (>= font-lock-maximum-decoration 3))))]
|
|
1375 "-----"
|
442
|
1376 ["Lazy %_Lock"
|
|
1377 (progn;; becomes buffer local
|
|
1378 (lazy-lock-mode)
|
|
1379 (customize-set-variable 'lazy-lock-mode lazy-lock-mode)
|
|
1380 ;; this shouldn't be necessary so there has to
|
|
1381 ;; be a redisplay bug lurking somewhere (or
|
|
1382 ;; possibly another event handler bug)
|
|
1383 (redraw-modeline))
|
|
1384 :active (and (boundp 'font-lock-mode) (boundp 'lazy-lock-mode)
|
|
1385 font-lock-mode)
|
|
1386 :style toggle
|
|
1387 :selected (and (boundp 'lazy-lock-mode) lazy-lock-mode)]
|
|
1388 ["Lazy %_Shot"
|
|
1389 (progn;; becomes buffer local
|
428
|
1390 (lazy-shot-mode)
|
|
1391 (customize-set-variable 'lazy-shot-mode lazy-shot-mode)
|
|
1392 ;; this shouldn't be necessary so there has to
|
|
1393 ;; be a redisplay bug lurking somewhere (or
|
|
1394 ;; possibly another event handler bug)
|
|
1395 (redraw-modeline))
|
|
1396 :active (and (boundp 'font-lock-mode) (boundp 'lazy-shot-mode)
|
|
1397 font-lock-mode)
|
|
1398 :style toggle
|
|
1399 :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)]
|
442
|
1400 ["Cac%_hing"
|
|
1401 (progn;; becomes buffer local
|
428
|
1402 (fast-lock-mode)
|
|
1403 (customize-set-variable 'fast-lock-mode fast-lock-mode)
|
|
1404 ;; this shouldn't be necessary so there has to
|
|
1405 ;; be a redisplay bug lurking somewhere (or
|
|
1406 ;; possibly another event handler bug)
|
|
1407 (redraw-modeline))
|
|
1408 :active (and (boundp 'font-lock-mode) (boundp 'fast-lock-mode)
|
|
1409 font-lock-mode)
|
|
1410 :style toggle
|
|
1411 :selected (and (boundp 'fast-lock-mode) fast-lock-mode)]
|
|
1412 )
|
442
|
1413 ("%_Font" :filter font-menu-family-constructor)
|
|
1414 ("Font Si%_ze" :filter font-menu-size-constructor)
|
|
1415 ;; ("Font Weig%_ht" :filter font-menu-weight-constructor)
|
|
1416 ["Edit Fa%_ces..." (customize-face nil)]
|
428
|
1417 "-----"
|
442
|
1418 ["Edit I%_nit File"
|
|
1419 ;; #### there should be something that holds the name that the init
|
|
1420 ;; file should be created as, when it's not present.
|
502
|
1421 (let ((el-file (or user-init-file "~/.xemacs/init.el")))
|
|
1422 (if (string-match "\\.elc$" el-file)
|
|
1423 (setq el-file
|
|
1424 (substring user-init-file 0 (1- (length el-file)))))
|
|
1425 (find-file el-file)
|
|
1426 (or (eq major-mode 'emacs-lisp-mode)
|
|
1427 (emacs-lisp-mode)))]
|
442
|
1428 ["%_Save Options to Init File" customize-save-customized]
|
|
1429 )
|
|
1430
|
|
1431 ("%_Buffers"
|
|
1432 :filter buffers-menu-filter
|
|
1433 ["Go To %_Previous Buffer" switch-to-other-buffer]
|
|
1434 ["Go To %_Buffer..." switch-to-buffer]
|
|
1435 "----"
|
|
1436 ["%_List All Buffers" list-buffers]
|
|
1437 ["%_Delete Buffer" kill-this-buffer
|
|
1438 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
|
|
1439 "----"
|
428
|
1440 )
|
|
1441
|
442
|
1442 nil ; the partition: menus after this are flushright
|
428
|
1443
|
442
|
1444 ("%_Help"
|
|
1445 ["%_About XEmacs..." about-xemacs]
|
502
|
1446 ["%_Home Page (www.xemacs.org)" xemacs-www-page
|
|
1447 :active (fboundp 'browse-url)]
|
442
|
1448 "-----"
|
479
|
1449 ["What's %_New in XEmacs" view-emacs-news]
|
442
|
1450 ["%_Obtaining XEmacs" describe-distribution]
|
428
|
1451 "-----"
|
442
|
1452 ("%_Info (Online Docs)"
|
502
|
1453 ["Info Con%_tents" (Info-goto-node "(dir)")]
|
|
1454 "-----"
|
|
1455 ["XEmacs %_User's Manual" (Info-goto-node "(XEmacs)")]
|
|
1456 ["XEmacs %_Lisp Reference Manual" (Info-goto-node "(Lispref)")]
|
|
1457 ["All About %_Packages" (Info-goto-node "(xemacs)Packages")]
|
|
1458 ["%_Getting Started with XEmacs" (Info-goto-node "(New-Users-Guide)")]
|
|
1459 ["XEmacs In%_ternals Manual" (Info-goto-node "(Internals)")]
|
|
1460 ["%_How to Use Info" (Info-goto-node "(Info)")]
|
|
1461 "-----"
|
|
1462 ["Lookup %_Key Sequence in User's Manual..."
|
|
1463 Info-goto-emacs-key-command-node]
|
|
1464 ["Lookup %_Command in User's Manual..." Info-goto-emacs-command-node]
|
|
1465 ["Lookup %_Function in Lisp Reference..." Info-elisp-ref]
|
|
1466 "-----"
|
|
1467 ["Search %_Index in User's Manual/Lispref..."
|
|
1468 Info-search-index-in-xemacs-and-lispref]
|
|
1469 ["%_Search Text in User's Manual..." Info-search-text-in-xemacs]
|
|
1470 ["S%_earch Text in Lisp Reference..."
|
|
1471 Info-search-text-in-lispref]
|
|
1472 )
|
442
|
1473 ("XEmacs %_FAQ"
|
|
1474 ["%_FAQ (local)" xemacs-local-faq]
|
|
1475 ["FAQ via %_WWW" xemacs-www-faq
|
|
1476 :active (fboundp 'browse-url)])
|
|
1477 ("%_Tutorials"
|
|
1478 :filter tutorials-menu-filter)
|
|
1479 ("%_Samples"
|
502
|
1480 ["View Sample %_init.el" view-sample-init-el
|
462
|
1481 :active (locate-data-file "sample.init.el")]
|
502
|
1482 ["View Sample .%_gtkrc"
|
|
1483 (Help-find-file (locate-data-file "sample.gtkrc"))
|
462
|
1484 :included (featurep 'gtk)
|
|
1485 :active (locate-data-file "sample.gtkrc")]
|
502
|
1486 ["View Sample .%_Xdefaults"
|
|
1487 (Help-find-file (locate-data-file "sample.Xdefaults"))
|
462
|
1488 :included (featurep 'x)
|
442
|
1489 :active (locate-data-file "sample.Xdefaults")]
|
502
|
1490 ["View Sample %_enriched.doc"
|
|
1491 (Help-find-file (locate-data-file "enriched.doc"))
|
442
|
1492 :active (locate-data-file "enriched.doc")])
|
502
|
1493 ("%_Commands, Variables, Keys"
|
|
1494 ["Describe %_Mode" describe-mode]
|
442
|
1495 ["%_Apropos..." hyper-apropos]
|
502
|
1496 ["%_Command-Only Apropos..." command-hyper-apropos]
|
442
|
1497 ["Apropos %_Docs..." apropos-documentation]
|
428
|
1498 "-----"
|
502
|
1499 ["Describe %_Key..." describe-key]
|
|
1500 ["Show %_Bindings" describe-bindings]
|
|
1501 ["Show M%_ouse Bindings" describe-pointer]
|
442
|
1502 ["%_Recent Keys" view-lossage]
|
428
|
1503 "-----"
|
502
|
1504 ["Describe %_Function..." describe-function]
|
|
1505 ["Describe %_Variable..." describe-variable]
|
|
1506 ["%_Locate Command in Keymap..." where-is])
|
442
|
1507 ("%_Misc"
|
|
1508 ["%_Current Installation Info" describe-installation
|
428
|
1509 :active (boundp 'Installation-string)]
|
442
|
1510 ["%_No Warranty" describe-no-warranty]
|
|
1511 ["XEmacs %_License" describe-copying]
|
|
1512 ["Find %_Packages" finder-by-keyword]
|
|
1513 ["View %_Splash Screen" xemacs-splash-buffer]
|
|
1514 ["%_Unix Manual..." manual-entry])
|
502
|
1515 "-----"
|
|
1516 ["%_Recent Messages" view-lossage]
|
442
|
1517 ["Send %_Bug Report..." report-emacs-bug
|
444
|
1518 :active (fboundp 'report-emacs-bug)])))
|
428
|
1519
|
|
1520
|
|
1521 (defun maybe-add-init-button ()
|
|
1522 "Don't call this.
|
|
1523 Adds `Load .emacs' button to menubar when starting up with -q."
|
442
|
1524 (when (and (not load-user-init-file-p)
|
|
1525 (file-exists-p (expand-file-name ".emacs" "~")))
|
|
1526 (add-menu-button
|
|
1527 nil
|
|
1528 ["%_Load .emacs"
|
|
1529 (progn
|
|
1530 (mapc #'(lambda (buf)
|
|
1531 (with-current-buffer buf
|
|
1532 (delete-menu-item '("Load .emacs"))))
|
|
1533 (buffer-list))
|
|
1534 (load-user-init-file))
|
|
1535 ]
|
|
1536 "Help")))
|
428
|
1537
|
|
1538 (add-hook 'before-init-hook 'maybe-add-init-button)
|
|
1539
|
|
1540
|
|
1541 ;;; The File menu
|
|
1542
|
|
1543 (defvar put-buffer-names-in-file-menu t)
|
|
1544
|
|
1545
|
|
1546 ;;; The Bookmarks menu
|
|
1547
|
|
1548 (defun bookmark-menu-filter (&rest ignore)
|
442
|
1549 (declare (special bookmark-alist))
|
428
|
1550 (let ((definedp (and (boundp 'bookmark-alist)
|
|
1551 bookmark-alist
|
|
1552 t)))
|
|
1553 `(,(if definedp
|
442
|
1554 '("%_Jump to Bookmark"
|
428
|
1555 :filter (lambda (&rest junk)
|
442
|
1556 (submenu-generate-accelerator-spec
|
|
1557 (mapcar #'(lambda (bmk)
|
|
1558 `[,bmk (bookmark-jump ',bmk)])
|
|
1559 (bookmark-all-names)))))
|
|
1560 ["%_Jump to Bookmark" nil nil])
|
|
1561 ["Set %_Bookmark" bookmark-set
|
428
|
1562 :active (fboundp 'bookmark-set)]
|
|
1563 "---"
|
442
|
1564 ["Insert %_Contents" bookmark-menu-insert
|
428
|
1565 :active (fboundp 'bookmark-menu-insert)]
|
442
|
1566 ["Insert L%_ocation" bookmark-menu-locate
|
428
|
1567 :active (fboundp 'bookmark-menu-locate)]
|
|
1568 "---"
|
442
|
1569 ["%_Rename Bookmark" bookmark-menu-rename
|
428
|
1570 :active (fboundp 'bookmark-menu-rename)]
|
|
1571 ,(if definedp
|
442
|
1572 '("%_Delete Bookmark"
|
428
|
1573 :filter (lambda (&rest junk)
|
442
|
1574 (submenu-generate-accelerator-spec
|
|
1575 (mapcar #'(lambda (bmk)
|
|
1576 `[,bmk (bookmark-delete ',bmk)])
|
|
1577 (bookmark-all-names)))))
|
|
1578 ["%_Delete Bookmark" nil nil])
|
|
1579 ["%_Edit Bookmark List" bookmark-bmenu-list ,definedp]
|
428
|
1580 "---"
|
442
|
1581 ["%_Save Bookmarks" bookmark-save ,definedp]
|
|
1582 ["Save Bookmarks %_As..." bookmark-write ,definedp]
|
|
1583 ["%_Load a Bookmark File" bookmark-load
|
428
|
1584 :active (fboundp 'bookmark-load)])))
|
|
1585
|
|
1586 ;;; The Buffers menu
|
|
1587
|
|
1588 (defgroup buffers-menu nil
|
|
1589 "Customization of `Buffers' menu."
|
|
1590 :group 'menu)
|
|
1591
|
442
|
1592 (defvar buffers-menu-omit-chars-list '(?b ?p ?l ?d))
|
|
1593
|
428
|
1594 (defcustom buffers-menu-max-size 25
|
|
1595 "*Maximum number of entries which may appear on the \"Buffers\" menu.
|
|
1596 If this is 10, then only the ten most-recently-selected buffers will be
|
|
1597 shown. If this is nil, then all buffers will be shown. Setting this to
|
|
1598 a large number or nil will slow down menu responsiveness."
|
|
1599 :type '(choice (const :tag "Show all" nil)
|
|
1600 (integer 10))
|
|
1601 :group 'buffers-menu)
|
|
1602
|
|
1603 (defcustom complex-buffers-menu-p nil
|
|
1604 "*If non-nil, the buffers menu will contain several commands.
|
|
1605 Commands will be presented as submenus of each buffer line. If this
|
|
1606 is false, then there will be only one command: select that buffer."
|
|
1607 :type 'boolean
|
|
1608 :group 'buffers-menu)
|
|
1609
|
|
1610 (defcustom buffers-menu-submenus-for-groups-p nil
|
|
1611 "*If non-nil, the buffers menu will contain one submenu per group of buffers.
|
|
1612 The grouping function is specified in `buffers-menu-grouping-function'.
|
|
1613 If this is an integer, do not build submenus if the number of buffers
|
|
1614 is not larger than this value."
|
|
1615 :type '(choice (const :tag "No Subgroups" nil)
|
|
1616 (integer :tag "Max. submenus" 10)
|
|
1617 (sexp :format "%t\n" :tag "Allow Subgroups" :value t))
|
|
1618 :group 'buffers-menu)
|
|
1619
|
|
1620 (defcustom buffers-menu-switch-to-buffer-function 'switch-to-buffer
|
|
1621 "*The function to call to select a buffer from the buffers menu.
|
|
1622 `switch-to-buffer' is a good choice, as is `pop-to-buffer'."
|
|
1623 :type '(radio (function-item switch-to-buffer)
|
|
1624 (function-item pop-to-buffer)
|
|
1625 (function :tag "Other"))
|
|
1626 :group 'buffers-menu)
|
|
1627
|
|
1628 (defcustom buffers-menu-omit-function 'buffers-menu-omit-invisible-buffers
|
|
1629 "*If non-nil, a function specifying the buffers to omit from the buffers menu.
|
|
1630 This is passed a buffer and should return non-nil if the buffer should be
|
|
1631 omitted. The default value `buffers-menu-omit-invisible-buffers' omits
|
|
1632 buffers that are normally considered \"invisible\" (those whose name
|
|
1633 begins with a space)."
|
|
1634 :type '(choice (const :tag "None" nil)
|
|
1635 function)
|
|
1636 :group 'buffers-menu)
|
|
1637
|
|
1638 (defcustom buffers-menu-format-buffer-line-function 'format-buffers-menu-line
|
442
|
1639 "*The function to call to return a string to represent a buffer in
|
|
1640 the buffers menu. The function is passed a buffer and a number
|
|
1641 (starting with 1) indicating which buffer line in the menu is being
|
|
1642 processed and should return a string containing an accelerator
|
|
1643 spec. (Check out `menu-item-generate-accelerator-spec' as a convenient
|
|
1644 way of generating the accelerator specs.) The default value
|
|
1645 `format-buffers-menu-line' just returns the name of the buffer and
|
|
1646 uses the number as the accelerator. Also check out
|
|
1647 `slow-format-buffers-menu-line' which returns a whole bunch of info
|
|
1648 about a buffer.
|
|
1649
|
|
1650 Note: Gross Compatibility Hack: Older versions of this function prototype
|
|
1651 only expected one argument, not two. We deal gracefully with such
|
|
1652 functions by simply calling them with one argument and leaving out the
|
|
1653 line number. However, this may go away at any time, so make sure to
|
|
1654 update all of your functions of this type."
|
428
|
1655 :type 'function
|
|
1656 :group 'buffers-menu)
|
|
1657
|
|
1658 (defcustom buffers-menu-sort-function
|
|
1659 'sort-buffers-menu-by-mode-then-alphabetically
|
|
1660 "*If non-nil, a function to sort the list of buffers in the buffers menu.
|
|
1661 It will be passed two arguments (two buffers to compare) and should return
|
|
1662 t if the first is \"less\" than the second. One possible value is
|
|
1663 `sort-buffers-menu-alphabetically'; another is
|
|
1664 `sort-buffers-menu-by-mode-then-alphabetically'."
|
|
1665 :type '(choice (const :tag "None" nil)
|
|
1666 function)
|
|
1667 :group 'buffers-menu)
|
|
1668
|
|
1669 (defcustom buffers-menu-grouping-function
|
|
1670 'group-buffers-menu-by-mode-then-alphabetically
|
|
1671 "*If non-nil, a function to group buffers in the buffers menu together.
|
|
1672 It will be passed two arguments, successive members of the sorted buffers
|
|
1673 list after being passed through `buffers-menu-sort-function'. It should
|
|
1674 return non-nil if the second buffer begins a new group. The return value
|
|
1675 should be the name of the old group, which may be used in hierarchical
|
|
1676 buffers menus. The last invocation of the function contains nil as the
|
|
1677 second argument, so that the name of the last group can be determined.
|
|
1678
|
|
1679 The sensible values of this function are dependent on the value specified
|
|
1680 for `buffers-menu-sort-function'."
|
|
1681 :type '(choice (const :tag "None" nil)
|
|
1682 function)
|
|
1683 :group 'buffers-menu)
|
|
1684
|
|
1685 (defun sort-buffers-menu-alphabetically (buf1 buf2)
|
|
1686 "For use as a value of `buffers-menu-sort-function'.
|
|
1687 Sorts the buffers in alphabetical order by name, but puts buffers beginning
|
|
1688 with a star at the end of the list."
|
|
1689 (let* ((nam1 (buffer-name buf1))
|
|
1690 (nam2 (buffer-name buf2))
|
438
|
1691 (inv1p (not (null (string-match "\\` " nam1))))
|
|
1692 (inv2p (not (null (string-match "\\` " nam2))))
|
428
|
1693 (star1p (not (null (string-match "\\`*" nam1))))
|
|
1694 (star2p (not (null (string-match "\\`*" nam2)))))
|
438
|
1695 (cond ((not (eq inv1p inv2p))
|
|
1696 (not inv1p))
|
|
1697 ((not (eq star1p star2p))
|
|
1698 (not star1p))
|
|
1699 (t
|
|
1700 (string-lessp nam1 nam2)))))
|
428
|
1701
|
|
1702 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
|
|
1703 "For use as a value of `buffers-menu-sort-function'.
|
|
1704 Sorts first by major mode and then alphabetically by name, but puts buffers
|
|
1705 beginning with a star at the end of the list."
|
|
1706 (let* ((nam1 (buffer-name buf1))
|
|
1707 (nam2 (buffer-name buf2))
|
438
|
1708 (inv1p (not (null (string-match "\\` " nam1))))
|
|
1709 (inv2p (not (null (string-match "\\` " nam2))))
|
428
|
1710 (star1p (not (null (string-match "\\`*" nam1))))
|
|
1711 (star2p (not (null (string-match "\\`*" nam2))))
|
|
1712 (mode1 (symbol-value-in-buffer 'major-mode buf1))
|
|
1713 (mode2 (symbol-value-in-buffer 'major-mode buf2)))
|
438
|
1714 (cond ((not (eq inv1p inv2p))
|
|
1715 (not inv1p))
|
|
1716 ((not (eq star1p star2p))
|
|
1717 (not star1p))
|
428
|
1718 ((and star1p star2p (string-lessp nam1 nam2)))
|
438
|
1719 ((string-lessp mode1 mode2)
|
|
1720 t)
|
|
1721 ((string-lessp mode2 mode1)
|
|
1722 nil)
|
|
1723 (t
|
|
1724 (string-lessp nam1 nam2)))))
|
428
|
1725
|
|
1726 ;; this version is too slow on some machines.
|
442
|
1727 ;; (vintage 1990, that is)
|
|
1728 (defun slow-format-buffers-menu-line (buffer n)
|
428
|
1729 "For use as a value of `buffers-menu-format-buffer-line-function'.
|
|
1730 This returns a string containing a bunch of info about the buffer."
|
442
|
1731 (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list)
|
|
1732 (format "%s%s %-19s %6s %-15s %s"
|
|
1733 (if (buffer-modified-p buffer) "*" " ")
|
|
1734 (if (symbol-value-in-buffer 'buffer-read-only buffer)
|
|
1735 "%" " ")
|
|
1736 (buffer-name buffer)
|
|
1737 (buffer-size buffer)
|
|
1738 (symbol-value-in-buffer 'mode-name buffer)
|
|
1739 (or (buffer-file-name buffer) ""))))
|
428
|
1740
|
442
|
1741 (defun format-buffers-menu-line (buffer n)
|
428
|
1742 "For use as a value of `buffers-menu-format-buffer-line-function'.
|
|
1743 This just returns the buffer's name."
|
442
|
1744 (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list)
|
|
1745 (buffer-name buffer)))
|
428
|
1746
|
|
1747 (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
|
|
1748 "For use as a value of `buffers-menu-grouping-function'.
|
|
1749 This groups buffers by major mode. It only really makes sense if
|
|
1750 `buffers-menu-sorting-function' is
|
|
1751 `sort-buffers-menu-by-mode-then-alphabetically'."
|
|
1752 (cond ((string-match "\\`*" (buffer-name buf1))
|
|
1753 (and (null buf2) "*Misc*"))
|
|
1754 ((or (null buf2)
|
|
1755 (string-match "\\`*" (buffer-name buf2))
|
|
1756 (not (eq (symbol-value-in-buffer 'major-mode buf1)
|
|
1757 (symbol-value-in-buffer 'major-mode buf2))))
|
|
1758 (symbol-value-in-buffer 'mode-name buf1))
|
|
1759 (t nil)))
|
|
1760
|
|
1761 (defun buffer-menu-save-buffer (buffer)
|
|
1762 (save-excursion
|
|
1763 (set-buffer buffer)
|
|
1764 (save-buffer)))
|
|
1765
|
|
1766 (defun buffer-menu-write-file (buffer)
|
|
1767 (save-excursion
|
|
1768 (set-buffer buffer)
|
|
1769 (write-file (read-file-name
|
|
1770 (format "Write %s to file: "
|
|
1771 (buffer-name (current-buffer)))))))
|
|
1772
|
|
1773 (defsubst build-buffers-menu-internal (buffers)
|
442
|
1774 (let (name line (n 0))
|
428
|
1775 (mapcar
|
|
1776 #'(lambda (buffer)
|
|
1777 (if (eq buffer t)
|
|
1778 "---"
|
442
|
1779 (setq n (1+ n))
|
|
1780 (setq line
|
|
1781 ; #### a truly Kyle-friendly hack.
|
|
1782 (let ((fn buffers-menu-format-buffer-line-function))
|
|
1783 (if (= (function-max-args fn) 1)
|
|
1784 (funcall fn buffer)
|
|
1785 (funcall fn buffer n))))
|
428
|
1786 (if complex-buffers-menu-p
|
|
1787 (delq nil
|
|
1788 (list line
|
442
|
1789 (vector "S%_witch to Buffer"
|
428
|
1790 (list buffers-menu-switch-to-buffer-function
|
|
1791 (setq name (buffer-name buffer)))
|
|
1792 t)
|
|
1793 (if (eq buffers-menu-switch-to-buffer-function
|
|
1794 'switch-to-buffer)
|
442
|
1795 (vector "Switch to Buffer, Other %_Frame"
|
428
|
1796 (list 'switch-to-buffer-other-frame
|
|
1797 (setq name (buffer-name buffer)))
|
|
1798 t)
|
|
1799 nil)
|
|
1800 (if (and (buffer-modified-p buffer)
|
|
1801 (buffer-file-name buffer))
|
442
|
1802 (vector "%_Save Buffer"
|
428
|
1803 (list 'buffer-menu-save-buffer name) t)
|
442
|
1804 ["%_Save Buffer" nil nil]
|
428
|
1805 )
|
442
|
1806 (vector "Save %_As..."
|
428
|
1807 (list 'buffer-menu-write-file name) t)
|
442
|
1808 (vector "%_Delete Buffer" (list 'kill-buffer name)
|
428
|
1809 t)))
|
440
|
1810 ;; #### We don't want buffer names to be translated,
|
|
1811 ;; #### so we put the buffer name in the suffix.
|
|
1812 ;; #### Also, avoid losing with non-ASCII buffer names.
|
|
1813 ;; #### We still lose, however, if complex-buffers-menu-p. --mrb
|
428
|
1814 (vector ""
|
|
1815 (list buffers-menu-switch-to-buffer-function
|
|
1816 (buffer-name buffer))
|
|
1817 t line))))
|
|
1818 buffers)))
|
|
1819
|
|
1820 (defun buffers-menu-filter (menu)
|
|
1821 "This is the menu filter for the top-level buffers \"Buffers\" menu.
|
|
1822 It dynamically creates a list of buffers to use as the contents of the menu.
|
|
1823 Only the most-recently-used few buffers will be listed on the menu, for
|
|
1824 efficiency reasons. You can control how many buffers will be shown by
|
|
1825 setting `buffers-menu-max-size'. You can control the text of the menu
|
|
1826 items by redefining the function `format-buffers-menu-line'."
|
|
1827 (let ((buffers (delete-if buffers-menu-omit-function (buffer-list))))
|
|
1828 (and (integerp buffers-menu-max-size)
|
|
1829 (> buffers-menu-max-size 1)
|
|
1830 (> (length buffers) buffers-menu-max-size)
|
|
1831 ;; shorten list of buffers (not with submenus!)
|
|
1832 (not (and buffers-menu-grouping-function
|
|
1833 buffers-menu-submenus-for-groups-p))
|
|
1834 (setcdr (nthcdr buffers-menu-max-size buffers) nil))
|
|
1835 (if buffers-menu-sort-function
|
|
1836 (setq buffers (sort buffers buffers-menu-sort-function)))
|
|
1837 (if (and buffers-menu-grouping-function
|
|
1838 buffers-menu-submenus-for-groups-p
|
|
1839 (or (not (integerp buffers-menu-submenus-for-groups-p))
|
|
1840 (> (length buffers) buffers-menu-submenus-for-groups-p)))
|
|
1841 (let (groups groupnames current-group)
|
|
1842 (mapl
|
|
1843 #'(lambda (sublist)
|
|
1844 (let ((groupname (funcall buffers-menu-grouping-function
|
|
1845 (car sublist) (cadr sublist))))
|
|
1846 (setq current-group (cons (car sublist) current-group))
|
|
1847 (if groupname
|
|
1848 (progn
|
|
1849 (setq groups (cons (nreverse current-group)
|
|
1850 groups))
|
|
1851 (setq groupnames (cons groupname groupnames))
|
|
1852 (setq current-group nil)))))
|
|
1853 buffers)
|
|
1854 (setq buffers
|
|
1855 (mapcar*
|
|
1856 #'(lambda (groupname group)
|
|
1857 (cons groupname (build-buffers-menu-internal group)))
|
|
1858 (nreverse groupnames)
|
|
1859 (nreverse groups))))
|
|
1860 (if buffers-menu-grouping-function
|
|
1861 (progn
|
|
1862 (setq buffers
|
|
1863 (mapcon
|
|
1864 #'(lambda (sublist)
|
|
1865 (cond ((funcall buffers-menu-grouping-function
|
|
1866 (car sublist) (cadr sublist))
|
|
1867 (list (car sublist) t))
|
|
1868 (t (list (car sublist)))))
|
|
1869 buffers))
|
|
1870 ;; remove a trailing separator.
|
|
1871 (and (>= (length buffers) 2)
|
|
1872 (let ((lastcdr (nthcdr (- (length buffers) 2) buffers)))
|
|
1873 (if (eq t (cadr lastcdr))
|
|
1874 (setcdr lastcdr nil))))))
|
|
1875 (setq buffers (build-buffers-menu-internal buffers)))
|
|
1876 (append menu buffers)
|
|
1877 ))
|
|
1878
|
|
1879 (defun language-environment-menu-filter (menu)
|
|
1880 "This is the menu filter for the \"Language Environment\" submenu."
|
442
|
1881 (declare (special language-environment-list))
|
|
1882 (let ((n 0))
|
|
1883 (mapcar (lambda (env-sym)
|
|
1884 (setq n (1+ n))
|
|
1885 `[ ,(concat (menu-item-generate-accelerator-spec n)
|
|
1886 (capitalize (symbol-name env-sym)))
|
|
1887 (set-language-environment ',env-sym)])
|
|
1888 language-environment-list)))
|
428
|
1889
|
|
1890
|
|
1891 ;;; The Options menu
|
|
1892
|
|
1893 ;; We'll keep those variables here for a while, in order to provide a
|
|
1894 ;; function for porting the old options file that a user may own to Custom.
|
|
1895
|
|
1896 (defvar options-save-faces nil
|
|
1897 "*Non-nil value means save-options will save information about faces.
|
|
1898 A nil value means save-options will not save face information.
|
|
1899 Set this non-nil only if you use M-x edit-faces to change face
|
|
1900 settings. If you use M-x customize-face or the \"Browse Faces...\"
|
|
1901 menu entry, you will see a button in the Customize Face buffer that you
|
|
1902 can use to permanently save your face changes.
|
|
1903
|
|
1904 M-x edit-faces is deprecated. Support for it and this variable will
|
|
1905 be discontinued in a future release.")
|
|
1906
|
|
1907 (defvar save-options-init-file nil
|
|
1908 "File into which to save forms to load the options file (nil for .emacs).
|
|
1909 Normally this is nil, which means save into your .emacs file (the value
|
|
1910 of `user-init-file'.")
|
|
1911
|
|
1912 (defvar save-options-file ".xemacs-options"
|
|
1913 "File to save options into.
|
|
1914 This file is loaded from your .emacs file.
|
|
1915 If this is a relative filename, it is put into the same directory as your
|
|
1916 .emacs file.")
|
|
1917
|
|
1918
|
|
1919
|
|
1920 ;;; The Help menu
|
|
1921
|
442
|
1922 (defun tutorials-menu-filter (menu-items)
|
|
1923 (declare (special language-info-alist
|
|
1924 current-language-environment
|
|
1925 tutorial-supported-languages))
|
|
1926 (append
|
|
1927 (if (featurep 'mule)
|
|
1928 (if (assq 'tutorial
|
|
1929 (assoc current-language-environment language-info-alist))
|
|
1930 `([,(concat "%_Default (" current-language-environment ")")
|
|
1931 help-with-tutorial]))
|
|
1932 '(["%_English" help-with-tutorial]))
|
|
1933 (submenu-generate-accelerator-spec
|
|
1934 (if (featurep 'mule)
|
|
1935 ;; Mule tutorials.
|
|
1936 (mapcan #'(lambda (lang)
|
|
1937 (let ((tut (assq 'tutorial lang)))
|
|
1938 (and tut
|
|
1939 (not (string= (car lang) "ASCII"))
|
|
1940 ;; skip current language, since we already
|
|
1941 ;; included it first
|
|
1942 (not (string= (car lang)
|
|
1943 current-language-environment))
|
|
1944 `([,(car lang)
|
|
1945 (help-with-tutorial nil ,(cdr tut))]))))
|
|
1946 language-info-alist)
|
|
1947 ;; Non mule tutorials.
|
|
1948 (mapcar #'(lambda (lang)
|
|
1949 `[,(car lang)
|
|
1950 (help-with-tutorial ,(format "TUTORIAL.%s"
|
|
1951 (cadr lang)))])
|
|
1952 tutorial-supported-languages)))))
|
428
|
1953
|
|
1954 (set-menubar default-menubar)
|
|
1955
|
|
1956
|
|
1957 ;;; Popup menus.
|
|
1958
|
|
1959 (defconst default-popup-menu
|
|
1960 '("XEmacs Commands"
|
502
|
1961 ["%_Split Window" split-window-vertically]
|
|
1962 ["S%_plit Window (Side by Side)" split-window-horizontally]
|
|
1963 ["%_Un-Split (Keep This)" delete-other-windows
|
|
1964 :active (not (one-window-p t))]
|
|
1965 ["Un-Split (Keep %_Others)" delete-window
|
|
1966 :active (not (one-window-p t))]
|
428
|
1967 ))
|
|
1968
|
|
1969 ;; In an effort to avoid massive menu clutter, this mostly worthless menu is
|
440
|
1970 ;; superseded by any local popup menu...
|
428
|
1971 (setq-default mode-popup-menu default-popup-menu)
|
|
1972
|
442
|
1973
|
|
1974 ;; misc
|
428
|
1975
|
|
1976 (defun xemacs-splash-buffer ()
|
|
1977 "Redisplay XEmacs splash screen in a buffer."
|
|
1978 (interactive)
|
|
1979 (let ((buffer (get-buffer-create "*Splash*"))
|
|
1980 tmout)
|
|
1981 (set-buffer buffer)
|
|
1982 (setq buffer-read-only t)
|
|
1983 (erase-buffer buffer)
|
|
1984 (setq tmout (display-splash-frame))
|
|
1985 (when tmout
|
|
1986 (make-local-hook 'kill-buffer-hook)
|
|
1987 (add-hook 'kill-buffer-hook
|
|
1988 `(lambda ()
|
|
1989 (disable-timeout ,tmout))
|
|
1990 nil t))
|
|
1991 (pop-to-buffer buffer)
|
|
1992 (delete-other-windows)))
|
|
1993
|
|
1994
|
|
1995 ;;; backwards compatibility
|
|
1996 (provide 'x-menubar)
|
|
1997 (provide 'menubar-items)
|
|
1998
|
438
|
1999 ;;; menubar-items.el ends here.
|