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