annotate lisp/x-toolbar.el @ 221:6c0ae1f9357f r20-4b9

Import from CVS: tag r20-4b9
author cvs
date Mon, 13 Aug 2007 10:10:02 +0200
parents 262b8bb4a523
children 2c611d1463a6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1 ;;; x-toolbar.el -- Runtime initialization of XEmacs toolbar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
2
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
4 ;; Copyright (C) 1994 Andy Piper <andyp@parallax.demon.co.uk>
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995 Board of Trustees, University of Illinois
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
6 ;; Copyright (C) 1996 Ben Wing <wing@666.com>
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
7
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
8 ;; Maintainer: XEmacs development team
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
9 ;; Keywords: frames, dumped
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
10
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
12
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
16 ;; any later version.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
17
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
21 ;; General Public License for more details.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
22
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
26 ;; Boston, MA 02111-1307, USA.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
27
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
28 ;;; Synched up: Not in FSF
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
29
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
30 ;;; Commentary:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
31
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
32 ;; This file is dumped with XEmacs (when X and toolbar support is compiled in).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
33
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
34 ;; Miscellaneous toolbar functions, useful for users to redefine, in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
35 ;; order to get different behaviour.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
36
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
37 ;;; Code:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
38
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
39 ;; Suppress warning message from bytecompiler
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
40 (eval-when-compile
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
41 (defvar pending-delete-mode))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
42
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
43 (defgroup toolbar nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
44 "Configure XEmacs Toolbar functions and properties"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
45 :group 'environment)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
46
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
47
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
48 (defun toolbar-not-configured ()
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
49 (interactive)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
50 ;; Note: we don't use `susbtitute-command-keys' here, because
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
51 ;; Customize is bound to `C-h C' by default, and that binding is not
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
52 ;; familiar to people. This is more descriptive.
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
53 (error
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
54 "Configure the item via `M-x customize RET toolbar RET'"))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
55
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
56 (defcustom toolbar-open-function 'find-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
57 "*Function to call when the open icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
58 :type '(radio (function-item find-file)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
59 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
60 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
61
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
62 (defun toolbar-open ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
63 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
64 (call-interactively toolbar-open-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
65
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
66 (defcustom toolbar-dired-function 'dired
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
67 "*Function to call when the dired icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
68 :type '(radio (function-item dired)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
69 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
70 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
71
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
72 (defun toolbar-dired ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
73 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
74 (call-interactively toolbar-dired-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
75
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
76 (defcustom toolbar-save-function 'save-buffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
77 "*Function to call when the save icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
78 :type '(radio (function-item save-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
79 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
80 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
81
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
82 (defun toolbar-save ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
83 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
84 (call-interactively toolbar-save-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
85
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
86 (defcustom toolbar-print-function 'lpr-buffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
87 "*Function to call when the print icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
88 :type '(radio (function-item lpr-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
89 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
90 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
91
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
92 (defun toolbar-print ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
93 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
94 (call-interactively toolbar-print-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
95
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
96 (defcustom toolbar-cut-function 'x-kill-primary-selection
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
97 "*Function to call when the cut icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
98 :type '(radio (function-item x-kill-primary-selection)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
99 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
100 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
101
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
102 (defun toolbar-cut ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
103 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
104 (call-interactively toolbar-cut-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
105
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
106 (defcustom toolbar-copy-function 'x-copy-primary-selection
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
107 "*Function to call when the copy icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
108 :type '(radio (function-item x-copy-primary-selection)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
109 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
110 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
111
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
112 (defun toolbar-copy ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
113 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
114 (call-interactively toolbar-copy-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
115
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
116 (defcustom toolbar-paste-function 'x-yank-clipboard-selection
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
117 "*Function to call when the paste icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
118 :type '(radio (function-item x-yank-clipboard-selection)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
119 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
120 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
121
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
122 (defun toolbar-paste ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
123 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
124 ;; This horrible kludge is for pending-delete to work correctly.
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
125 (and (boundp 'pending-delete-mode)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
126 pending-delete-mode
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
127 (let ((this-command toolbar-paste-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
128 (pending-delete-pre-hook)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
129 (call-interactively toolbar-paste-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
130
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
131 (defcustom toolbar-undo-function 'undo
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
132 "*Function to call when the undo icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
133 :type '(radio (function-item undo)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
134 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
135 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
136
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
137 (defun toolbar-undo ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
138 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
139 (call-interactively toolbar-undo-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
140
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
141 (defcustom toolbar-replace-function 'query-replace
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
142 "*Function to call when the replace icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
143 :type '(radio (function-item query-replace)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
144 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
145 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
146
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
147 (defun toolbar-replace ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
148 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
149 (call-interactively toolbar-replace-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
150
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
151 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
152 ;; toolbar ispell variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
153 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
154
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
155 (defun toolbar-ispell-internal ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
156 (interactive)
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
157 (if (region-active-p)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
158 (ispell-region (region-beginning) (region-end))
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
159 (ispell-buffer)))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
160
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
161 (defcustom toolbar-ispell-function 'toolbar-ispell-internal
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
162 "*Function to call when the ispell icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
163 :type '(radio (function-item toolbar-ispell-internal)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
164 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
165 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
166
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
167 (defun toolbar-ispell ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
168 "Intelligently spell the region or buffer."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
169 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
170 (call-interactively toolbar-ispell-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
171
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
172 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
173 ;; toolbar mail variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
174 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
175
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
176 ;; This used to be a macro that expanded its arguments to a form that
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
177 ;; called `call-process'. With the advent of customize, it's better
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
178 ;; to have it as a defun, to make customization easier.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
179 (defun toolbar-external (process &rest args)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
180 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
181 (apply 'call-process process nil 0 nil args))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
182
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
183 (defcustom toolbar-mail-commands-alist
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
184 `((not-configured . toolbar-not-configured)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
185 (vm . vm)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
186 (gnus . gnus-no-server)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
187 (rmail . rmail)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
188 (mh . mh-rmail)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
189 (pine . (toolbar-external "xterm" "-e" "pine")) ; *gag*
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
190 (elm . (toolbar-external "xterm" "-e" "elm"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
191 (mutt . (toolbar-external "xterm" "-e" "mutt"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
192 (exmh . (toolbar-external "exmh"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
193 (netscape . (toolbar-external "netscape" "mailbox:")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
194 "*Alist of mail readers and their commands.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
195 The car of each alist element is the mail reader, and the cdr is the form
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
196 used to start it."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
197 :type '(repeat (cons :format "%v"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
198 (symbol :tag "Mailer") (function :tag "Start with")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
199 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
200
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
201 (defcustom toolbar-mail-reader 'not-configured
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
202 "*Mail reader toolbar will invoke.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
203 The legal values are the keys from `toolbar-mail-command-alist', which
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
204 should be used to add new mail readers.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
205 Mail readers known by default are vm, gnus, rmail, mh, pine, elm,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
206 mutt, exmh and netscape."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
207 :type '(choice (const :tag "Not Configured" not-configured)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
208 (const vm) (const gnus) (const rmail) (const mh)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
209 (const pine) (const elm) (const mutt) (const exmh)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
210 (const netscape)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
211 (symbol :tag "Other"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
212 :validate (lambda (wid)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
213 (if (assq (widget-value wid)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
214 toolbar-mail-commands-alist)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
215 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
216 (widget-put wid :error
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
217 "Unknown mail reader")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
218 wid))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
219 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
220
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
221
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
222 (defun toolbar-mail ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
223 "Run mail in a separate frame."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
224 (interactive)
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
225 (let ((command (cdr (assq toolbar-mail-reader toolbar-mail-commands-alist))))
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
226 (or command
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
227 (error "Uknown mail reader %s" toolbar-mail-reader))
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
228 (if (symbolp command)
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
229 (call-interactively command)
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
230 (eval command))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
231
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
232 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
233 ;; toolbar info variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
234 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
235
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
236 (defcustom toolbar-info-use-separate-frame t
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
237 "*Whether Info is invoked in a separate frame."
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
238 :type 'boolean
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
239 :group 'toolbar)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
240
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
241 (defcustom toolbar-info-frame-plist
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
242 ;; Info pages are 80 characters wide, so it makes a good default.
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
243 `(width 80 ,@(let ((h (plist-get default-frame-plist 'height)))
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
244 (and h `(height ,h))))
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
245 "*The properties of the frame in which news is displayed."
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
246 :type 'plist
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
247 :group 'info)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
248
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
249 (define-obsolete-variable-alias 'Info-frame-plist
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
250 'toolbar-info-frame-plist)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
251
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
252 (defvar toolbar-info-frame nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
253 "The frame in which info is displayed.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
254
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
255 (defun toolbar-info ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
256 "Run info in a separate frame."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
257 (interactive)
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
258 (when toolbar-info-use-separate-frame
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
259 (cond ((or (not toolbar-info-frame)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
260 (not (frame-live-p toolbar-info-frame)))
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
261 ;; We used to raise frame here, but it's a bad idea,
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
262 ;; because raising is a matter of WM policy. However, we
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
263 ;; *must* select it, to ensure that the info buffer goes to
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
264 ;; the right frame.
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
265 (setq toolbar-info-frame (make-frame toolbar-info-frame-plist))
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
266 (select-frame toolbar-info-frame))
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
267 (t
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
268 ;; However, if the frame already exists, and the user
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
269 ;; clicks on info, it's OK to raise it.
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
270 (select-frame toolbar-info-frame)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
271 (raise-frame toolbar-info-frame)))
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
272 (when (frame-iconified-p toolbar-info-frame)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
273 (deiconify-frame toolbar-info-frame)))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
274 (info))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
275
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
276 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
277 ;; toolbar debug variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
278 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
279
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
280 (defun toolbar-debug ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
281 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
282 (if (featurep 'eos-debugger)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
283 (call-interactively 'eos::start-debugger)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
284 (require 'gdbsrc)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
285 (call-interactively 'gdbsrc)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
286
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
287 (defvar compile-command)
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
288 (defvar toolbar-compile-already-run nil)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
289
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
290 (defun toolbar-compile ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
291 "Run compile without having to touch the keyboard."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
292 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
293 (require 'compile)
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
294 (if toolbar-compile-already-run
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
295 (compile compile-command)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
296 (setq toolbar-compile-already-run t)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
297 (popup-dialog-box
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
298 `(,(concat "Compile:\n " compile-command)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
299 ["Compile" (compile compile-command) t]
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
300 ["Edit command" compile t]
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
301 nil
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
302 ["Cancel" (message "Quit") t]))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
303
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
304 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
305 ;; toolbar news variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
306 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
307
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
308 (defcustom toolbar-news-commands-alist
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
309 `((not-configured . toolbar-not-configured)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
310 (gnus . toolbar-gnus) ; M-x all-hail-gnus
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
311 (rn . (toolbar-external "xterm" "-e" "rn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
312 (nn . (toolbar-external "xterm" "-e" "nn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
313 (trn . (toolbar-external "xterm" "-e" "trn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
314 (xrn . (toolbar-external "xrn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
315 (slrn . (toolbar-external "xterm" "-e" "slrn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
316 (pine . (toolbar-external "xterm" "-e" "pine")) ; *gag*
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
317 (tin . (toolbar-external "xterm" "-e" "tin")) ; *gag*
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
318 (netscape . (toolbar-external "netscape" "news:")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
319 "*Alist of news readers and their commands.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
320 The car of each alist element the pair is the news reader, and the cdr
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
321 is the form used to start it."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
322 :type '(repeat (cons :format "%v"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
323 (symbol :tag "Reader") (sexp :tag "Start with")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
324 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
325
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
326 (defcustom toolbar-news-reader 'not-configured
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
327 "*News reader toolbar will invoke.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
328 The legal values are the keys from `toolbar-news-command-alist', which should
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
329 be used to add new news readers.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
330 Newsreaders known by default are gnus, rn, nn, trn, xrn, slrn, pine
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
331 and netscape."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
332 :type '(choice (const :tag "Not Configured" not-configured)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
333 (const gnus) (const rn) (const nn) (const trn)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
334 (const xrn) (const slrn) (const pine) (const tin)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
335 (const netscape)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
336 (symbol :tag "Other"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
337 :validate (lambda (wid)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
338 (if (assq (widget-value wid)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
339 toolbar-news-commands-alist)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
340 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
341 (widget-put wid :error
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
342 "Unknown news reader")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
343 wid))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
344 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
345
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
346 (defcustom toolbar-news-use-separate-frame t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
347 "*Whether Gnus is invoked in a separate frame."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
348 :type 'boolean
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
349 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
350
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
351 (defvar toolbar-news-frame nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
352 "The frame in which news is displayed.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
353
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
354 (defcustom toolbar-news-frame-plist nil
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
355 "*The properties of the frame in which news is displayed."
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
356 :type 'plist
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
357 :group 'toolbar)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
358
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
359 (define-obsolete-variable-alias 'toolbar-news-frame-properties
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
360 'toolbar-news-frame-plist)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
361
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
362 (defun toolbar-gnus ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
363 "Run Gnus in a separate frame."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
364 (interactive)
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
365 (if (not toolbar-news-use-separate-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
366 (gnus)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
367 (unless (frame-live-p toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
368 (setq toolbar-news-frame (make-frame toolbar-news-frame-properties))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
369 (add-hook 'gnus-exit-gnus-hook
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
370 (lambda ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
371 (when (frame-live-p toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
372 (if (cdr (frame-list))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
373 (delete-frame toolbar-news-frame))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
374 (setq toolbar-news-frame nil))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
375 (select-frame toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
376 (gnus))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
377 (when (framep toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
378 (when (frame-iconified-p toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
379 (deiconify-frame toolbar-news-frame))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
380 (select-frame toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
381 (raise-frame toolbar-news-frame))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
382
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
383 (defun toolbar-news ()
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
384 "Run News."
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
385 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
386 (let ((command (assq toolbar-news-reader toolbar-news-commands-alist)))
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
387 (or command
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
388 (error "Uknown news reader %s" toolbar-news-reader))
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
389 (if (symbolp command)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
390 (call-interactively command)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents: 219
diff changeset
391 (eval command))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
392
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
393 (defvar toolbar-last-win-icon nil "A `last-win' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
394 (defvar toolbar-next-win-icon nil "A `next-win' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
395 (defvar toolbar-file-icon nil "A `file' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
396 (defvar toolbar-folder-icon nil "A `folder' icon set")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
397 (defvar toolbar-disk-icon nil "A `disk' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
398 (defvar toolbar-printer-icon nil "A `printer' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
399 (defvar toolbar-cut-icon nil "A `cut' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
400 (defvar toolbar-copy-icon nil "A `copy' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
401 (defvar toolbar-paste-icon nil "A `paste' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
402 (defvar toolbar-undo-icon nil "An `undo' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
403 (defvar toolbar-spell-icon nil "A `spell' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
404 (defvar toolbar-replace-icon nil "A `replace' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
405 (defvar toolbar-mail-icon nil "A `mail' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
406 (defvar toolbar-info-icon nil "An `info' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
407 (defvar toolbar-compile-icon nil "A `compile' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
408 (defvar toolbar-debug-icon nil "A `debugger' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
409 (defvar toolbar-news-icon nil "A `news' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
410
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
411 ;;; each entry maps a variable to the prefix used.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
412
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
413 (defvar init-x-toolbar-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
414 '((toolbar-last-win-icon . "last-win")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
415 (toolbar-next-win-icon . "next-win")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
416 (toolbar-file-icon . "file")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
417 (toolbar-folder-icon . "folder")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
418 (toolbar-disk-icon . "disk")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
419 (toolbar-printer-icon . "printer")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
420 (toolbar-cut-icon . "cut")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
421 (toolbar-copy-icon . "copy")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
422 (toolbar-paste-icon . "paste")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
423 (toolbar-undo-icon . "undo")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
424 (toolbar-spell-icon . "spell")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
425 (toolbar-replace-icon . "replace")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
426 (toolbar-mail-icon . "mail")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
427 (toolbar-info-icon . "info-def")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
428 (toolbar-compile-icon . "compile")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
429 (toolbar-debug-icon . "debug")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
430 (toolbar-news-icon . "news")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
431
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
432 (defun init-x-toolbar ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
433 (toolbar-add-item-data init-x-toolbar-list )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
434 ;; do this now because errors will occur if the icon symbols
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
435 ;; are not initted
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
436 (set-specifier default-toolbar initial-toolbar-spec))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
437
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
438 (defun toolbar-add-item-data ( icon-list &optional icon-dir )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
439 (if (eq icon-dir nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
440 (setq icon-dir toolbar-icon-directory))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
441 (mapcar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
442 (lambda (cons)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
443 (let ((prefix (expand-file-name (cdr cons) icon-dir)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
444 (set (car cons)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
445 (if (featurep 'xpm)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
446 (toolbar-make-button-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
447 (concat prefix "-up.xpm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
448 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
449 (concat prefix "-xx.xpm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
450 (concat prefix "-cap-up.xpm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
451 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
452 (concat prefix "-cap-xx.xpm"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
453 (toolbar-make-button-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
454 (concat prefix "-up.xbm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
455 (concat prefix "-dn.xbm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
456 (concat prefix "-xx.xbm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
457 )))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
458 icon-list )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
459 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
460
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
461 (defvar initial-toolbar-spec
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
462 '(;;[toolbar-last-win-icon pop-window-configuration
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
463 ;;(frame-property (selected-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
464 ;; 'window-config-stack) t "Most recent window config"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
465 ;; #### Illicit knowledge?
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
466 ;; #### These don't work right - not consistent!
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
467 ;; I don't know what's wrong; perhaps `selected-frame' is wrong
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
468 ;; sometimes when this is evaluated. Note that I even tried to
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
469 ;; kludge-fix this by calls to `set-specifier-dirty-flag' in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
470 ;; pop-window-configuration and such.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
471
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
472 ;;[toolbar-next-win-icon unpop-window-configuration
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
473 ;;(frame-property (selected-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
474 ;; 'window-config-unpop-stack) t "Undo \"Most recent window config\""]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
475 ;; #### Illicit knowledge?
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
476
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
477 [toolbar-file-icon toolbar-open t "Open a file"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
478 [toolbar-folder-icon toolbar-dired t "View directory"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
479 [toolbar-disk-icon toolbar-save t "Save buffer"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
480 [toolbar-printer-icon toolbar-print t "Print buffer"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
481 [toolbar-cut-icon toolbar-cut t "Kill region"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
482 [toolbar-copy-icon toolbar-copy t "Copy region"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
483 [toolbar-paste-icon toolbar-paste t "Paste from clipboard"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
484 [toolbar-undo-icon toolbar-undo t "Undo edit"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
485 [toolbar-spell-icon toolbar-ispell t "Spellcheck"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
486 [toolbar-replace-icon toolbar-replace t "Replace text"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
487 [toolbar-mail-icon toolbar-mail t "Mail"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
488 [toolbar-info-icon toolbar-info t "Information"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
489 [toolbar-compile-icon toolbar-compile t "Compile"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
490 [toolbar-debug-icon toolbar-debug t "Debug"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
491 [toolbar-news-icon toolbar-news t "News"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
492 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
493 "The initial toolbar for a buffer.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
494
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
495 (defun x-init-toolbar-from-resources (locale)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
496 (x-init-specifier-from-resources
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
497 top-toolbar-height 'natnum locale
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
498 '("topToolBarHeight" . "TopToolBarHeight"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
499 (x-init-specifier-from-resources
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
500 bottom-toolbar-height 'natnum locale
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
501 '("bottomToolBarHeight" . "BottomToolBarHeight"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
502 (x-init-specifier-from-resources
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
503 left-toolbar-width 'natnum locale
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
504 '("leftToolBarWidth" . "LeftToolBarWidth"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
505 (x-init-specifier-from-resources
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
506 right-toolbar-width 'natnum locale
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
507 '("rightToolBarWidth" . "RightToolBarWidth"))
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
508 (x-init-specifier-from-resources
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
509 top-toolbar-border-width 'natnum locale
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
510 '("topToolBarBorderWidth" . "TopToolBarBorderWidth"))
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
511 (x-init-specifier-from-resources
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
512 bottom-toolbar-border-width 'natnum locale
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
513 '("bottomToolBarBorderWidth" . "BottomToolBarBorderWidth"))
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
514 (x-init-specifier-from-resources
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
515 left-toolbar-border-width 'natnum locale
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
516 '("leftToolBarBorderWidth" . "LeftToolBarBorderWidth"))
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
517 (x-init-specifier-from-resources
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
518 right-toolbar-border-width 'natnum locale
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
519 '("rightToolBarBorderWidth" . "RightToolBarBorderWidth")))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
520
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
521 ;;; x-toolbar.el ends here