;;; Code:
-(defvar message-xmas-dont-activate-region nil
+(require 'nnheader)
+
+(defvar message-xmas-dont-activate-region t
"If t, don't activate region after yanking.")
(defvar message-xmas-glyph-directory nil
(defvar message-toolbar
'([message-spell ispell-message t "Spell"]
- [message-help (toolbar-info "message") t "Message help"])
+ [message-help (Info-goto-node "(Message)Top") t "Message help"])
"The message buffer toolbar.")
(defun message-xmas-find-glyph-directory (&optional package)
(setq package (or package "message"))
- (let ((path load-path)
- (dir (symbol-value
- (intern-soft (concat package "-xmas-glyph-directory"))))
- result)
+ (let ((dir (symbol-value
+ (intern-soft (concat package "-xmas-glyph-directory")))))
(if (and (stringp dir) (file-directory-p dir))
dir
- ;; We try to find the dir by looking at the load path,
- ;; stripping away the last component and adding "etc/".
- (while path
- (if (and (car path)
- (file-exists-p
- (setq dir (concat
- (file-name-directory
- (directory-file-name (car path)))
- "etc/" (or package "message") "/")))
- (file-directory-p dir))
- (setq result dir
- path nil)
- (setq path (cdr path))))
- result)))
+ (nnheader-find-etc-directory package))))
(defun message-xmas-setup-toolbar (bar &optional force package)
(let ((dir (message-xmas-find-glyph-directory package))
(setq down (concat dir name "-down." xpm))
(setq disabled (concat dir name "-disabled." xpm))
(if (not (file-exists-p up))
- (set icon nil)
+ (setq bar nil
+ dir nil)
(set icon (toolbar-make-button-list
up (and (file-exists-p down) down)
(and (file-exists-p disabled) disabled)))))))
(defun message-xmas-exchange-point-and-mark ()
"Exchange point and mark, but allow for XEmacs' optional argument."
- (exchange-point-and-mark message-dont-activate-region))
+ (exchange-point-and-mark message-xmas-dont-activate-region))
+
+(fset 'message-exchange-point-and-mark 'message-xmas-exchange-point-and-mark)
(provide 'messagexmas)