1 ;;; message-xmas.el --- XEmacs extensions to message
2 ;; Copyright (C) 1996 Free Software Foundation, Inc.
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
5 ;; Keywords: mail, news
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
28 (defvar message-xmas-glyph-directory nil
29 "*Directory where Message logos and icons are located.
30 If this variable is nil, Message will try to locate the directory
33 (defvar message-use-toolbar 'default-toolbar
34 "*If nil, do not use a toolbar.
35 If it is non-nil, it must be a toolbar. The five legal values are
36 `default-toolbar', `top-toolbar', `bottom-toolbar',
37 `right-toolbar', and `left-toolbar'.")
39 (defvar message-toolbar
41 [message-reply message-reply t "Reply"]
42 [message-get message-get t "Message get"]
43 [message-originate message-originate t "Originate"]
44 [message-save message-save t "Save"]
45 [message-copy message-copy t "Copy message"]
46 [message-delete message-delete t "Delete message"]
47 [message-forward message-forward t "Forward message"]
48 [message-spell message-spell t "Spell"]
49 [message-help message-help t "Message help"]
51 "The message buffer toolbar.")
53 (defun message-xmas-find-glyph-directory (&optional package)
54 (setq package (or package "message"))
55 (let ((path load-path)
57 ;; We try to find the dir by looking at the load path,
58 ;; stripping away the last component and adding "etc/".
64 (directory-file-name (car path)))
65 "etc/" (or package "message") "/")))
66 (file-directory-p dir))
69 (setq path (cdr path))))
72 (defun message-xmas-setup-toolbar (bar &optional force package)
73 (let ((dir (message-xmas-find-glyph-directory package))
74 icon up down disabled name)
76 (setq message-xmas-glyph-directory dir))
79 (boundp (aref (car bar) 0)))
82 (setq icon (aref (car bar) 0)
83 name (symbol-name icon)
85 (setq up (concat dir name "-up.xpm"))
86 (setq down (concat dir name "-down.xpm"))
87 (setq disabled (concat dir name "-disabled.xpm"))
88 (if (not (file-exists-p up))
90 (set icon (toolbar-make-button-list
91 up (and (file-exists-p down) down)
92 (and (file-exists-p disabled) disabled)))))
95 (defun message-setup-toolbar ()
96 (and message-use-toolbar
97 (message-xmas-setup-toolbar message-toolbar)
98 (set-specifier (symbol-value message-use-toolbar)
99 (cons (current-buffer) message-toolbar))))
101 (provide 'message-xmas)
103 ;;; message-xmas.el ends here