comparison lisp/x11/x-toolbar.el @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents 821dec489c24
children cca96a509cfe
comparison
equal deleted inserted replaced
97:498bf5da1c90 98:0d2f883870bc
23 ;; 23 ;;
24 ;; Miscellaneous toolbar functions, useful for users to redefine, in 24 ;; Miscellaneous toolbar functions, useful for users to redefine, in
25 ;; order to get different behaviour. 25 ;; order to get different behaviour.
26 ;; 26 ;;
27 27
28 (defvar toolbar-open-function 'find-file
29 "*Function to call when the open icon is selected.")
30
28 (defun toolbar-open () 31 (defun toolbar-open ()
29 (interactive) 32 (interactive)
30 (call-interactively 'find-file)) 33 (call-interactively toolbar-open-function))
34
35 (defvar toolbar-dired-function 'dired
36 "*Function to call when the dired icon is selected.")
31 37
32 (defun toolbar-dired () 38 (defun toolbar-dired ()
33 (interactive) 39 (interactive)
34 (call-interactively 'dired)) 40 (call-interactively toolbar-dired-function))
41
42 (defvar toolbar-save-function 'save-buffer
43 "*Function to call when the save icon is selected.")
35 44
36 (defun toolbar-save () 45 (defun toolbar-save ()
37 (interactive) 46 (interactive)
38 (call-interactively 'save-buffer)) 47 (call-interactively toolbar-save-function))
48
49 (defvar toolbar-print-function 'lpr-buffer
50 "*Function to call when the print icon is selected.")
39 51
40 (defun toolbar-print () 52 (defun toolbar-print ()
41 (interactive) 53 (interactive)
42 (call-interactively 'lpr-buffer)) 54 (call-interactively toolbar-print-function))
55
56 (defvar toolbar-cut-function 'x-kill-primary-selection
57 "*Function to call when the cut icon is selected.")
43 58
44 (defun toolbar-cut () 59 (defun toolbar-cut ()
45 (interactive) 60 (interactive)
46 (call-interactively 'x-kill-primary-selection)) 61 (call-interactively toolbar-cut-function))
62
63 (defvar toolbar-copy-function 'x-copy-primary-selection
64 "*Function to call when the copy icon is selected.")
47 65
48 (defun toolbar-copy () 66 (defun toolbar-copy ()
49 (interactive) 67 (interactive)
50 (call-interactively 'x-copy-primary-selection)) 68 (call-interactively toolbar-copy-function))
69
70 (defvar toolbar-paste-function 'x-yank-clipboard-selection
71 "*Function to call when the paste icon is selected.")
51 72
52 (defun toolbar-paste () 73 (defun toolbar-paste ()
53 (interactive) 74 (interactive)
54 (call-interactively 'x-yank-clipboard-selection)) 75 (call-interactively toolbar-paste-function))
76
77 (defvar toolbar-undo-function 'undo
78 "*Function to call when the undo icon is selected.")
55 79
56 (defun toolbar-undo () 80 (defun toolbar-undo ()
57 (interactive) 81 (interactive)
58 (call-interactively 'undo)) 82 (call-interactively toolbar-undo-function))
83
84 (defvar toolbar-replace-function 'query-replace
85 "*Function to call when the replace icon is selected.")
59 86
60 (defun toolbar-replace () 87 (defun toolbar-replace ()
61 (interactive) 88 (interactive)
62 (call-interactively 'query-replace)) 89 (call-interactively toolbar-replace-function))
63 90
64 ;; 91 ;;
65 ;; toolbar ispell variables and defuns 92 ;; toolbar ispell variables and defuns
66 ;; 93 ;;
94
95 (defvar toolbar-ispell-function
96 (lambda ()
97 (interactive)
98 (if (region-active-p)
99 (ispell-region (region-beginning) (region-end))
100 (ispell-buffer)))
101 "*Function to call when the ispell icon is selected.")
67 102
68 (defun toolbar-ispell () 103 (defun toolbar-ispell ()
69 "Intelligently spell the region or buffer." 104 "Intelligently spell the region or buffer."
70 (interactive) 105 (interactive)
71 (if (region-active-p) 106 (call-interactively toolbar-ispell-function))
72 (ispell-region (region-beginning) (region-end))
73 (ispell-buffer)))
74 107
75 ;; 108 ;;
76 ;; toolbar mail variables and defuns 109 ;; toolbar mail variables and defuns
77 ;; 110 ;;
78 111
93 "Alist of mail readers and their commands. 126 "Alist of mail readers and their commands.
94 The car of the alist is the mail reader, and the cdr is the form 127 The car of the alist is the mail reader, and the cdr is the form
95 used to start it.") 128 used to start it.")
96 129
97 (defvar toolbar-mail-reader 'vm 130 (defvar toolbar-mail-reader 'vm
98 "Mail reader toolbar will invoke. 131 "*Mail reader toolbar will invoke.
99 The legal values are `vm' and `gnus', but you can add your own values 132 The legal values are `vm' and `gnus', but you can add your own values
100 by customizing `toolbar-mail-commands-alist'.") 133 by customizing `toolbar-mail-commands-alist'.")
101 134
102 135
103 (defun toolbar-mail () 136 (defun toolbar-mail ()
156 ["Cancel" (message "Quit") t]))) 189 ["Cancel" (message "Quit") t])))
157 190
158 ;; 191 ;;
159 ;; toolbar news variables and defuns 192 ;; toolbar news variables and defuns
160 ;; 193 ;;
194
195 (defvar toolbar-news-commands-alist
196 `((gnus . gnus) ; M-x all-hail-gnus
197 (rn . ,(toolbar-external "xterm" "-e" "rn"))
198 (nn . ,(toolbar-external "xterm" "-e" "nn"))
199 (trn . ,(toolbar-external "xterm" "-e" "trn"))
200 (xrn . ,(toolbar-external "xrn"))
201 (slrn . ,(toolbar-external "xterm" "-e" "slrn"))
202 (pine . ,(toolbar-external "xterm" "-e" "pine")) ; *gag*
203 (tin . ,(toolbar-external "xterm" "-e" "tin")) ; *gag*
204 (netscape . ,(toolbar-external "netscape" "news:")))
205 "Alist of news readers and their commands.
206 Each list element is a pair. The car of the pair is the mail
207 reader, and the cdr is the form used to start it.")
208
209 (defvar toolbar-news-reader 'gnus
210 "*News reader toolbar will invoke.
211 The legal values are gnus, rn, nn, trn, xrn, slrn, pine and netscape.
212 You can add your own values by customizing `toolbar-news-commands-alist'.")
213
214 (defvar toolbar-news-use-separate-frame t
215 "*Whether Gnus is invoked in a separate frame.")
161 216
162 (defvar toolbar-news-frame nil 217 (defvar toolbar-news-frame nil
163 "The frame in which news is displayed.") 218 "The frame in which news is displayed.")
164 219
165 (defvar toolbar-news-frame-properties nil 220 (defvar toolbar-news-frame-properties nil
291 left-toolbar-width 'natnum locale 346 left-toolbar-width 'natnum locale
292 '("leftToolBarWidth" . "LeftToolBarWidth")) 347 '("leftToolBarWidth" . "LeftToolBarWidth"))
293 (x-init-specifier-from-resources 348 (x-init-specifier-from-resources
294 right-toolbar-width 'natnum locale 349 right-toolbar-width 'natnum locale
295 '("rightToolBarWidth" . "RightToolBarWidth"))) 350 '("rightToolBarWidth" . "RightToolBarWidth")))
351
352 ;;; x-toolbar.el ends here