annotate lisp/x11/x-menubar.el @ 207:e45d5e7c476e r20-4b2

Import from CVS: tag r20-4b2
author cvs
date Mon, 13 Aug 2007 10:03:52 +0200
parents 850242ba4a81
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; x-menubar.el --- Menubar and popup-menu support for X.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995 Sun Microsystems.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Copyright (C) 1995, 1996 Ben Wing.
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
7 ;; Copyright (C) 1997 MORIOKA Tomohiko
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
22 ;; along with Xmacs; see the file COPYING. If not, write to the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
23 ;; Free Software Foundation, 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
24 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
30 ;;; Warning-free compile
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
31 (eval-when-compile
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 195
diff changeset
32 (defvar language-environment-list)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 195
diff changeset
33 (require 'pending-del))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
34
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (defconst default-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (purecopy-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; note backquote.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 `(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ("File"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 :filter file-menu-filter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ["Open..." find-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ["Open in Other Window..." find-file-other-window t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ["Open in New Frame..." find-file-other-frame t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ["Insert File..." insert-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ["View File..." view-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 "------"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ["Save" save-buffer t nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ["Save As..." write-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ["Save Some Buffers" save-some-buffers t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ["Print Buffer" lpr-buffer t nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ["Pretty-Print Buffer" ps-print-buffer-with-faces t nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ["New Frame" make-frame t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ["Frame on Other Display..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 make-frame-on-display t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ["Delete Frame" delete-frame t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ["Split Window" split-window-vertically t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ["Un-Split (Keep This)" delete-other-windows (not (one-window-p t))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ["Un-Split (Keep Others)" delete-window (not (one-window-p t))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ["Revert Buffer" revert-buffer t nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ["Delete Buffer" kill-this-buffer t nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ["Exit XEmacs" save-buffers-kill-emacs t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ("Edit"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 :filter edit-menu-filter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ["Undo" advertised-undo t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ["Cut" x-kill-primary-selection t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ["Copy" x-copy-primary-selection t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ["Paste" x-yank-clipboard-selection t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ["Clear" x-delete-primary-selection t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ["Search..." isearch-forward t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ["Search Backward..." isearch-backward t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ["Replace..." query-replace t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ["Search (Regexp)..." isearch-forward-regexp t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ["Search Backward (Regexp)..." isearch-backward-regexp t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ["Replace (Regexp)..." query-replace-regexp t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ("Bookmarks"
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
86 ("Jump to bookmark"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
87 :filter bookmark-menu-filter)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
88 ["Set bookmark" bookmark-set t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 "---"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
90 ["Insert contents" bookmark-menu-insert t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
91 ["Insert location" bookmark-menu-locate t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 "---"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
93 ["Rename bookmark" bookmark-menu-rename t]
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
94 ("Delete bookmark"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
95 :filter bookmark-delete-filter)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
96 ["Edit Bookmark List" bookmark-bmenu-list t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 "---"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
98 ["Save bookmarks" bookmark-save t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
99 ["Save bookmarks as..." bookmark-write t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
100 ["Load a bookmark file" bookmark-load t])
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ["Goto Line..." goto-line t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ["What Line" what-line t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ["Start Macro Recording" start-kbd-macro (not defining-kbd-macro)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ["End Macro Recording" end-kbd-macro defining-kbd-macro]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 ["Execute Last Macro" call-last-kbd-macro last-kbd-macro]
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
108 "----"
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
109 ["Show Message Log" show-message-log t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 )
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
111
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
112 ,@(if (featurep 'mule)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
113 '(("Mule"
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
114 ("Describe language support")
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
115 ("Set language environment")
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
116 "--"
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
117 ["Toggle input method" toggle-input-method t]
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
118 ["Select input method" select-input-method t]
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
119 ["Describe input method" describe-input-method t]
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
120 "--"
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
121 ["Describe current coding systems"
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
122 describe-current-coding-system t]
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
123 ["Set coding system of buffer file"
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
124 set-buffer-file-coding-system t]
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
125 ["Set coding system of terminal"
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
126 set-terminal-coding-system nil] ; not implemented yet
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
127 ["Set coding system of keyboard"
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
128 set-keyboard-coding-system nil] ; not implemented yet
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
129 ["Set coding system of process"
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
130 set-current-process-coding-system nil] ; not implemented yet
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
131 "--"
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
132 ["Show character table" view-charset-by-menu t]
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
133 ["Show diagnosis for MULE" mule-diag nil] ; not implemented yet
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
134 ["Show many languages" view-hello-file t]
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
135 )))
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
136
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ("Apps"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ["Read Mail (VM)..." vm t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ["Read Mail (MH)..." (mh-rmail t) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ["Send mail..." mail t]
189
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
141 ["Usenet News" gnus (fboundp 'gnus)]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ["Browse the Web" w3 t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ["Gopher" gopher t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ["Hyperbole..." hyperbole t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ["Spell-Check Buffer" ispell-buffer t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ["Emulate VI" viper-mode t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ("Calendar"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ["3-Month Calendar" calendar t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 ["Diary" diary t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ["Holidays" holidays t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ;; we're all pagans at heart ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ["Phases of the Moon" phases-of-moon t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ["Sunrise/Sunset" sunrise-sunset t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ("Games"
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
158 ["Mine Game" xmine (fboundp 'xmine)]
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
159 ["Tetris" tetris (fboundp 'tetris)]
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
160 ["Quote from Zippy" yow (fboundp 'yow)]
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
161 ["Psychoanalyst" doctor (fboundp 'doctor)]
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
162 ["Psychoanalyze Zippy!" psychoanalyze-pinhead (fboundp 'psychoanalyze-pinhead)]
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
163 ["Random Flames" flame (fboundp 'flame)]
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
164 ["Dunnet (Adventure)" dunnet (fboundp 'dunnet)]
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
165 ["Towers of Hanoi" hanoi (fboundp 'hanoi)]
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
166 ["Game of Life" life (fboundp 'life)]
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
167 ["Multiplication Puzzle" mpuz (fboundp 'mpuz)]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ("Options"
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 116
diff changeset
172 ("Customize"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 116
diff changeset
173 ("Emacs" :filter (lambda (&rest junk)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 116
diff changeset
174 (cdr (custom-menu-create 'emacs))))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 151
diff changeset
175 ["Group..." customize-group t]
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 116
diff changeset
176 ["Variable..." customize-variable t]
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 116
diff changeset
177 ["Face..." customize-face t]
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 151
diff changeset
178 ["Saved..." customize-saved t]
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 151
diff changeset
179 ["Set..." customize-customized t]
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 116
diff changeset
180 ["Apropos..." customize-apropos t])
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ["Read Only" (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 :style toggle :selected buffer-read-only]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ("Editing Options"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ["Overstrike" (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (overwrite-mode current-prefix-arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (setq-default overwrite-mode overwrite-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 :style toggle :selected overwrite-mode]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ["Case Sensitive Search" (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (setq case-fold-search (not case-fold-search))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (setq-default case-fold-search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 case-fold-search))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 :style toggle :selected (not case-fold-search)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ["Case Matching Replace" (setq case-replace (not case-replace))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 :style toggle :selected case-replace]
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 195
diff changeset
195 ["Auto Delete Selection" (pending-delete-mode
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 195
diff changeset
196 (if pending-delete-mode 0 1))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 :style toggle
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 195
diff changeset
198 :selected (and (boundp 'pending-delete-mode) pending-delete-mode)]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 ["Active Regions" (setq zmacs-regions (not zmacs-regions))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 :style toggle :selected zmacs-regions]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ["Mouse Paste At Text Cursor" (setq mouse-yank-at-point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (not mouse-yank-at-point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 :style toggle :selected mouse-yank-at-point]
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
204 ["Require Newline At End" (setq require-final-newline
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
205 (or (eq require-final-newline 'ask)
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
206 (not require-final-newline)))
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
207 :style toggle :selected (eq require-final-newline 't)]
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
208 ["Add Newline When Moving Past End" (setq next-line-add-newlines
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
209 (not next-line-add-newlines))
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
210 :style toggle :selected next-line-add-newlines]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ("General Options"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 ["Teach Extended Commands" (setq teach-extended-commands-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (not teach-extended-commands-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 :style toggle :selected teach-extended-commands-p]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ["Debug On Error" (setq debug-on-error (not debug-on-error))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 :style toggle :selected debug-on-error]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 ["Debug On Quit" (setq debug-on-quit (not debug-on-quit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 :style toggle :selected debug-on-quit]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 ("Printing Options"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 ["Command-Line Switches for `lpr'/`lp'..."
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
223 (setq lpr-switches
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
224 (read-expression "Switches for `lpr'/`lp': "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
225 (format "%S" lpr-switches)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 ("Pretty-Print Paper Size"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ["Letter"
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
229 (setq ps-paper-type 'letter)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
230 :style radio
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
231 :selected (eq ps-paper-type 'letter)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
232 ["Letter-small"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
233 (setq ps-paper-type 'letter-small)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
234 :style radio
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
235 :selected (eq ps-paper-type 'letter-small)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
236 ["Legal"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
237 (setq ps-paper-type 'legal)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 :style radio
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
239 :selected (eq ps-paper-type 'legal)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
240 ["Statement"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
241 (setq ps-paper-type 'statement)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
242 :style radio
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
243 :selected (eq ps-paper-type 'statement)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
244 ["Executive"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
245 (setq ps-paper-type 'executive)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
246 :style radio
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
247 :selected (eq ps-paper-type 'executive)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
248 ["Tabloid"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
249 (setq ps-paper-type 'tabloid)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
250 :style radio
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
251 :selected (eq ps-paper-type 'tabloid)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
252 ["Ledger"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
253 (setq ps-paper-type 'ledger)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
254 :style radio
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
255 :selected (eq ps-paper-type 'ledger)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
256 ["A3"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
257 (setq ps-paper-type 'a3)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
258 :style radio
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
259 :selected (eq ps-paper-type 'a3)]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ["A4"
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
261 (setq ps-paper-type 'a4)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
262 :style radio
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
263 :selected (eq ps-paper-type 'a4)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
264 ["A4small"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
265 (setq ps-paper-type 'a4small)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 :style radio
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
267 :selected (eq ps-paper-type 'a4small)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
268 ["B4"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
269 (setq ps-paper-type 'b4)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
270 :style radio
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
271 :selected (eq ps-paper-type 'b4)]
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
272 ["B5"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
273 (setq ps-paper-type 'b5)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
274 :style radio
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
275 :selected (eq ps-paper-type 'b5)]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 )
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 102
diff changeset
277 ["Enable Color Printing"
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 102
diff changeset
278 (progn
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 102
diff changeset
279 (set-face-background 'default "white")
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 102
diff changeset
280 (setq ps-print-color-p t))
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 102
diff changeset
281 t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ("\"Other Window\" Location"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ["Always in Same Frame"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (setq get-frame-for-buffer-default-instance-limit nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 :selected (null get-frame-for-buffer-default-instance-limit)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 ["Other Frame (2 Frames Max)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (setq get-frame-for-buffer-default-instance-limit 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 :selected (eq 2 get-frame-for-buffer-default-instance-limit)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 ["Other Frame (3 Frames Max)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (setq get-frame-for-buffer-default-instance-limit 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 :selected (eq 3 get-frame-for-buffer-default-instance-limit)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 ["Other Frame (4 Frames Max)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (setq get-frame-for-buffer-default-instance-limit 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 :selected (eq 4 get-frame-for-buffer-default-instance-limit)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 ["Other Frame (5 Frames Max)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (setq get-frame-for-buffer-default-instance-limit 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 :selected (eq 5 get-frame-for-buffer-default-instance-limit)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 ["Always Create New Frame"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (setq get-frame-for-buffer-default-instance-limit 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 :selected (eq 0 get-frame-for-buffer-default-instance-limit)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 ["Temp Buffers Always in Same Frame"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 :selected (eq temp-buffer-show-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 'show-temp-buffer-in-current-frame)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 ["Temp Buffers Like Other Buffers"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (setq temp-buffer-show-function nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 :selected (null temp-buffer-show-function)]
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
318 "-----"
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
319 ["Make current frame gnuserv target"
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
320 (setq gnuserv-frame
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
321 (if (equal gnuserv-frame (selected-frame))
193
f53b5ca2e663 Import from CVS: tag r20-3b23
cvs
parents: 189
diff changeset
322 'new
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
323 (selected-frame)))
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
324 :style radio
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
325 :selected (equal gnuserv-frame (selected-frame))]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 ("Syntax Highlighting"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 ["In This Buffer" (font-lock-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 :style toggle :selected font-lock-mode]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 ["Automatic" (if (not (featurep 'font-lock))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (setq font-lock-auto-fontify t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (require 'font-lock))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (setq font-lock-auto-fontify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (not font-lock-auto-fontify)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 :style toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 :selected (and (featurep 'font-lock) font-lock-auto-fontify)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 ["Fonts" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (font-lock-use-default-fonts)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (setq font-lock-use-fonts t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 font-lock-use-colors nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 font-lock-use-fonts)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 ["Colors" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (font-lock-use-default-colors)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (setq font-lock-use-colors t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 font-lock-use-fonts nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 font-lock-use-colors)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 ["Least" (if (or (and (not (integerp font-lock-maximum-decoration))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (not (eq t font-lock-maximum-decoration)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (and (integerp font-lock-maximum-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (<= font-lock-maximum-decoration 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (setq font-lock-maximum-decoration nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (font-lock-recompute-variables))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 :active font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (or (and (not (integerp font-lock-maximum-decoration))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (not (eq t font-lock-maximum-decoration)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (and (integerp font-lock-maximum-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (<= font-lock-maximum-decoration 0))))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 ["More" (if (and (integerp font-lock-maximum-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (= 1 font-lock-maximum-decoration))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (setq font-lock-maximum-decoration 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (font-lock-recompute-variables))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 :active font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (integerp font-lock-maximum-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (= 1 font-lock-maximum-decoration))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 ["Even More" (if (and (integerp font-lock-maximum-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (= 2 font-lock-maximum-decoration))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (setq font-lock-maximum-decoration 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (font-lock-recompute-variables))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 :active font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (integerp font-lock-maximum-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (= 2 font-lock-maximum-decoration))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 ["Most" (if (or (eq font-lock-maximum-decoration t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (and (integerp font-lock-maximum-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (>= font-lock-maximum-decoration 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (setq font-lock-maximum-decoration t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (font-lock-recompute-variables))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 :active font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (or (eq font-lock-maximum-decoration t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (and (integerp font-lock-maximum-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (>= font-lock-maximum-decoration 3))))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 "-----"
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
405 ["Lazy" (progn (require 'lazy-shot)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
406 (if (and (boundp 'lazy-shot-mode) lazy-shot-mode)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (progn
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
408 (lazy-shot-mode 0)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 ;; this shouldn't be necessary so there has to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 ;; be a redisplay bug lurking somewhere (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 ;; possibly another event handler bug)
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
412 (redraw-modeline)
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
413 (remove-hook 'font-lock-mode-hook
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
414 'turn-on-lazy-shot))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (if font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (progn
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
417 (lazy-shot-mode 1)
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
418 (redraw-modeline)
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
419 (add-hook 'font-lock-mode-hook
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
420 'turn-on-lazy-shot)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 :active font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 :style toggle
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
423 :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 ["Caching" (progn (require 'fast-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (if fast-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (fast-lock-mode 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 ;; this shouldn't be necessary so there has to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 ;; be a redisplay bug lurking somewhere (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 ;; possibly another event handler bug)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (redraw-modeline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (if font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (fast-lock-mode 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (redraw-modeline)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 :active font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 :style toggle
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
438 :selected (and (boundp 'fast-lock-mode) fast-lock-mode)]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 ("Paren Highlighting"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 ["None" (paren-set-mode -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 :style radio :selected (not paren-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 ["Blinking Paren" (paren-set-mode 'blink-paren)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 :style radio :selected (eq paren-mode 'blink-paren)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 ["Steady Paren" (paren-set-mode 'paren)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 :style radio :selected (eq paren-mode 'paren)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 ["Expression" (paren-set-mode 'sexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 :style radio :selected (eq paren-mode 'sexp)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 ;;; ["Nested Shading" (paren-set-mode 'nested)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 ;;; :style radio :selected (eq paren-mode 'nested)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 ("Frame Appearance"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 ,@(if (featurep 'scrollbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 '(["Scrollbars" (if (= (specifier-instance scrollbar-width) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (set-specifier scrollbar-width 15)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (set-specifier scrollbar-height 15))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (set-specifier scrollbar-width 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (set-specifier scrollbar-height 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 :style toggle :selected (> (specifier-instance scrollbar-width) 0)]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 ["3D Modeline"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (if (zerop (specifier-instance modeline-shadow-thickness))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (set-specifier modeline-shadow-thickness 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (set-specifier modeline-shadow-thickness 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (redraw-modeline t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 :style toggle :selected
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (let ((thickness
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (specifier-instance modeline-shadow-thickness)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (and (integerp thickness)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (> thickness 0)))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 ["Truncate Lines" (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (setq truncate-lines (not truncate-lines))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (setq-default truncate-lines truncate-lines))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 :style toggle :selected truncate-lines]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 ["Bar Cursor" (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (setq bar-cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (if (not bar-cursor) 2 nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (force-cursor-redisplay))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 :style toggle :selected bar-cursor]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 ["Blinking Cursor" (blink-cursor-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 :style toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)]
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
485 ["Frame-Local Font Menu" (setq font-menu-this-frame-only-p
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
486 (not font-menu-this-frame-only-p))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
487 :style toggle :selected font-menu-this-frame-only-p]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 ; ["Line Numbers" (line-number-mode nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 ; :style toggle :selected line-number-mode]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 ("Menubar Appearance"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 ["Buffers Menu Length..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (setq buffers-menu-max-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (read-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 "Enter number of buffers to display (or 0 for unlimited): "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (if (eq buffers-menu-max-size 0) (setq buffers-menu-max-size nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ["Multi-Operation Buffers Sub-Menus"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (setq complex-buffers-menu-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (not complex-buffers-menu-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 :style toggle :selected complex-buffers-menu-p]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 ("Buffers Menu Sorting"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 ["Most Recently Used"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (setq buffers-menu-sort-function nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (setq buffers-menu-grouping-function nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 :selected (null buffers-menu-sort-function)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 ["Alphabetically"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (setq buffers-menu-sort-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 'sort-buffers-menu-alphabetically)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (setq buffers-menu-grouping-function nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 :selected (eq 'sort-buffers-menu-alphabetically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 buffers-menu-sort-function)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 ["By Major Mode, Then Alphabetically"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (setq buffers-menu-sort-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 'sort-buffers-menu-by-mode-then-alphabetically)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (setq buffers-menu-grouping-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 'group-buffers-menu-by-mode-then-alphabetically))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 buffers-menu-sort-function)])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 ["Submenus for Buffer Groups"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (setq buffers-menu-submenus-for-groups-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (not buffers-menu-submenus-for-groups-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 :style toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 :selected buffers-menu-submenus-for-groups-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 :active (not (null buffers-menu-grouping-function))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 "---"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 ["Ignore Scaled Fonts" (setq font-menu-ignore-scaled-fonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (not font-menu-ignore-scaled-fonts))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 :style toggle :selected font-menu-ignore-scaled-fonts]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 ,@(if (featurep 'toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 '(("Toolbar Appearance"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 ["Visible" (set-specifier default-toolbar-visible-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (not (specifier-instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 default-toolbar-visible-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 :style toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 :selected (specifier-instance default-toolbar-visible-p)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 ["Captioned" (set-specifier toolbar-buttons-captioned-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (not (specifier-instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 toolbar-buttons-captioned-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 :style toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 :selected
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (specifier-instance toolbar-buttons-captioned-p)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 ("Default Location"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 ["Top" (set-default-toolbar-position 'top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 :style radio :selected (eq (default-toolbar-position) 'top)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 ["Bottom" (set-default-toolbar-position 'bottom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 :style radio :selected (eq (default-toolbar-position) 'bottom)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 ["Left" (set-default-toolbar-position 'left)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 :style radio :selected (eq (default-toolbar-position) 'left)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 ["Right" (set-default-toolbar-position 'right)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 :style radio :selected (eq (default-toolbar-position) 'right)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 )))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
562 ("Mouse"
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
563 ["Avoid-Text"
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
564 (if (equal (device-type) 'x)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
565 (if mouse-avoidance-mode
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
566 (mouse-avoidance-mode 'none)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
567 (mouse-avoidance-mode 'banish))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
568 (beep)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
569 (message "This option requires a window system."))
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 126
diff changeset
570 :style toggle :selected (and mouse-avoidance-mode window-system)]
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 126
diff changeset
571 ["strokes-mode"
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 126
diff changeset
572 (if (equal (device-type) 'x)
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 126
diff changeset
573 (strokes-mode)
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 126
diff changeset
574 (beep)
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 126
diff changeset
575 (message "This option requires a window system."))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 151
diff changeset
576 :style toggle :selected (and strokes-mode window-system)])
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 ("Open URLs With"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 ["Emacs-W3" (setq browse-url-browser-function 'browse-url-w3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 :selected (eq browse-url-browser-function 'browse-url-w3)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 ["Netscape" (setq browse-url-browser-function 'browse-url-netscape)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 :selected (eq browse-url-browser-function 'browse-url-netscape)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 ["Mosaic" (setq browse-url-browser-function 'browse-url-mosaic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 :selected (eq browse-url-browser-function 'browse-url-mosaic)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 ["Mosaic (CCI)" (setq browse-url-browser-function 'browse-url-cci)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 :selected (eq browse-url-browser-function 'browse-url-iximosaic)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 ["IXI Mosaic" (setq browse-url-browser-function 'browse-url-iximosaic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 :selected (eq browse-url-browser-function 'browse-url-iximosaic)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 ["Lynx (xterm)" (setq browse-url-browser-function 'browse-url-lynx-xterm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 :selected (eq browse-url-browser-function 'browse-url-lynx-xterm)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 ["Lynx (xemacs)" (setq browse-url-browser-function 'browse-url-lynx-emacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 :selected (eq browse-url-browser-function 'browse-url-lynx-emacs)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 ["Grail" (setq browse-url-browser-function 'browse-url-grail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 :selected (eq browse-url-browser-function 'browse-url-grail)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 "-----"
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
604 ["Browse Faces..." edit-faces t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 ("Font" :filter font-menu-family-constructor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 ("Size" :filter font-menu-size-constructor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 ("Weight" :filter font-menu-weight-constructor)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
608 ,@(if (featurep 'mule)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
609 '("-----"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
610 ("Language Environment"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
611 :filter language-environment-menu-filter)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 ["Save Options" save-options-menu-settings t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 ("Buffers"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 :filter buffers-menu-filter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 ["List All Buffers" list-buffers t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 "--"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 ("Tools"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 ["Grep..." grep t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 ["Compile..." compile t]
6
27bc7f280385 Import from CVS: tag r19-15b4
cvs
parents: 4
diff changeset
625 ["Shell" shell t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 ["Shell Command..." shell-command t]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
627 ["Shell Command on Region..." shell-command-on-region (region-exists-p)]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 ["Debug (GDB)..." gdb t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 ["Debug (DBX)..." dbx t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 ["OO-Browser..." oobr t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 ("Tags"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
633 ["Find Tag..." find-tag t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 ["Find Other Window..." find-tag-other-window t]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
635 ["Next Tag..." (find-tag nil) t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
636 ["Next Other Window..." (find-tag-other-window nil) t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
637 ["Next File" next-file t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
638 "-----"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 ["Tags Search..." tags-search t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 ["Tags Replace..." tags-query-replace t]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
641 ["Continue Search/Replace" tags-loop-continue t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 ["Pop stack" pop-tag-mark t]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
644 ["Apropos..." tags-apropos t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
645 "-----"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
646 ["Set Tags Table File..." visit-tags-table t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
647 ))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 nil ; the partition: menus after this are flushright
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 ("Help"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 ["About XEmacs..." about-xemacs t]
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
653 ("Basics"
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
654 ["Tutorial" help-with-tutorial t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
655 ["News" view-emacs-news t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
656 ["Packages" finder-by-keyword t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
657 ["Splash" xemacs-splash-buffer t])
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 "-----"
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
659 ("XEmacs FAQ"
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
660 ["FAQ (local)" xemacs-local-faq t]
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
661 ["FAQ via WWW" xemacs-www-faq t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
662 ["Home Page" xemacs-www-page t])
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
663 ("Samples"
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
664 ["Sample" (find-file
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
665 (expand-file-name "sample.emacs"
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
666 data-directory))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
667 t ".emacs"]
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
668 ["Sample" (find-file
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
669 (expand-file-name "sample.Xdefaults"
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
670 data-directory))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
671 t ".Xdefaults"]
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
672 ["Sample" (find-file
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
673 (expand-file-name "enriched.doc"
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
674 data-directory))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
675 t "enriched"])
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 ("Lookup in Info"
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
678 ["Key Binding..." Info-goto-emacs-key-command-node t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 ["Command..." Info-goto-emacs-command-node t]
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
680 ["Function..." Info-elisp-ref t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 ["Topic..." Info-query t])
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
682 ("Manuals"
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
683 ["Info" info t]
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
684 ["Unix Manual..." manual-entry t])
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
685 ("Commands & Keys"
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
686 ["Mode" describe-mode t]
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
687 ["Apropos..." hyper-apropos t]
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
688 ["Apropos Docs..." apropos-documentation t]
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
689 "-----"
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
690 ["Key..." describe-key t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
691 ["Bindings" describe-bindings t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
692 ["Mouse Bindings" describe-pointer t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
693 ["Recent Keys" view-lossage t]
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
694 "-----"
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
695 ["Function..." describe-function t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
696 ["Variable..." describe-variable t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
697 ["Locate Command..." where-is t])
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
698 "-----"
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
699 ["Recent Messages" view-lossage t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 ("Misc"
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
701 ["No Warranty" describe-no-warranty t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
702 ["XEmacs License" describe-copying t]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
703 ["The Latest Version" describe-distribution t])
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 120
diff changeset
704 ["Submit Bug Report" send-pr t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (defun maybe-add-init-button ()
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
710 "Don't call this.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
711 Adds `Load .emacs' button to menubar when starting up with -q."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 ;; by Stig@hackvan.com
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (init-file-user nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 ((file-exists-p (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 ((eq system-type 'ms-dos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (concat "~" (user-login-name) "/_emacs"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 ((eq system-type 'vax-vms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 "sys$login:.emacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 (concat "~" (user-login-name) "/.emacs"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 (add-menu-button nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 ["Load .emacs"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 (progn (delete-menu-item '("Load .emacs"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 (load-user-init-file (user-login-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 "Help"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (add-hook 'before-init-hook 'maybe-add-init-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 ;;; The File and Edit menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (defvar put-buffer-names-in-file-menu t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 ;; The sensitivity part of this function could be done by just adding forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 ;; to evaluate to the menu items themselves; that would be marginally less
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 ;; efficient but not perceptibly so (I think). But in order to change the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 ;; names of the Undo menu item and the various things on the File menu item,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 ;; we need to use a hook.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 (defun file-menu-filter (menu-items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 "Incrementally update the file menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 This function changes the arguments and sensitivity of these File menu items:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 Delete Buffer has the name of the current buffer appended to it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 Print Buffer has the name of the current buffer appended to it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 Pretty-Print Buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 has the name of the current buffer appended to it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 Save has the name of the current buffer appended to it, and is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 sensitive only when the current buffer is modified.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 Revert Buffer has the name of the current buffer appended to it, and is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 sensitive only when the current buffer has a file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 Delete Frame sensitive only when there is more than one frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 The name of the current buffer is only appended to the menu items if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 `put-buffer-names-in-file-menu' is non-nil. This behavior is the default."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (let* ((bufname (buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (result menu-items) ; save pointer to start of menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 ;; the contents of the menu items in the file menu are destructively
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 ;; modified so that there is as little consing as possible. This is okay.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 ;; As soon as the result is returned, it is converted to widget_values
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 ;; inside lwlib and the lisp menu-items can be safely modified again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 (while (setq item (pop menu-items))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 (if (vectorp item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 (setq name (aref item 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 (and put-buffer-names-in-file-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 (member name '("Save" "Revert Buffer" "Print Buffer"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 "Pretty-Print Buffer" "Delete Buffer"))
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 195
diff changeset
774 (>= (length item) 4)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (aset item 3 bufname))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (and (string= "Save" name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (aset item 2 (buffer-modified-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (and (string= "Revert Buffer" name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 (aset item 2 (not (not (or buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 revert-buffer-function)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (and (string= "Delete Frame" name)
179
9ad43877534d Import from CVS: tag r20-3b16
cvs
parents: 171
diff changeset
782 (aset item 2 (not (eq (next-frame (selected-frame)
9ad43877534d Import from CVS: tag r20-3b16
cvs
parents: 171
diff changeset
783 'nomini 'window-system)
9ad43877534d Import from CVS: tag r20-3b16
cvs
parents: 171
diff changeset
784 (selected-frame)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (defun edit-menu-filter (menu-items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 "For use as an incremental menu construction filter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 This function changes the sensitivity of these Edit menu items:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 Cut sensitive only when emacs owns the primary X Selection.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 Copy sensitive only when emacs owns the primary X Selection.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 Clear sensitive only when emacs owns the primary X Selection.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 Paste sensitive only when there is an owner for the X Clipboard Selection.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 Undo sensitive only when there is undo information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 While in the midst of an undo, this is changed to \"Undo More\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 (let* (item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 (result menu-items) ; save pointer to head of list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 (x-dev (eq 'x (device-type (selected-device))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (emacs-owns-selection-p (and x-dev (x-selection-owner-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 (clipboard-exists-p (and x-dev (x-selection-exists-p 'CLIPBOARD)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 ;;; undo-available undoing-more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 ;;; (undo-info-available (not (null (and (not (eq t buffer-undo-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 ;;; (if (eq last-command 'undo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 ;;; (setq undoing-more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 ;;; (and (boundp 'pending-undo-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 ;;; pending-undo-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 ;;; buffer-undo-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 undo-name undo-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 ;; As with file-menu-filter, menu-items are destructively modified.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 ;; This is OK.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 (while (setq item (pop menu-items))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 (if (vectorp item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 (setq name (aref item 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 (and (member name '("Cut" "Copy" "Clear"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 (aset item 2 emacs-owns-selection-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 (and (string= name "Paste")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 (aset item 2 clipboard-exists-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 (and (member name '("Undo" "Undo More"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 ;; we could also do this with the third field of the item.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 (if (eq last-command 'undo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 (setq undo-name "Undo More"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 undo-state (not (null (and (boundp 'pending-undo-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 pending-undo-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (setq undo-name "Undo"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 undo-state (and (not (eq buffer-undo-list t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 (not (null
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 (or buffer-undo-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 (and (boundp 'pending-undo-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 pending-undo-list)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 (if buffer-read-only (setq undo-state nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 (aset item 0 undo-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 (aset item 2 undo-state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
844 ;;; The Bookmarks menu
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
845
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
846 (defun bookmark-menu-filter (menu-items)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
847 "*Build the bookmark jump submenu dynamically from all defined bookmarks."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
848 (if (bookmark-all-names)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
849 (mapcar
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
850 #'(lambda (bmk)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
851 (vector bmk `(bookmark-jump ',bmk) t)) (bookmark-all-names))
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
852 '(["No Bookmarks Set" nil nil])))
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
853
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
854 (defun bookmark-delete-filter (menu-items)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
855 "*Build the bookmark delete submenu dynamically from all defined bookmarks."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
856 (if (bookmark-all-names)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
857 (mapcar
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
858 #'(lambda (bmk)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
859 (vector bmk `(bookmark-delete ',bmk) t)) (bookmark-all-names))
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
860 '(["No Bookmarks Set" nil nil])))
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 155
diff changeset
861
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 ;;; The Buffers menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
864 (defgroup buffers-menu nil
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
865 "Customization of `Buffers' menu."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
866 :group 'menu)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
867
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
868 (defcustom buffers-menu-max-size 25
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 "*Maximum number of entries which may appear on the \"Buffers\" menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 If this is 10, then only the ten most-recently-selected buffers will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 shown. If this is nil, then all buffers will be shown. Setting this to
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
872 a large number or nil will slow down menu responsiveness."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
873 :type '(choice (const :tag "Show all" nil)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
874 (integer 10))
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
875 :group 'buffers-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
877 (defcustom complex-buffers-menu-p nil
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
878 "*If non-nil, the buffers menu will contain several commands.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
879 Commands will be presented as submenus of each buffer line. If this
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
880 is false, then there will be only one command: select that buffer."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
881 :type 'boolean
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
882 :group 'buffers-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
884 (defcustom buffers-menu-submenus-for-groups-p nil
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
885 "*If non-nil, the buffers menu will contain one submenu per group of buffers.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
886 The grouping function is specified in `buffers-menu-grouping-function'.
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
887 If this is an integer, do not build submenus if the number of buffers
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
888 is not larger than this value."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
889 :type '(choice (const :tag "No Subgroups" nil)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
890 (integer :tag "Max. submenus" 10)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
891 (sexp :format "%t\n" :tag "Allow Subgroups"))
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
892 :group 'buffers-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
894 (defcustom buffers-menu-switch-to-buffer-function 'switch-to-buffer
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 "*The function to call to select a buffer from the buffers menu.
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
896 `switch-to-buffer' is a good choice, as is `pop-to-buffer'."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
897 :type '(radio (function-item switch-to-buffer)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
898 (function-item pop-to-buffer)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
899 (function :tag "Other"))
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
900 :group 'buffers-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
902 (defcustom buffers-menu-omit-function 'buffers-menu-omit-invisible-buffers
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
903 "*If non-nil, a function specifying the buffers to omit from the buffers menu.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 This is passed a buffer and should return non-nil if the buffer should be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 omitted. The default value `buffers-menu-omit-invisible-buffers' omits
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 buffers that are normally considered \"invisible\" (those whose name
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
907 begins with a space)."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
908 :type '(choice (const :tag "None" nil)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
909 function)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
910 :group 'buffers-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
912 (defcustom buffers-menu-format-buffer-line-function 'format-buffers-menu-line
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 "*The function to call to return a string to represent a buffer in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 buffers menu. The function is passed a buffer and should return a string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 The default value `format-buffers-menu-line' just returns the name of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 the buffer. Also check out `slow-format-buffers-menu-line' which
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
917 returns a whole bunch of info about a buffer."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
918 :type 'function
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
919 :group 'buffers-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
921 (defcustom buffers-menu-sort-function
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 'sort-buffers-menu-by-mode-then-alphabetically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 "*If non-nil, a function to sort the list of buffers in the buffers menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 It will be passed two arguments (two buffers to compare) and should return
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 T if the first is \"less\" than the second. One possible value is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 `sort-buffers-menu-alphabetically'; another is
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
927 `sort-buffers-menu-by-mode-then-alphabetically'."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
928 :type '(choice (const :tag "None" nil)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
929 function)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
930 :group 'buffers-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
932 (defcustom buffers-menu-grouping-function
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 'group-buffers-menu-by-mode-then-alphabetically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 "*If non-nil, a function to group buffers in the buffers menu together.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 It will be passed two arguments, successive members of the sorted buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 list after being passed through `buffers-menu-sort-function'. It should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 return non-nil if the second buffer begins a new group. The return value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 should be the name of the old group, which may be used in hierarchical
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 buffers menus. The last invocation of the function contains nil as the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 second argument, so that the name of the last group can be determined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 The sensible values of this function are dependent on the value specified
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
943 for `buffers-menu-sort-function'."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
944 :type '(choice (const :tag "None" nil)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
945 function)
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 193
diff changeset
946 :group 'buffers-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 (defun buffers-menu-omit-invisible-buffers (buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 "For use as a value of `buffers-menu-omit-function'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 Omits normally invisible buffers (those whose name begins with a space)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 (not (null (string-match "\\` " (buffer-name buf)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 (defun sort-buffers-menu-alphabetically (buf1 buf2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 "For use as a value of `buffers-menu-sort-function'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 Sorts the buffers in alphabetical order by name, but puts buffers beginning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 with a star at the end of the list."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 (let* ((nam1 (buffer-name buf1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 (nam2 (buffer-name buf2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 (star1p (not (null (string-match "\\`*" nam1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 (star2p (not (null (string-match "\\`*" nam2)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 (if (not (eq star1p star2p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 (not star1p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 (string-lessp nam1 nam2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 "For use as a value of `buffers-menu-sort-function'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 Sorts first by major mode and then alphabetically by name, but puts buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 beginning with a star at the end of the list."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 (let* ((nam1 (buffer-name buf1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (nam2 (buffer-name buf2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 (star1p (not (null (string-match "\\`*" nam1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 (star2p (not (null (string-match "\\`*" nam2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 (mode1 (symbol-value-in-buffer 'major-mode buf1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 (mode2 (symbol-value-in-buffer 'major-mode buf2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 (cond ((not (eq star1p star2p)) (not star1p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 ((and star1p star2p (string-lessp nam1 nam2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 ((string-lessp mode1 mode2) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 ((string-lessp mode2 mode1) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 (t (string-lessp nam1 nam2)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 ;; this version is too slow on some machines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 (defun slow-format-buffers-menu-line (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 "For use as a value of `buffers-menu-format-buffer-line-function'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 This returns a string containing a bunch of info about the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 (format "%s%s %-19s %6s %-15s %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 (if (buffer-modified-p buffer) "*" " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 (if (symbol-value-in-buffer 'buffer-read-only buffer) "%" " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 (buffer-name buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 (buffer-size buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 (symbol-value-in-buffer 'mode-name buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 (or (buffer-file-name buffer) "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 (defun format-buffers-menu-line (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 "For use as a value of `buffers-menu-format-buffer-line-function'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 This just returns the buffer's name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 (buffer-name buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 "For use as a value of `buffers-menu-grouping-function'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 This groups buffers by major mode. It only really makes sense if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 `buffers-menu-sorting-function' is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 `sort-buffers-menu-by-mode-then-alphabetically'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 (cond ((string-match "\\`*" (buffer-name buf1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 (and (null buf2) "*Misc*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 ((or (null buf2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 (string-match "\\`*" (buffer-name buf2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 (not (eq (symbol-value-in-buffer 'major-mode buf1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 (symbol-value-in-buffer 'major-mode buf2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 (symbol-value-in-buffer 'mode-name buf1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 (defun buffer-menu-save-buffer (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 (save-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 (defun buffer-menu-write-file (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 (write-file (read-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 (format "Write %s to file: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 (buffer-name (current-buffer)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 (defsubst build-buffers-menu-internal (buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 (let (name line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 (mapcar
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1027 #'(lambda (buffer)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1028 (if (eq buffer t)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1029 "---"
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1030 (setq line (funcall buffers-menu-format-buffer-line-function
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1031 buffer))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1032 (if complex-buffers-menu-p
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1033 (delq nil
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1034 (list line
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1035 (vector "Switch to Buffer"
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1036 (list buffers-menu-switch-to-buffer-function
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1037 (setq name (buffer-name buffer)))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1038 t)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1039 (if (eq buffers-menu-switch-to-buffer-function
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1040 'switch-to-buffer)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1041 (vector "Switch to Buffer, Other Frame"
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1042 (list 'switch-to-buffer-other-frame
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1043 (setq name (buffer-name buffer)))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1044 t)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1045 nil)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1046 (if (and (buffer-modified-p buffer)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1047 (buffer-file-name buffer))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1048 (vector "Save Buffer"
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1049 (list 'buffer-menu-save-buffer name) t)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1050 ["Save Buffer" nil nil]
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1051 )
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1052 (vector "Save As..."
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1053 (list 'buffer-menu-write-file name) t)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1054 (vector "Delete Buffer" (list 'kill-buffer name)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1055 t)))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1056 ;; ### We don't want buffer names to be translated,
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1057 ;; ### so we put the buffer name in the suffix.
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1058 ;; ### Also, avoid losing with non-ASCII buffer names.
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1059 ;; ### We still lose, however, if complex-buffers-menu-p. --mrb
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1060 (vector ""
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1061 (list buffers-menu-switch-to-buffer-function
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1062 (buffer-name buffer))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1063 t line))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 buffers)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 (defun buffers-menu-filter (menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 "This is the menu filter for the top-level buffers \"Buffers\" menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 It dynamically creates a list of buffers to use as the contents of the menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 Only the most-recently-used few buffers will be listed on the menu, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 efficiency reasons. You can control how many buffers will be shown by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 setting `buffers-menu-max-size'. You can control the text of the menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 items by redefining the function `format-buffers-menu-line'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 (let ((buffers (delete-if buffers-menu-omit-function (buffer-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 (and (integerp buffers-menu-max-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 (> buffers-menu-max-size 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 (> (length buffers) buffers-menu-max-size)
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1077 ;; shorten list of buffers (not with submenus!)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1078 (not (and buffers-menu-grouping-function
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1079 buffers-menu-submenus-for-groups-p))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 (setcdr (nthcdr buffers-menu-max-size buffers) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 (if buffers-menu-sort-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 (setq buffers (sort buffers buffers-menu-sort-function)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 (if (and buffers-menu-grouping-function
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1084 buffers-menu-submenus-for-groups-p
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1085 (or (not (integerp buffers-menu-submenus-for-groups-p))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1086 (> (length buffers) buffers-menu-submenus-for-groups-p)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 (let (groups groupnames current-group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 (mapl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 #'(lambda (sublist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 (let ((groupname (funcall buffers-menu-grouping-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 (car sublist) (cadr sublist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 (setq current-group (cons (car sublist) current-group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 (if groupname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 (setq groups (cons (nreverse current-group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 groups))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 (setq groupnames (cons groupname groupnames))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 (setq current-group nil)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 (setq buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 (mapcar*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 #'(lambda (groupname group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 (cons groupname (build-buffers-menu-internal group)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 (nreverse groupnames)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 (nreverse groups))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 (if buffers-menu-grouping-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108 (setq buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 (mapcon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 #'(lambda (sublist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 (cond ((funcall buffers-menu-grouping-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 (car sublist) (cadr sublist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 (list (car sublist) t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 (t (list (car sublist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 buffers))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 ;; remove a trailing separator.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 (and (>= (length buffers) 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 (let ((lastcdr (nthcdr (- (length buffers) 2) buffers)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 (if (eq t (cadr lastcdr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 (setcdr lastcdr nil))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 (setq buffers (build-buffers-menu-internal buffers)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 (append menu buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1125 (defun language-environment-menu-filter (menu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1126 "This is the menu filter for the \"Language Environment\" submenu."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1127 (mapcar (lambda (env-sym)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1128 `[ ,(capitalize (symbol-name env-sym))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1129 (set-language-environment ',env-sym) t])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1130 language-environment-list))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 ;;; The Options menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1135 (defvar options-save-faces nil
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1136 "if t, save-options will save all the face information.
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1137 Set to nil to avoid this. This is recommended on XEmacs 19.15
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1138 and above as we have a much more powerful (read: working) way
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1139 of changing and saving faces via cu-edit-faces.el & custom.el.")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1140
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 (defconst options-menu-saved-forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 ;; This is really quite a kludge, but it gets the job done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 ;; remember that we have to conditionalize on default features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 ;; both in the forms to evaluate and in the forms output to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 ;; .emacs, in case the .emacs is loaded into an XEmacs with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 ;; different features.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 (purecopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 ;; Editing Options menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 ;; put case-fold-search first to defeat a bug in the backquote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 ;; processing mechanism. Feh!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 case-fold-search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 `(setq-default overwrite-mode ,(default-value 'overwrite-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 (if (default-value 'overwrite-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 '(overwrite-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 `(setq-default case-fold-search ,(default-value 'case-fold-search))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 case-replace
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1159 (if (and (boundp 'pending-delete-mode)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1160 pending-delete-mode)
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 195
diff changeset
1161 '(pending-delete-mode 1))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 zmacs-regions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 mouse-yank-at-point
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
1164 require-final-newline
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
1165 next-line-add-newlines
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 ;; General Options menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 teach-extended-commands-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 ;; (#### not actually on Options menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 teach-extended-commands-timeout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 debug-on-error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 debug-on-quit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 ;; Printing Options menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 lpr-switches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 ps-print-color-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 ps-paper-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 ;; Other Window Location
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 get-frame-for-buffer-default-instance-limit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 temp-buffer-show-function
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
1182 (if gnuserv-frame
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 76
diff changeset
1183 '(setq gnuserv-frame (selected-frame)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 ;; Syntax Highlighting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 font-lock-auto-fontify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 font-lock-use-fonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 font-lock-use-colors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 font-lock-maximum-decoration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 font-lock-maximum-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 ;; (#### the next two not on Options menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 font-lock-mode-enable-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 font-lock-mode-disable-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 ;; #### - this structure is clearly broken. There's no way to ever
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 ;; un-require font-lock via the menus. --Stig
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 (if (featurep 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 '(require 'font-lock))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 (if (and (boundp 'font-lock-mode-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 (memq 'turn-on-fast-lock font-lock-mode-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 '(add-hook 'font-lock-mode-hook 'turn-on-fast-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 '(remove-hook 'font-lock-mode-hook 'turn-on-fast-lock))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 (if (and (boundp 'font-lock-mode-hook)
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1203 (memq 'turn-on-lazy-shot font-lock-mode-hook))
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1204 '(add-hook 'font-lock-mode-hook 'turn-on-lazy-shot)
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1205 '(remove-hook 'font-lock-mode-hook 'turn-on-lazy-shot))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 ;; Paren Highlighting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 (if paren-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 `(progn (require 'paren) (paren-set-mode ',paren-mode)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 ;; For specifiers, we only save global settings since the others
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 ;; will belong to objects which only exist during this session.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 ;; Frame Appearance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 (if (featurep 'scrollbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 `(if (featurep 'scrollbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 (add-spec-list-to-specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 scrollbar-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 ',(specifier-spec-list scrollbar-width 'global))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 (add-spec-list-to-specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 scrollbar-height
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 ',(specifier-spec-list scrollbar-height 'global)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 `(add-spec-list-to-specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 modeline-shadow-thickness
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 ',(specifier-spec-list modeline-shadow-thickness 'global))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 `(setq-default truncate-lines ,(default-value 'truncate-lines))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 bar-cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 (if (and (boundp 'blink-cursor-mode) blink-cursor-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 '(blink-cursor-mode t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 ;; Menubar Appearance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 buffers-menu-max-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 complex-buffers-menu-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 buffers-menu-sort-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 buffers-menu-grouping-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 buffers-menu-submenus-for-groups-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 font-menu-ignore-scaled-fonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 font-menu-this-frame-only-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 ;; Toolbar Appearance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 (if (featurep 'toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 `(if (featurep 'toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 (set-default-toolbar-position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 ',(default-toolbar-position))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 (add-spec-list-to-specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 default-toolbar-visible-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 ',(specifier-spec-list default-toolbar-visible-p 'global))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 (add-spec-list-to-specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 toolbar-buttons-captioned-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 ',(specifier-spec-list toolbar-buttons-captioned-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 'global)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
1255 ;; mouse
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
1256 mouse-avoidance-mode
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
1257
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 ;; Open URLs With
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 browse-url-browser-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 ;; Now save all faces.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 ;; Setting this in lisp conflicts with X resources. Bad move. --Stig
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 ;; (list 'set-face-font ''default (face-font-name 'default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 ;; (list 'set-face-font ''modeline (face-font-name 'modeline))
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1266 (if options-save-faces
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1267 (cons 'progn
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1268 (mapcar #'(lambda (face)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1269 `(make-face ',face))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1270 (save-options-non-customized-face-list))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1271
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1272 (if options-save-faces
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1273 (cons 'progn
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1274 (apply 'nconc
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1275 (mapcar
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1276 #'(lambda (face)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1277 (delq nil
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1278 (mapcar
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1279 #'(lambda (property)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1280 (if (specifier-spec-list
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1281 (face-property face property))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1282 `(add-spec-list-to-specifier
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1283 (face-property ',face ',property)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1284 ',(save-options-specifier-spec-list
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1285 face property))))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1286 (delq 'display-table
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1287 (copy-sequence
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
1288 built-in-face-specifiers)))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1289 (save-options-non-customized-face-list)))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1290
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1291 ;; Mule-specific:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1292 (if (featurep 'mule)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1293 `(if (featurep 'mule)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
1294 (set-language-environment ',(current-language-environment))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 "The variables to save; or forms to evaluate to get forms to write out.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 This is used by `save-options-menu-settings' and should mirror the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 options listed in the Options menu.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1300 (defun save-options-non-customized-face-list ()
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1301 "This function will return a list of all faces that have not been
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1302 'customized'."
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1303 (delq nil (mapcar '(lambda (face)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1304 (unless (get face 'saved-face)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1305 face))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1306 (face-list))))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1307
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 (defun save-options-specifier-spec-list (face property)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 (if (not (or (eq property 'font) (eq property 'color)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 (specifier-spec-list (face-property face property) 'global)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 (let* ((retlist (specifier-spec-list (face-property face property)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 'global))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 (entry (cdr (car retlist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 (while entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 (setq item (car entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 (if (eq property 'font)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 (if (font-instance-p (cdr item))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 (setcdr item (font-instance-name (cdr item))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 (if (color-instance-p (cdr item))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321 (setcdr item (color-instance-name (cdr item)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 (setq entry (cdr entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 retlist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 (defvar save-options-init-file nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 "File into which to save forms to load the options file (nil for .emacs).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 Normally this is nil, which means save into your .emacs file (the value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 of `user-init-file'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 (defvar save-options-file ".xemacs-options"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 "File to save options into.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 This file is loaded from your .emacs file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 If this is a relative filename, it is put into the same directory as your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 .emacs file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 (defun save-options-menu-settings ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337 "Saves the current settings of the `Options' menu to your `.emacs' file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 ;; we compute the actual filenames now because x-menubar is loaded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 ;; at dump time, when the identity of the user running XEmacs is not known.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 (let* ((actual-save-options-init-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 (or save-options-init-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 (and (not (equal user-init-file ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 user-init-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 (and (eq system-type 'ms-dos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 (concat "~" (user-login-name) "/_emacs"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 (concat "~" (user-login-name) "/.emacs")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 (actual-save-options-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 (abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351 save-options-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352 (file-name-directory actual-save-options-init-file))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1353 ;; Don't hack-homedir in abbreviate-file-name. This will
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1354 ;; cause an incorrect expansion if the save-options variables
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1355 ;; have ~ in them.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1356 ))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 (init-output-buffer (find-file-noselect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 actual-save-options-init-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 init-output-marker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 (options-output-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 (find-file-noselect actual-save-options-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 options-output-marker)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 (set-buffer options-output-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 (setq options-output-marker (point-marker)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 ;; run with current-buffer unchanged so that variables are evaluated in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 ;; the current context, instead of in the context of the ".emacs" buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 ;; or the ".xemacs-options" buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 ;; first write out .xemacs-options.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 (let ((standard-output options-output-marker))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 (princ ";; -*- Mode: Emacs-Lisp -*-\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 (princ "(setq options-file-xemacs-version '(")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 (princ emacs-major-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 (princ " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 (princ emacs-minor-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 (princ "))\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 (let ((print-readably t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 (print-escape-newlines t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 (mapcar #'(lambda (var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 (princ " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 (if (symbolp var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 (prin1 (list 'setq-default var
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 (let ((val (symbol-value var)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 (if (or (memq val '(t nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 (and (not (symbolp val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 (not (consp val))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 val
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 (list 'quote val)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 (setq var (eval var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 (cond ((eq (car-safe var) 'progn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 (while (setq var (cdr var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 (prin1 (car var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 (princ "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 (if (cdr var) (princ " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 (var
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 (prin1 var))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 (if var (princ "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 options-menu-saved-forms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 (set-marker options-output-marker nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 (set-buffer options-output-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 (save-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 ;; then fix .emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 (set-buffer init-output-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416 ;; Find and delete the previously saved data, and position to write.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 (if (re-search-forward "^;; Options Menu Settings *\n" nil 'move)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 (let ((p (match-beginning 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 (goto-char p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 (or (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 "^;; End of Options Menu Settings *\\(\n\\|\\'\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 (error "can't find END of saved state in .emacs"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 (delete-region p (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 (insert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 (setq init-output-marker (point-marker)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431 (let ((standard-output init-output-marker))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 (princ ";; Options Menu Settings\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 (princ ";; =====================\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 (princ "(cond\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 (princ " ((and (string-match \"XEmacs\" emacs-version)\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 (princ " (boundp 'emacs-major-version)\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 (princ " (or (and\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 (princ " (= emacs-major-version 19)\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 (princ " (>= emacs-minor-version 14))\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 (princ " (= emacs-major-version 20))\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 (princ " (fboundp 'load-options-file))\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 (princ " (load-options-file \"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 (princ actual-save-options-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 (princ "\")))\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 (princ ";; ============================\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 (princ ";; End of Options Menu Settings\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 (set-marker init-output-marker nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 (set-buffer init-output-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 (save-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 (set-menubar default-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 ;;; Popup menus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 (defconst default-popup-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 '("XEmacs Commands"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 :filter edit-menu-filter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 ["Undo" advertised-undo t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 ["Cut" x-kill-primary-selection t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 ["Copy" x-copy-primary-selection t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 ["Paste" x-yank-clipboard-selection t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 ["Clear" x-delete-primary-selection t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 ["Select Block" mark-paragraph t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 ["Split Window" (split-window) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 ["Unsplit Window" delete-other-windows t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 (defvar global-popup-menu nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 "The global popup menu. This is present in all modes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 See the function `popup-menu' for a description of menu syntax.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 (defvar mode-popup-menu nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 "The mode-specific popup menu. Automatically buffer local.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 This is appended to the default items in `global-popup-menu'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 See the function `popup-menu' for a description of menu syntax.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 (make-variable-buffer-local 'mode-popup-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 ;; In an effort to avoid massive menu clutter, this mostly worthless menu is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 ;; superceded by any local popup menu...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 (setq-default mode-popup-menu default-popup-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 (defvar activate-popup-menu-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 "Function or functions run before a mode-specific popup menu is made visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 These functions are called with no arguments, and should interrogate and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 modify the value of `global-popup-menu' or `mode-popup-menu' as desired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 Note: this hook is only run if you use `popup-mode-menu' for activating the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 global and mode-specific commands; if you have your own binding for button3,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 this hook won't be run.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 (defun popup-mode-menu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 "Pop up a menu of global and mode-specific commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 The menu is computed by combining `global-popup-menu' and `mode-popup-menu'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 (interactive "@_")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 (run-hooks 'activate-popup-menu-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 (popup-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 (cond ((and global-popup-menu mode-popup-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 (check-menu-syntax mode-popup-menu)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1504 (let* ((title (car mode-popup-menu))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1505 (items (cdr mode-popup-menu))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1506 filters)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1507 ;; Strip keywords from local menu for attaching them at the top
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
1508 (while (and items
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
1509 (symbolp (car items)))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1510 (setq items (append filters (list (car items))))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1511 (setq items (cdr items)))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1512 ;; If filters contains a keyword already present in
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1513 ;; `global-popup-menu' you will probably lose.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1514 (append (list (car global-popup-menu))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1515 filters
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1516 (cdr global-popup-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 '("---" "---")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 (if popup-menu-titles (list title))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 (if popup-menu-titles '("---" "---"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 items)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 (or mode-popup-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 global-popup-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 (error "No menu here."))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 (defun popup-buffer-menu (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 (let ((window (and (event-over-text-area-p event) (event-window event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 (bmenu nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 (or window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 (error "Pointer must be in a normal window"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 (select-window window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 (if current-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 (setq bmenu (assoc "Buffers" current-menubar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 (if (null bmenu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 (setq bmenu (assoc "Buffers" default-menubar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 (if (null bmenu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 (error "Can't find the Buffers menu"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 (popup-menu bmenu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 (defun popup-menubar-menu (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 "Pop up a copy of menu that also appears in the menubar"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 ;; by Stig@hackvan.com
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 (let ((window (and (event-over-text-area-p event) (event-window event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 popup-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 (or window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 (error "Pointer must be in a normal window"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 (select-window window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 (and current-menubar (run-hooks 'activate-menubar-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 ;; ##### Instead of having to copy this just to safely get rid of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 ;; any nil what we should really do is fix up the internal menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 ;; code to just ignore nil if generating a popup menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 (setq popup-menubar (delete nil (copy-sequence (or current-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 default-menubar))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 (popup-menu (cons "Menubar Menu" popup-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 (global-set-key 'button3 'popup-mode-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 ;; shift button3 and shift button2 are reserved for Hyperbole
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 (global-set-key '(meta control button3) 'popup-buffer-menu)
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1563 ;; The following command is way too dangerous with Custom.
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 203
diff changeset
1564 ;; (global-set-key '(meta shift button3) 'popup-menubar-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 ;; Here's a test of the cool new menu features (from Stig).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 ;(setq mode-popup-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 ; '("Test Popup Menu"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 ; :filter cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 ; ["this item won't appear because of the menu filter" ding t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 ; "--:singleLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 ; "singleLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 ; "--:doubleLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 ; "doubleLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 ; "--:singleDashedLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 ; "singleDashedLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 ; "--:doubleDashedLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 ; "doubleDashedLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 ; "--:noLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 ; "noLine"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 ; "--:shadowEtchedIn"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 ; "shadowEtchedIn"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 ; "--:shadowEtchedOut"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 ; "shadowEtchedOut"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 ; "--:shadowDoubleEtchedIn"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 ; "shadowDoubleEtchedIn"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 ; "--:shadowDoubleEtchedOut"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 ; "shadowDoubleEtchedOut"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 ; "--:shadowEtchedInDash"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 ; "shadowEtchedInDash"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 ; "--:shadowEtchedOutDash"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 ; "shadowEtchedOutDash"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 ; "--:shadowDoubleEtchedInDash"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 ; "shadowDoubleEtchedInDash"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 ; "--:shadowDoubleEtchedOutDash"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 ; "shadowDoubleEtchedOutDash"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 ; ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
1600 (defun xemacs-splash-buffer ()
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
1601 "Redisplay XEmacs splash screen in a buffer."
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
1602 (interactive)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
1603 (let ((buffer (get-buffer-create "*Splash*")))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
1604 (set-buffer buffer)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
1605 (erase-buffer buffer)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
1606 (startup-splash-frame)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
1607 (pop-to-buffer buffer)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 74
diff changeset
1608 (delete-other-windows)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610 (provide 'x-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 ;;; x-menubar.el ends here.