annotate lisp/x-toolbar.el @ 209:41ff10fd062f r20-4b3

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