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