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