Lost my redo icon, replaced it
[syinit] / 09-toolbar-sy.el
1 ;; 09-toolbar-sy.el --- Toolbar set up   -*- Emacs-Lisp -*-
2
3 ;; Copyright (C) 2007 - 2020 Steve Youngs
4
5 ;;     Author: Steve Youngs <steve@sxemacs.org>
6 ;; Maintainer: Steve Youngs <steve@sxemacs.org>
7 ;;    Created: <2007-12-02>
8 ;; Time-stamp: <Thursday Mar 19, 2020 12:47:15 steve>
9 ;;   Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
10 ;;   HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/09-toolbar-sy.html>
11 ;;   Git Repo: git clone https://git.sxemacs.org/syinit
12 ;;   Keywords: init, compile
13
14 ;; This file is part of SYinit
15
16 ;; Redistribution and use in source and binary forms, with or without
17 ;; modification, are permitted provided that the following conditions
18 ;; are met:
19 ;;
20 ;; 1. Redistributions of source code must retain the above copyright
21 ;;    notice, this list of conditions and the following disclaimer.
22 ;;
23 ;; 2. Redistributions in binary form must reproduce the above copyright
24 ;;    notice, this list of conditions and the following disclaimer in the
25 ;;    documentation and/or other materials provided with the distribution.
26 ;;
27 ;; 3. Neither the name of the author nor the names of any contributors
28 ;;    may be used to endorse or promote products derived from this
29 ;;    software without specific prior written permission.
30 ;;
31 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
32 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
33 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34 ;; DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
35 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
38 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
39 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
40 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
41 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
43 ;;; Commentary:
44 ;;
45 ;;   Sets up the toolbar the way I like it.
46
47 ;;; Credits:
48 ;;
49 ;;   The HTML version of this file was created with Hrvoje Niksic's
50 ;;   htmlize.el which is part of the XEmacs "text-modes" package.
51 ;;
52
53 ;;; Todo:
54 ;;
55 ;;     
56
57 ;;; Code:
58 ;; Re-organise the default toolbar.
59 (when (featurep 'toolbar)
60   (setq
61    toolbar-info-use-separate-frame t
62    toolbar-mail-reader 'gnus
63    toolbar-news-use-separate-frame t)
64   (customize-set-variable 'toolbar-captioned-p nil))
65
66 (setq edit-toolbar-added-buttons-alist 'nil)
67
68 (mapcar
69  (lambda (cons)
70    (setf (symbol-value (car cons)) (toolbar-make-button-list (cdr cons))))
71  edit-toolbar-added-buttons-alist)
72
73 (defun toolbar-redo ()
74   (interactive)
75   (call-interactively #'redo))
76
77 (defvar toolbar-redo-icon
78   (toolbar-make-button-list
79    (locate-data-file "redo.png")))
80
81 (defun toolbar-irc ()
82   (interactive)
83   (call-interactively #'sy-riece))
84
85 (defvar toolbar-irc-icon
86   (toolbar-make-button-list
87    (locate-data-file "irc@32x32.png")))
88
89 (defun toolbar-emoney ()
90   (interactive)
91   (call-interactively #'emoney))
92
93 (defvar toolbar-emoney-icon
94   (toolbar-make-button-list
95    (locate-data-file "emoney.png")))
96
97 (and (device-on-window-system-p)
98      (set-specifier
99       default-toolbar 
100       '([toolbar-file-icon toolbar-open t "Open a file"] 
101         [toolbar-folder-icon toolbar-dired t "Edit a directory"] 
102         [toolbar-disk-icon toolbar-save t "Save buffer"] 
103         [toolbar-printer-icon toolbar-print t "Print buffer"] 
104         [toolbar-cut-icon toolbar-cut t "Kill region"] 
105         [toolbar-copy-icon toolbar-copy t "Copy region"] 
106         [toolbar-paste-icon toolbar-paste t "Paste from clipboard"] 
107         [toolbar-undo-icon toolbar-undo t "Undo"]
108         [toolbar-redo-icon toolbar-redo t "Redo"]
109         [toolbar-spell-icon toolbar-ispell t "Check spelling"] 
110         [toolbar-replace-icon toolbar-replace t "Search & Replace"] 
111         [toolbar-compile-icon toolbar-compile t "Start a compilation"] 
112         [toolbar-debug-icon toolbar-debug t "Start a debugger"]
113         [toolbar-emoney-icon toolbar-emoney t "Manage your millions with eMoney"]
114         [toolbar-irc-icon toolbar-irc t "Be productive with Riece"]
115         [toolbar-news-icon gnus-other-frame t "Gnus"]
116         nil 
117         [toolbar-info-icon toolbar-info t "Don't Panic!!"])))
118 ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
119 (message "Toolbar set successfully")