annotate lisp/x-toolbar.el @ 244:78d4f1140794

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