*** empty log message ***
[gnus] / lisp / messagexmas.el
index aca2ba2..dcae0ba 100644 (file)
@@ -25,7 +25,9 @@
 
 ;;; 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
@@ -43,31 +45,16 @@ If it is non-nil, it must be a toolbar.  The five legal values are
 
 (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))
@@ -86,7 +73,8 @@ If it is non-nil, it must be a toolbar.  The five legal values are
          (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)))))))
@@ -100,7 +88,9 @@ If it is non-nil, it must be a toolbar.  The five legal values are
 
 (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)