annotate lisp/x11/x-toolbar.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 9ee227acff29
children 8fc7fe29b841
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;; Toolbar support for X.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Copyright (C) 1994 Andy Piper <andyp@parallax.demon.co.uk>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Board of Trustees, University of Illinois
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Copyright (C) 1996 Ben Wing <wing@666.com>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; along with XEmacs; see the file COPYING. If not, write to the Free
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
23 ;; Miscellaneous toolbar functions, useful for users to redefine, in
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
24 ;; order to get different behaviour.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
25 ;;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
26
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
27 (defun toolbar-open ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
28 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
29 (call-interactively 'find-file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
30
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
31 (defun toolbar-dired ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
32 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
33 (call-interactively 'dired))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
34
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
35 (defun toolbar-save ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
36 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
37 (call-interactively 'save-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
38
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
39 (defun toolbar-print ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
40 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
41 (call-interactively 'lpr-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
42
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
43 (defun toolbar-cut ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
44 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
45 (call-interactively 'x-kill-primary-selection))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
46
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
47 (defun toolbar-copy ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
48 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
49 (call-interactively 'x-copy-primary-selection))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
50
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
51 (defun toolbar-paste ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
52 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
53 (call-interactively 'x-yank-clipboard-selection))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
54
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
55 (defun toolbar-undo ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
56 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
57 (call-interactively 'undo))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
58
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
59 (defun toolbar-replace ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
60 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
61 (call-interactively 'query-replace))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
62
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
63 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;; toolbar ispell variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (defun toolbar-ispell ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 "Intelligently spell the region or buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (if (region-active-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (ispell-region (region-beginning) (region-end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (ispell-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;; toolbar mail variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
78 (defmacro toolbar-external (process &rest args)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
79 `(lambda () (interactive) (call-process ,process nil 0 nil ,@args)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
81 (defvar toolbar-mail-commands-alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
82 `((vm . vm)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
83 (gnus . gnus-no-server)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
84 (rmail . rmail)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
85 (mh . mh-rmail)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
86 (pine . ,(toolbar-external "xterm" "-e" "pine")) ; *gag*
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
87 (elm . ,(toolbar-external "xterm" "-e" "elm"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
88 (mutt . ,(toolbar-external "xterm" "-e" "mutt"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
89 (exmh . ,(toolbar-external "exmh"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
90 ;; How to turn on netscape mail, command-line??
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
91 (netscape . ,(toolbar-external "netscape")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
92 "Alist of mail readers and their commands.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
93 The car of the alist is the mail reader, and the cdr is the form
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
94 used to start it.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
96 (defvar toolbar-mail-reader 'vm
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
97 "Mail reader toolbar will invoke.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
98 The legal values are `vm' and `gnus', but you can add your own values
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
99 by customizing `toolbar-mail-commands-alist'.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
100
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (defun toolbar-mail ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 "Run mail in a separate frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (interactive)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
105 (let ((command (assq toolbar-mail-reader toolbar-mail-commands-alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
106 (if (not command)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
107 (error "Uknown mail reader %s" toolbar-mail-reader))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
108 (funcall (cdr command))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ;; toolbar info variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (defvar toolbar-info-frame nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 "The frame in which info is displayed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (defun toolbar-info ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 "Run info in a separate frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (if (or (not toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (not (frame-live-p toolbar-info-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (setq toolbar-info-frame (make-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (select-frame toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (raise-frame toolbar-info-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (if (frame-iconified-p toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (deiconify-frame toolbar-info-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (select-frame toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (raise-frame toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ;; toolbar debug variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (defun toolbar-debug ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (if (featurep 'eos-debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (call-interactively 'eos::start-debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (require 'gdbsrc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (call-interactively 'gdbsrc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (defvar compile-command)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
145 (defvar toolbar-compile-already-run nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (defun toolbar-compile ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 "Run compile without having to touch the keyboard."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (require 'compile)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
151 (if toolbar-compile-already-run
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
152 (compile compile-command)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
153 (setq toolbar-compile-already-run t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
154 (popup-dialog-box
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
155 `(,(concat "Compile:\n " compile-command)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
156 ["Compile" (compile compile-command) t]
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
157 ["Edit command" compile t]
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
158 nil
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
159 ["Cancel" (message "Quit") t]))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ;; toolbar news variables and defuns
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 (defvar toolbar-news-frame nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 "The frame in which news is displayed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 10
diff changeset
168 (defvar toolbar-news-frame-properties nil
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 10
diff changeset
169 "The properties of the frame in which news is displayed.")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 10
diff changeset
170
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (defun toolbar-news ()
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
172 "Run Gnus in a separate frame."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (interactive)
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
174 (when (or (not toolbar-news-frame)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
175 (not (frame-live-p toolbar-news-frame)))
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 10
diff changeset
176 (setq toolbar-news-frame (make-frame toolbar-news-frame-properties))
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
177 (add-hook 'gnus-exit-gnus-hook
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
178 (lambda ()
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
179 (when (frame-live-p toolbar-news-frame)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
180 (if (cdr (frame-list))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
181 (delete-frame toolbar-news-frame))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
182 (setq toolbar-news-frame nil))))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
183 (select-frame toolbar-news-frame)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
184 (raise-frame toolbar-news-frame)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
185 (gnus))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (if (frame-iconified-p toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (deiconify-frame toolbar-news-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (select-frame toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (raise-frame toolbar-news-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
191 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
192 ;; toolbar printing variable and defun
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
193 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
194 (defvar toolbar-print-command 'lpr-buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
195 "Command to run when the Print Icon is selected from the toolbar.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
196 Set this to `ps-print-buffer-with-faces' if you primarily print with
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
197 a postscript printer.")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
198
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
199 (defun toolbar-print ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
200 "Print current buffer."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
201 (funcall toolbar-print-command))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
202
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
203 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
204 ;; toolbar replacement variable and defun
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
205 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
206 (defvar toolbar-replace-command 'query-replace
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
207 "Command to run when the Replace Icon is selected from the toolbar.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
208 One possibility for a different value would be `query-replace-regexp'.")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
209
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
210 (defun toolbar-replace ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
211 "Run a query-replace -type function on the current buffer."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
212 (funcall toolbar-replace-command))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
213
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (defvar toolbar-last-win-icon nil "A `last-win' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (defvar toolbar-next-win-icon nil "A `next-win' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (defvar toolbar-file-icon nil "A `file' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (defvar toolbar-folder-icon nil "A `folder' icon set")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (defvar toolbar-disk-icon nil "A `disk' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (defvar toolbar-printer-icon nil "A `printer' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (defvar toolbar-cut-icon nil "A `cut' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (defvar toolbar-copy-icon nil "A `copy' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (defvar toolbar-paste-icon nil "A `paste' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (defvar toolbar-undo-icon nil "An `undo' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (defvar toolbar-spell-icon nil "A `spell' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (defvar toolbar-replace-icon nil "A `replace' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (defvar toolbar-mail-icon nil "A `mail' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (defvar toolbar-info-icon nil "An `info' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (defvar toolbar-compile-icon nil "A `compile' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (defvar toolbar-debug-icon nil "A `debugger' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (defvar toolbar-news-icon nil "A `news' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ;;; each entry maps a variable to the prefix used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (defvar init-x-toolbar-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 '((toolbar-last-win-icon . "last-win")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (toolbar-next-win-icon . "next-win")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (toolbar-file-icon . "file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (toolbar-folder-icon . "folder")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (toolbar-disk-icon . "disk")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (toolbar-printer-icon . "printer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (toolbar-cut-icon . "cut")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (toolbar-copy-icon . "copy")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (toolbar-paste-icon . "paste")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (toolbar-undo-icon . "undo")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (toolbar-spell-icon . "spell")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (toolbar-replace-icon . "replace")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (toolbar-mail-icon . "mail")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (toolbar-info-icon . "info-def")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (toolbar-compile-icon . "compile")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (toolbar-debug-icon . "debug")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (toolbar-news-icon . "news")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (defun init-x-toolbar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (mapcar
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
255 (lambda (cons)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
256 (let ((prefix (expand-file-name (cdr cons) toolbar-icon-directory)))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
257 (set (car cons)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
258 (if (featurep 'xpm)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
259 (toolbar-make-button-list
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
260 (concat prefix "-up.xpm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
261 nil
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
262 (concat prefix "-xx.xpm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
263 (concat prefix "-cap-up.xpm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
264 nil
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
265 (concat prefix "-cap-xx.xpm"))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
266 (toolbar-make-button-list
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
267 (concat prefix "-up.xbm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
268 (concat prefix "-dn.xbm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
269 (concat prefix "-xx.xbm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
270 )))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 init-x-toolbar-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 ;; do this now because errors will occur if the icon symbols
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 ;; are not initted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (set-specifier default-toolbar initial-toolbar-spec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (defvar initial-toolbar-spec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 '(;[toolbar-last-win-icon pop-window-configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 ;;; #### illicit knowledge?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 ;;; #### these don't work right!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 ;;; #### not consistent.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 ;;; I don't know what's wrong;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ;;; perhaps `selected-frame' is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ;;; wrong sometimes when this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ;;; is evaluated. Note that I
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 ;;; even tried to kludge-fix this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ;;; by calls to `set-specifier-dirty-flag'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 ;;; in pop-window-configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 ;;; and such.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 ;(frame-property (selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ; 'window-config-stack)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 ; t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 ; "Most recent window config"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 ;[toolbar-next-win-icon unpop-window-configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 ;;; #### illicit knowledge?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ;(frame-property (selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 ; 'window-config-unpop-stack)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 ; t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 ; "Undo \"Most recent window config\""]
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
299 [toolbar-file-icon toolbar-open t "Open a file" ]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
300 [toolbar-folder-icon toolbar-dired t "View directory"]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
301 [toolbar-disk-icon toolbar-save t "Save buffer" ]
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
302 [toolbar-printer-icon toolbar-print t "Print buffer" ]
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
303 [toolbar-cut-icon toolbar-cut t "Kill region"]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
304 [toolbar-copy-icon toolbar-copy t "Copy region"]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
305 [toolbar-paste-icon toolbar-paste t "Paste from clipboard"]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
306 [toolbar-undo-icon toolbar-undo t "Undo edit" ]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 [toolbar-spell-icon toolbar-ispell t "Spellcheck" ]
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
308 [toolbar-replace-icon toolbar-replace t "Replace text" ]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 [toolbar-mail-icon toolbar-mail t "Mail" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 [toolbar-info-icon toolbar-info t "Information" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 [toolbar-compile-icon toolbar-compile t "Compile" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 [toolbar-debug-icon toolbar-debug t "Debug" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 [toolbar-news-icon toolbar-news t "News" ])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 "The initial toolbar for a buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (defun x-init-toolbar-from-resources (locale)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 top-toolbar-height 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 '("topToolBarHeight" . "TopToolBarHeight"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 bottom-toolbar-height 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 '("bottomToolBarHeight" . "BottomToolBarHeight"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 left-toolbar-width 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 '("leftToolBarWidth" . "LeftToolBarWidth"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 right-toolbar-width 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 '("rightToolBarWidth" . "RightToolBarWidth")))