Synch with Oort Gnus.
[elisp/gnus.git-] / lisp / gnus-xmas.el
index 2bcde76..cee9ee9 100644 (file)
@@ -82,16 +82,6 @@ Possibly the `etc' directory has not been installed.")))
   (cdr (assq gnus-xmas-logo-color-style gnus-xmas-logo-color-alist))
   "Colors used for the Gnus logo.")
 
-(defcustom gnus-article-x-face-command
-  (if (or (featurep 'xface)
-         (featurep 'xpm))
-      'gnus-xmas-article-display-xface
-    "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | ee -")
-  "*String or function to be executed to display an X-Face header.
-If it is a string, the command will be executed in a sub-shell
-asynchronously.         The compressed face will be piped to this command."
-  :type '(choice string function))
-
 ;;; Internal variables.
 
 ;; Don't warn about these undefined variables.
@@ -143,12 +133,12 @@ It is provided only to ease porting of broken FSF Emacs programs."
   (if (stringp buffer)
       nil
     (map-extents (lambda (extent ignored)
-                   (remove-text-properties
-                    start end
-                    (list (extent-property extent 'text-prop) nil)
-                    buffer)
+                  (remove-text-properties
+                   start end
+                   (list (extent-property extent 'text-prop) nil)
+                   buffer)
                   nil)
-                 buffer start end nil nil 'text-prop)
+                buffer start end nil nil 'text-prop)
     (gnus-add-text-properties start end props buffer)))
 
 (defun gnus-xmas-highlight-selected-summary ()
@@ -293,19 +283,19 @@ call it with the value of the `gnus-data' text property."
 (defun gnus-xmas-appt-select-lowest-window ()
   (let* ((lowest-window (selected-window))
         (bottom-edge (car (cdr (cdr (cdr (window-pixel-edges))))))
-         (last-window (previous-window))
-         (window-search t))
+        (last-window (previous-window))
+        (window-search t))
     (while window-search
       (let* ((this-window (next-window))
-             (next-bottom-edge (car (cdr (cdr (cdr
-                                               (window-pixel-edges
+            (next-bottom-edge (car (cdr (cdr (cdr
+                                              (window-pixel-edges
                                                this-window)))))))
-        (when (< bottom-edge next-bottom-edge)
+       (when (< bottom-edge next-bottom-edge)
          (setq bottom-edge next-bottom-edge)
          (setq lowest-window this-window))
 
-        (select-window this-window)
-        (when (eq last-window this-window)
+       (select-window this-window)
+       (when (eq last-window this-window)
          (select-window lowest-window)
          (setq window-search nil))))))
 
@@ -332,7 +322,7 @@ call it with the value of the `gnus-data' text property."
 (defun gnus-xmas-article-menu-add ()
   (gnus-xmas-menu-add article
     gnus-article-article-menu gnus-article-treatment-menu
-    gnus-article-post-menu))
+    gnus-article-post-menu gnus-article-commands-menu))
 
 (defun gnus-xmas-score-menu-add ()
   (gnus-xmas-menu-add score
@@ -432,7 +422,7 @@ call it with the value of the `gnus-data' text property."
   (defalias 'gnus-window-edges 'window-pixel-edges)
 
   (if (and (<= emacs-major-version 19)
-          (< emacs-minor-version 14))
+          (< emacs-minor-version 14))
       (defalias 'gnus-set-text-properties 'gnus-xmas-set-text-properties))
 
   (unless (boundp 'standard-display-table)
@@ -466,11 +456,11 @@ call it with the value of the `gnus-data' text property."
   (defalias 'gnus-group-startup-message 'gnus-xmas-group-startup-message)
   (defalias 'gnus-tree-minimize 'gnus-xmas-tree-minimize)
   (defalias 'gnus-appt-select-lowest-window
-       'gnus-xmas-appt-select-lowest-window)
+    'gnus-xmas-appt-select-lowest-window)
   (defalias 'gnus-mail-strip-quoted-names 'gnus-xmas-mail-strip-quoted-names)
   (defalias 'gnus-character-to-event 'character-to-event)
   (defalias 'gnus-mode-line-buffer-identification
-       'gnus-xmas-mode-line-buffer-identification)
+    'gnus-xmas-mode-line-buffer-identification)
   (defalias 'gnus-key-press-event-p 'key-press-event-p)
   (defalias 'gnus-region-active-p 'region-active-p)
   (defalias 'gnus-annotation-in-region-p 'gnus-xmas-annotation-in-region-p)
@@ -541,29 +531,7 @@ the resulting string may be narrower than END-COLUMN.
          (setq str (substring str from-idx idx))
          (if padding
              (concat head-padding str tail-padding)
-           str))))
-
-    (defun gnus-tilde-pad-form (el pad-width)
-      "Return a form that pads EL to PAD-WIDTH."
-      (let ((pad (abs pad-width)))
-       (if (symbolp el)
-           (if (< pad-width 0)
-               `(let ((val (format "%s" ,el)))
-                  (concat val (make-string
-                               (max 0 (- ,pad (string-width val))) ?\ )))
-             `(let ((val (format "%s" ,el)))
-                (concat (make-string
-                         (max 0 (- ,pad (string-width val))) ?\ )
-                        val)))
-         (if (< pad-width 0)
-             `(let ((val (eval ,el)))
-                (concat val (make-string
-                             (max 0 (- ,pad (string-width val))) ?\ )))
-           `(let ((val (eval ,el)))
-              (concat (make-string
-                       (max 0 (- ,pad (string-width val))) ?\ )
-                      val))))))
-    ))
+           str))))))
 
 ;;; XEmacs logo and toolbar.
 
@@ -617,23 +585,23 @@ the resulting string may be narrower than END-COLUMN.
       (set-window-start (selected-window) (point-min))))
    (t
     (insert "
-          _    ___ _             _
-          _ ___ __ ___  __    _ ___
-          __   _     ___    __  ___
-              _           ___     _
-             _  _ __             _
-             ___   __            _
-                   __           _
-                    _      _   _
-                   _      _    _
-                      _  _    _
-                  __  ___
-                 _   _ _     _
-                _   _
-              _    _
-             _    _
-            _
-          __
+         _    ___ _             _
+         _ ___ __ ___  __    _ ___
+         __   _     ___    __  ___
+             _           ___     _
+            _  _ __             _
+            ___   __            _
+                  __           _
+                   _      _   _
+                  _      _    _
+                     _  _    _
+                 __  ___
+                _   _ _     _
+               _   _
+             _    _
+            _    _
+           _
+         __
 
 "
            )
@@ -801,13 +769,15 @@ XEmacs compatibility workaround."
               (save-excursion
                 (gnus-set-work-buffer)
                 (insert-buffer-substring cur beg end)
-                (gnus-xmas-call-region "uncompface")
-                (goto-char (point-min))
-                (insert "/* Width=48, Height=48 */\n")
-                (gnus-xmas-call-region "icontopbm")
-                (gnus-xmas-call-region "ppmtoxpm")
-                (make-glyph
-                 (vector 'xpm :data (buffer-string))))))
+                (let ((coding-system-for-read 'binary)
+                      (coding-system-for-write 'binary))
+                  (gnus-xmas-call-region "uncompface")
+                  (goto-char (point-min))
+                  (insert "/* Width=48, Height=48 */\n")
+                  (gnus-xmas-call-region "icontopbm")
+                  (gnus-xmas-call-region "ppmtoxpm")
+                  (make-glyph
+                   (vector 'xpm :data (buffer-string)))))))
            (t
             (make-glyph [nothing]))))
          (ext (make-extent (progn
@@ -956,7 +926,7 @@ XEmacs compatibility workaround."
 
 (defun gnus-xmas-mailing-list-menu-add ()
   (gnus-xmas-menu-add mailing-list
-                     gnus-mailing-list-menu))
+    gnus-mailing-list-menu))
 
 (provide 'gnus-xmas)