annotate lisp/x-toolbar.el @ 219:262b8bb4a523 r20-4b8

Import from CVS: tag r20-4b8
author cvs
date Mon, 13 Aug 2007 10:09:35 +0200
parents d44af0c54775
children 6c0ae1f9357f
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
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 217
diff changeset
41 (defvar pending-delete))
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 ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
49 (ding)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
50 (message "Configure the item via `M-x customize RET toolbar RET'"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
51
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
52 (defcustom toolbar-open-function 'find-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
53 "*Function to call when the open icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
54 :type '(radio (function-item find-file)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
55 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
56 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
57
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
58 (defun toolbar-open ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
59 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
60 (call-interactively toolbar-open-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
61
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
62 (defcustom toolbar-dired-function 'dired
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
63 "*Function to call when the dired icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
64 :type '(radio (function-item dired)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
65 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
66 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
67
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
68 (defun toolbar-dired ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
69 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
70 (call-interactively toolbar-dired-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
71
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
72 (defcustom toolbar-save-function 'save-buffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
73 "*Function to call when the save icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
74 :type '(radio (function-item save-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
75 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
76 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
77
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
78 (defun toolbar-save ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
79 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
80 (call-interactively toolbar-save-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
81
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
82 (defcustom toolbar-print-function 'lpr-buffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
83 "*Function to call when the print icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
84 :type '(radio (function-item lpr-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
85 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
86 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
87
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
88 (defun toolbar-print ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
89 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
90 (call-interactively toolbar-print-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
91
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
92 (defcustom toolbar-cut-function 'x-kill-primary-selection
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
93 "*Function to call when the cut icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
94 :type '(radio (function-item x-kill-primary-selection)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
95 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
96 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
97
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
98 (defun toolbar-cut ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
99 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
100 (call-interactively toolbar-cut-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
101
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
102 (defcustom toolbar-copy-function 'x-copy-primary-selection
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
103 "*Function to call when the copy icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
104 :type '(radio (function-item x-copy-primary-selection)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
105 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
106 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
107
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
108 (defun toolbar-copy ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
109 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
110 (call-interactively toolbar-copy-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
111
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
112 (defcustom toolbar-paste-function 'x-yank-clipboard-selection
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
113 "*Function to call when the paste icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
114 :type '(radio (function-item x-yank-clipboard-selection)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
115 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
116 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
117
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
118 (defun toolbar-paste ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
119 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
120 ;; This horrible kludge is for pending-delete to work correctly.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
121 (and (boundp 'pending-delete)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
122 pending-delete
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
123 (let ((this-command toolbar-paste-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
124 (pending-delete-pre-hook)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
125 (call-interactively toolbar-paste-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
126
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
127 (defcustom toolbar-undo-function 'undo
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
128 "*Function to call when the undo icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
129 :type '(radio (function-item undo)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
130 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
131 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
132
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
133 (defun toolbar-undo ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
134 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
135 (call-interactively toolbar-undo-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
136
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
137 (defcustom toolbar-replace-function 'query-replace
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
138 "*Function to call when the replace icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
139 :type '(radio (function-item query-replace)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
140 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
141 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
142
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
143 (defun toolbar-replace ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
144 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
145 (call-interactively toolbar-replace-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
146
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
147 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
148 ;; toolbar ispell variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
149 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
150
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
151 (defun toolbar-ispell-internal ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
152 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
153 (if (region-active-p)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
154 (ispell-region (region-beginning) (region-end))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
155 (ispell-buffer)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
156
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
157 (defcustom toolbar-ispell-function 'toolbar-ispell-internal
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
158 "*Function to call when the ispell icon is selected."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
159 :type '(radio (function-item toolbar-ispell-internal)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
160 (function :tag "Other"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
161 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
162
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
163 (defun toolbar-ispell ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
164 "Intelligently spell the region or buffer."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
165 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
166 (call-interactively toolbar-ispell-function))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
167
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
168 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
169 ;; toolbar mail variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
170 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
171
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
172 ;; 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
173 ;; called `call-process'. With the advent of customize, it's better
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
174 ;; to have it as a defun, to make customization easier.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
175 (defun toolbar-external (process &rest args)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
176 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
177 (apply 'call-process process nil 0 nil args))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
178
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
179 (defcustom toolbar-mail-commands-alist
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
180 `((not-configured . toolbar-not-configured)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
181 (vm . vm)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
182 (gnus . gnus-no-server)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
183 (rmail . rmail)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
184 (mh . mh-rmail)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
185 (pine . (toolbar-external "xterm" "-e" "pine")) ; *gag*
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
186 (elm . (toolbar-external "xterm" "-e" "elm"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
187 (mutt . (toolbar-external "xterm" "-e" "mutt"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
188 (exmh . (toolbar-external "exmh"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
189 (netscape . (toolbar-external "netscape" "mailbox:")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
190 "*Alist of mail readers and their commands.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
191 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
192 used to start it."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
193 :type '(repeat (cons :format "%v"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
194 (symbol :tag "Mailer") (function :tag "Start with")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
195 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
196
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
197 (defcustom toolbar-mail-reader 'not-configured
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
198 "*Mail reader toolbar will invoke.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
199 The legal values are the keys from `toolbar-mail-command-alist', which
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
200 should be used to add new mail readers.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
201 Mail readers known by default are vm, gnus, rmail, mh, pine, elm,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
202 mutt, exmh and netscape."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
203 :type '(choice (const :tag "Not Configured" not-configured)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
204 (const vm) (const gnus) (const rmail) (const mh)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
205 (const pine) (const elm) (const mutt) (const exmh)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
206 (const netscape)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
207 (symbol :tag "Other"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
208 :validate (lambda (wid)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
209 (if (assq (widget-value wid)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
210 toolbar-mail-commands-alist)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
211 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
212 (widget-put wid :error
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
213 "Unknown mail reader")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
214 wid))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
215 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
216
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
217
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
218 (defun toolbar-mail ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
219 "Run mail in a separate frame."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
220 (interactive)
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
221 (let ((command (cdr (assq toolbar-mail-reader toolbar-mail-commands-alist))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
222 (if (not command)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
223 (error "Uknown mail reader %s" toolbar-mail-reader))
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
224 (if (symbolp command)
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
225 (call-interactively command)
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
226 (eval command))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
227
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
228 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
229 ;; toolbar info variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
230 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
231
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
232 (defvar toolbar-info-frame nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
233 "The frame in which info is displayed.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
234
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
235 (defcustom Info-frame-plist
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
236 (append (list 'width 80)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
237 (let ((h (plist-get default-frame-plist 'height)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
238 (when h (list 'height h))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
239 "Frame plist for the Info frame."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
240 :type '(repeat (group :inline t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
241 (symbol :tag "Property")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
242 (sexp :tag "Value")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
243 :group 'info)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
244
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
245 (defun toolbar-info ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
246 "Run info in a separate frame."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
247 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
248 (if (or (not toolbar-info-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
249 (not (frame-live-p toolbar-info-frame)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
250 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
251 (setq toolbar-info-frame (make-frame Info-frame-plist))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
252 (select-frame toolbar-info-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
253 (raise-frame toolbar-info-frame)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
254 (if (frame-iconified-p toolbar-info-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
255 (deiconify-frame toolbar-info-frame))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
256 (select-frame toolbar-info-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
257 (raise-frame toolbar-info-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
258 (info))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
259
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
260 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
261 ;; toolbar debug variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
262 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
263
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
264 (defun toolbar-debug ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
265 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
266 (if (featurep 'eos-debugger)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
267 (call-interactively 'eos::start-debugger)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
268 (require 'gdbsrc)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
269 (call-interactively 'gdbsrc)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
270
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
271 (defvar compile-command)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
272
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
273 (defun toolbar-compile ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
274 "Run compile without having to touch the keyboard."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
275 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
276 (require 'compile)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
277 (popup-dialog-box
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
278 `(,(concat "Compile:\n " compile-command)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
279 ["Compile" (compile compile-command) t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
280 ["Edit command" compile t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
281 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
282 ["Cancel" (message "Quit") t])))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
283
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
284 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
285 ;; toolbar news variables and defuns
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
286 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
287
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
288 (defcustom toolbar-news-commands-alist
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
289 `((not-configured . toolbar-not-configured)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
290 (gnus . toolbar-gnus) ; M-x all-hail-gnus
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
291 (rn . (toolbar-external "xterm" "-e" "rn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
292 (nn . (toolbar-external "xterm" "-e" "nn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
293 (trn . (toolbar-external "xterm" "-e" "trn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
294 (xrn . (toolbar-external "xrn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
295 (slrn . (toolbar-external "xterm" "-e" "slrn"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
296 (pine . (toolbar-external "xterm" "-e" "pine")) ; *gag*
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
297 (tin . (toolbar-external "xterm" "-e" "tin")) ; *gag*
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
298 (netscape . (toolbar-external "netscape" "news:")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
299 "*Alist of news readers and their commands.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
300 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
301 is the form used to start it."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
302 :type '(repeat (cons :format "%v"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
303 (symbol :tag "Reader") (sexp :tag "Start with")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
304 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
305
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
306 (defcustom toolbar-news-reader 'not-configured
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
307 "*News reader toolbar will invoke.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
308 The legal values are the keys from `toolbar-news-command-alist', which should
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
309 be used to add new news readers.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
310 Newsreaders known by default are gnus, rn, nn, trn, xrn, slrn, pine
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
311 and netscape."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
312 :type '(choice (const :tag "Not Configured" not-configured)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
313 (const gnus) (const rn) (const nn) (const trn)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
314 (const xrn) (const slrn) (const pine) (const tin)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
315 (const netscape)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
316 (symbol :tag "Other"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
317 :validate (lambda (wid)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
318 (if (assq (widget-value wid)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
319 toolbar-news-commands-alist)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
320 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
321 (widget-put wid :error
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
322 "Unknown news reader")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
323 wid))))
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-use-separate-frame t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
327 "*Whether Gnus is invoked in a separate frame."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
328 :type 'boolean
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
329 :group 'toolbar)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
330
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
331 (defvar toolbar-news-frame nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
332 "The frame in which news is displayed.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
333
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
334 (defcustom toolbar-news-frame-properties nil
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
335 "*The properties of the frame in which news is displayed."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
336 :type '(repeat (group :inline t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
337 (symbol :tag "Property")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
338 (sexp :tag "Value")))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
339 :group 'toolbar)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
340
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
341 (defun toolbar-gnus ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
342 "Run Gnus in a separate frame."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
343 (interactive)
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
344 (if (not toolbar-news-use-separate-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
345 (gnus)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
346 (unless (frame-live-p toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
347 (setq toolbar-news-frame (make-frame toolbar-news-frame-properties))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
348 (add-hook 'gnus-exit-gnus-hook
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
349 (lambda ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
350 (when (frame-live-p toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
351 (if (cdr (frame-list))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
352 (delete-frame toolbar-news-frame))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
353 (setq toolbar-news-frame nil))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
354 (select-frame toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
355 (raise-frame toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
356 (gnus))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
357 (when (framep toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
358 (when (frame-iconified-p toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
359 (deiconify-frame toolbar-news-frame))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
360 (select-frame toolbar-news-frame)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents: 215
diff changeset
361 (raise-frame toolbar-news-frame))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
362
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
363 (defun toolbar-news ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
364 "Run News (in a separate frame??)."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
365 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
366 (let ((command (assq toolbar-news-reader toolbar-news-commands-alist)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
367 (if (not command)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
368 (error "Unknown news reader %s" toolbar-news-reader))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
369 (funcall (cdr command))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
370
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
371 (defvar toolbar-last-win-icon nil "A `last-win' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
372 (defvar toolbar-next-win-icon nil "A `next-win' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
373 (defvar toolbar-file-icon nil "A `file' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
374 (defvar toolbar-folder-icon nil "A `folder' icon set")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
375 (defvar toolbar-disk-icon nil "A `disk' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
376 (defvar toolbar-printer-icon nil "A `printer' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
377 (defvar toolbar-cut-icon nil "A `cut' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
378 (defvar toolbar-copy-icon nil "A `copy' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
379 (defvar toolbar-paste-icon nil "A `paste' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
380 (defvar toolbar-undo-icon nil "An `undo' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
381 (defvar toolbar-spell-icon nil "A `spell' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
382 (defvar toolbar-replace-icon nil "A `replace' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
383 (defvar toolbar-mail-icon nil "A `mail' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
384 (defvar toolbar-info-icon nil "An `info' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
385 (defvar toolbar-compile-icon nil "A `compile' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
386 (defvar toolbar-debug-icon nil "A `debugger' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
387 (defvar toolbar-news-icon nil "A `news' icon set.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
388
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
389 ;;; each entry maps a variable to the prefix used.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
390
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
391 (defvar init-x-toolbar-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
392 '((toolbar-last-win-icon . "last-win")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
393 (toolbar-next-win-icon . "next-win")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
394 (toolbar-file-icon . "file")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
395 (toolbar-folder-icon . "folder")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
396 (toolbar-disk-icon . "disk")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
397 (toolbar-printer-icon . "printer")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
398 (toolbar-cut-icon . "cut")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
399 (toolbar-copy-icon . "copy")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
400 (toolbar-paste-icon . "paste")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
401 (toolbar-undo-icon . "undo")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
402 (toolbar-spell-icon . "spell")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
403 (toolbar-replace-icon . "replace")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
404 (toolbar-mail-icon . "mail")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
405 (toolbar-info-icon . "info-def")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
406 (toolbar-compile-icon . "compile")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
407 (toolbar-debug-icon . "debug")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
408 (toolbar-news-icon . "news")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
409
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
410 (defun init-x-toolbar ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
411 (toolbar-add-item-data init-x-toolbar-list )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
412 ;; do this now because errors will occur if the icon symbols
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
413 ;; are not initted
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
414 (set-specifier default-toolbar initial-toolbar-spec))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
415
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
416 (defun toolbar-add-item-data ( icon-list &optional icon-dir )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
417 (if (eq icon-dir nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
418 (setq icon-dir toolbar-icon-directory))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
419 (mapcar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
420 (lambda (cons)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
421 (let ((prefix (expand-file-name (cdr cons) icon-dir)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
422 (set (car cons)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
423 (if (featurep 'xpm)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
424 (toolbar-make-button-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
425 (concat prefix "-up.xpm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
426 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
427 (concat prefix "-xx.xpm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
428 (concat prefix "-cap-up.xpm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
429 nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
430 (concat prefix "-cap-xx.xpm"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
431 (toolbar-make-button-list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
432 (concat prefix "-up.xbm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
433 (concat prefix "-dn.xbm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
434 (concat prefix "-xx.xbm")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
435 )))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
436 icon-list )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
437 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
438
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
439 (defvar initial-toolbar-spec
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
440 '(;;[toolbar-last-win-icon pop-window-configuration
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
441 ;;(frame-property (selected-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
442 ;; 'window-config-stack) t "Most recent window config"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
443 ;; #### Illicit knowledge?
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
444 ;; #### These don't work right - not consistent!
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
445 ;; I don't know what's wrong; perhaps `selected-frame' is wrong
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
446 ;; sometimes when this is evaluated. Note that I even tried to
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
447 ;; kludge-fix this by calls to `set-specifier-dirty-flag' in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
448 ;; pop-window-configuration and such.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
449
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
450 ;;[toolbar-next-win-icon unpop-window-configuration
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
451 ;;(frame-property (selected-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
452 ;; 'window-config-unpop-stack) t "Undo \"Most recent window config\""]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
453 ;; #### Illicit knowledge?
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
454
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
455 [toolbar-file-icon toolbar-open t "Open a file"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
456 [toolbar-folder-icon toolbar-dired t "View directory"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
457 [toolbar-disk-icon toolbar-save t "Save buffer"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
458 [toolbar-printer-icon toolbar-print t "Print buffer"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
459 [toolbar-cut-icon toolbar-cut t "Kill region"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
460 [toolbar-copy-icon toolbar-copy t "Copy region"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
461 [toolbar-paste-icon toolbar-paste t "Paste from clipboard"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
462 [toolbar-undo-icon toolbar-undo t "Undo edit"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
463 [toolbar-spell-icon toolbar-ispell t "Spellcheck"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
464 [toolbar-replace-icon toolbar-replace t "Replace text"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
465 [toolbar-mail-icon toolbar-mail t "Mail"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
466 [toolbar-info-icon toolbar-info t "Information"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
467 [toolbar-compile-icon toolbar-compile t "Compile"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
468 [toolbar-debug-icon toolbar-debug t "Debug"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
469 [toolbar-news-icon toolbar-news t "News"]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
470 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
471 "The initial toolbar for a buffer.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
472
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
473 (defun x-init-toolbar-from-resources (locale)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
474 (x-init-specifier-from-resources
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
475 top-toolbar-height 'natnum locale
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
476 '("topToolBarHeight" . "TopToolBarHeight"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
477 (x-init-specifier-from-resources
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
478 bottom-toolbar-height 'natnum locale
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
479 '("bottomToolBarHeight" . "BottomToolBarHeight"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
480 (x-init-specifier-from-resources
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
481 left-toolbar-width 'natnum locale
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
482 '("leftToolBarWidth" . "LeftToolBarWidth"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
483 (x-init-specifier-from-resources
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
484 right-toolbar-width 'natnum locale
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
485 '("rightToolBarWidth" . "RightToolBarWidth"))
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
486 (x-init-specifier-from-resources
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
487 top-toolbar-border-width 'natnum locale
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
488 '("topToolBarBorderWidth" . "TopToolBarBorderWidth"))
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
489 (x-init-specifier-from-resources
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
490 bottom-toolbar-border-width 'natnum locale
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
491 '("bottomToolBarBorderWidth" . "BottomToolBarBorderWidth"))
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
492 (x-init-specifier-from-resources
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
493 left-toolbar-border-width 'natnum locale
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
494 '("leftToolBarBorderWidth" . "LeftToolBarBorderWidth"))
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
495 (x-init-specifier-from-resources
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
496 right-toolbar-border-width 'natnum locale
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 209
diff changeset
497 '("rightToolBarBorderWidth" . "RightToolBarBorderWidth")))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
498
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
499 ;;; x-toolbar.el ends here