1 ;;; messagexmas.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-dont-activate-region nil
29 "If t, don't activate region after yanking.")
31 (defvar message-xmas-glyph-directory nil
32 "*Directory where Message logos and icons are located.
33 If this variable is nil, Message will try to locate the directory
36 (defvar message-use-toolbar (if (featurep 'toolbar)
39 "*If nil, do not use a toolbar.
40 If it is non-nil, it must be a toolbar. The five legal values are
41 `default-toolbar', `top-toolbar', `bottom-toolbar',
42 `right-toolbar', and `left-toolbar'.")
44 (defvar message-toolbar
45 '([message-spell ispell-message t "Spell"]
46 [message-help (Info-goto-node "(Message)Top") t "Message help"])
47 "The message buffer toolbar.")
49 (defun message-xmas-find-glyph-directory (&optional package)
50 (setq package (or package "message"))
51 (let ((dir (symbol-value
52 (intern-soft (concat package "-xmas-glyph-directory")))))
53 (if (and (stringp dir) (file-directory-p dir))
55 (nnheader-find-etc-directory package))))
57 (defun message-xmas-setup-toolbar (bar &optional force package)
58 (let ((dir (message-xmas-find-glyph-directory package))
59 (xpm (if (featurep 'xpm) "xpm" "xbm"))
60 icon up down disabled name)
62 (setq message-xmas-glyph-directory dir))
65 (setq icon (aref (car bar) 0)
66 name (symbol-name icon)
70 (setq up (concat dir name "-up." xpm))
71 (setq down (concat dir name "-down." xpm))
72 (setq disabled (concat dir name "-disabled." xpm))
73 (if (not (file-exists-p up))
76 (set icon (toolbar-make-button-list
77 up (and (file-exists-p down) down)
78 (and (file-exists-p disabled) disabled)))))))
81 (defun message-setup-toolbar ()
82 (and message-use-toolbar
83 (message-xmas-setup-toolbar message-toolbar)
84 (set-specifier (symbol-value message-use-toolbar)
85 (cons (current-buffer) message-toolbar))))
87 (defun message-xmas-exchange-point-and-mark ()
88 "Exchange point and mark, but allow for XEmacs' optional argument."
89 (exchange-point-and-mark message-xmas-dont-activate-region))
91 (fset 'message-exchange-point-and-mark 'message-xmas-exchange-point-and-mark)
93 (provide 'messagexmas)
95 ;;; messagexmas.el ends here