Bunch of typo fixes
[syinit] / 09-toolbar-sy.el
1 ;; 09-toolbar-sy.el --- Toolbar set up   -*- Emacs-Lisp -*-
2
3 ;; Copyright (C) 2007 - 2013 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 Dec 31, 2015 01:17:25 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 http://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    (expand-file-name "redo.xpm"
80                      (file-name-as-directory
81                       (expand-file-name "etc/SXEmacs"
82                                         (getenv "HOME"))))))
83
84 (defun toolbar-irc ()
85   (interactive)
86   (call-interactively #'sy-riece))
87
88 (defvar toolbar-irc-icon
89   (toolbar-make-button-list
90    (locate-data-file "irc@32x32.png")))
91
92 (defun toolbar-emoney ()
93   (interactive)
94   (call-interactively #'emoney))
95
96 (defvar toolbar-emoney-icon
97   (toolbar-make-button-list
98    (locate-data-file "emoney.png")))
99
100 (and (device-on-window-system-p)
101      (set-specifier default-toolbar 
102                     '([toolbar-file-icon toolbar-open t "Open a file"] 
103                       [toolbar-folder-icon toolbar-dired t "Edit a directory"] 
104                       [toolbar-disk-icon toolbar-save t "Save buffer"] 
105                       [toolbar-printer-icon toolbar-print t "Print buffer"] 
106                       [toolbar-cut-icon toolbar-cut t "Kill region"] 
107                       [toolbar-copy-icon toolbar-copy t "Copy region"] 
108                       [toolbar-paste-icon toolbar-paste t "Paste from clipboard"] 
109                       [toolbar-undo-icon toolbar-undo t "Undo"]
110                       [toolbar-redo-icon toolbar-redo t "Redo"]
111                       [toolbar-spell-icon toolbar-ispell t "Check spelling"] 
112                       [toolbar-replace-icon toolbar-replace t "Search & Replace"] 
113                       [toolbar-compile-icon toolbar-compile t "Start a compilation"] 
114                       [toolbar-debug-icon toolbar-debug t "Start a debugger"]
115                       [toolbar-emoney-icon toolbar-emoney t "Manage your millions with eMoney"]
116                       [toolbar-irc-icon toolbar-irc t "Be productive with Riece"]
117                       [toolbar-news-icon gnus-other-frame t "Gnus"]
118                       nil 
119                       [toolbar-info-icon toolbar-info t "Don't Panic!!"])))
120 ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
121 (message "Toolbar set successfully")