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