annotate lisp/x11/x-toolbar.el @ 197:acd284d43ca1 r20-3b25

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