* hashcash.el (mail-add-payment): Replace mapcar called for effect with mapc.
[gnus] / lisp / gnus-xmas.el
index 95ab135..05da0e4 100644 (file)
@@ -1,7 +1,7 @@
 ;;; gnus-xmas.el --- Gnus functions for XEmacs
 
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
-;;        Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -10,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -39,7 +39,6 @@
 (defvar menu-bar-mode (featurep 'menubar))
 (require 'messagexmas)
 (require 'wid-edit)
-(require 'timer-funcs)
 
 (defgroup gnus-xmas nil
   "XEmacsoid support for Gnus"
@@ -368,7 +367,12 @@ call it with the value of the `gnus-data' text property."
    (t
     (defalias 'gnus-characterp 'characterp)))
 
-  (defalias 'gnus-make-overlay 'make-extent)
+  (defalias 'gnus-make-overlay
+    (lambda (beg end &optional buffer front-advance rear-advance)
+      "Create a new overlay with range BEG to END in BUFFER.
+FRONT-ADVANCE and REAR-ADVANCE are ignored."
+      (make-extent beg end buffer)))
+
   (defalias 'gnus-delete-overlay 'delete-extent)
   (defalias 'gnus-overlay-put 'set-extent-property)
   (defalias 'gnus-move-overlay 'gnus-xmas-move-overlay)
@@ -430,6 +434,8 @@ call it with the value of the `gnus-data' text property."
   (defalias 'gnus-mark-active-p 'region-exists-p)
   (defalias 'gnus-annotation-in-region-p 'gnus-xmas-annotation-in-region-p)
   (defalias 'gnus-mime-button-menu 'gnus-xmas-mime-button-menu)
+  (defalias 'gnus-mime-security-button-menu
+    'gnus-xmas-mime-security-button-menu)
   (defalias 'gnus-image-type-available-p 'gnus-xmas-image-type-available-p)
   (defalias 'gnus-put-image 'gnus-xmas-put-image)
   (defalias 'gnus-create-image 'gnus-xmas-create-image)
@@ -784,6 +790,21 @@ XEmacs compatibility workaround."
     (goto-char (event-point event))
     (funcall (event-function response) (event-object response))))
 
+(defun gnus-xmas-mime-security-button-menu (event prefix)
+  "Construct a context-sensitive menu of security commands."
+  (interactive "e\nP")
+  (let ((response
+        (get-popup-menu-response
+         `("Security Part"
+           ,@(delq nil
+                   (mapcar (lambda (c)
+                             (unless (eq (car c) 'undefined)
+                               `[,(caddr c) ,(car c) t]))
+                           gnus-mime-security-button-commands))))))
+    (set-buffer (event-buffer event))
+    (goto-char (event-point event))
+    (funcall (event-function response) (event-object response))))
+
 (defun gnus-group-add-icon ()
   "Add an icon to the current line according to `gnus-group-icon-list'."
   (let* ((p (point))
@@ -824,7 +845,7 @@ XEmacs compatibility workaround."
                             file)))
                (if glyph
                    (progn
-                     (mapcar 'delete-annotation (annotations-at myend))
+                     (mapc 'delete-annotation (annotations-at myend))
                      (let ((ext (make-extent mystart myend))
                            (ant (make-annotation glyph myend 'text)))
                        ;; set text extent params
@@ -857,7 +878,9 @@ XEmacs compatibility workaround."
                      gnus-mailing-list-menu))
 
 (defun gnus-xmas-image-type-available-p (type)
-  (and window-system
+  (and (if (fboundp 'display-images-p)
+          (display-images-p)
+        window-system)
        (featurep (if (eq type 'pbm) 'xbm type))))
 
 (defun gnus-xmas-create-image (file &optional type data-p &rest props)