gnus-util.el (iswitchb-mode): Declare
[gnus] / lisp / gnus-spec.el
index f40177d..035a590 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-spec.el --- format spec functions for Gnus
 
-;; Copyright (C) 1996-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2015 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -24,9 +24,6 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile (require 'cl))
 (defvar gnus-newsrc-file-version)
 
@@ -81,7 +78,6 @@ text properties. This is only needed on XEmacs, as Emacs does this anyway."
 (defvar gnus-tmp-unread-and-unselected)
 (defvar gnus-tmp-news-method)
 (defvar gnus-tmp-news-server)
-(defvar gnus-tmp-article-number)
 (defvar gnus-mouse-face)
 (defvar gnus-mouse-face-prop)
 (defvar gnus-tmp-header)
@@ -265,7 +261,14 @@ Return a list of updated types."
 (defun gnus-face-face-function (form type)
   `(gnus-add-text-properties
     (point) (progn ,@form (point))
-    '(gnus-face t face ,(symbol-value (intern (format "gnus-face-%d" type))))))
+    (cons 'face
+         (cons
+          ;; Delay consing the value of the `face' property until
+          ;; `gnus-add-text-properties' runs, since it will be modified
+          ;; by `gnus-put-text-property-excluding-characters-with-faces'.
+          (list ',(symbol-value (intern (format "gnus-face-%d" type))) 'default)
+          ;; Redundant now, but still convenient.
+          '(gnus-face t)))))
 
 (defun gnus-balloon-face-function (form type)
   `(gnus-put-text-property
@@ -411,7 +414,7 @@ characters when given a pad value."
   ;; them will have the balloon-help text property.
   (let ((case-fold-search nil))
     (if (string-match
-        "\\`\\(.*\\)%[0-9]?[{(«]\\(.*\\)%[0-9]?[»})]\\(.*\n?\\)\\'\\|%[-0-9]*=\\|%[-0-9]*\\*"
+        "\\`\\(.*\\)%[0-9]?[{(«]\\(.*\\)%[0-9]?[»})]\\(.*\n?\\)\\'\\|%[-0-9]*=\\|%[-0-9]*\\*"
         format)
        (gnus-parse-complex-format format spec-alist)
       ;; This is a simple format.
@@ -428,13 +431,13 @@ characters when given a pad value."
       (goto-char (point-min))
       (insert "(\"")
       ;; Convert all font specs into font spec lists.
-      (while (re-search-forward "%\\([0-9]+\\)?\\([«»{}()]\\)" nil t)
+      (while (re-search-forward "%\\([0-9]+\\)?\\([«»{}()]\\)" nil t)
        (let ((number (if (match-beginning 1)
                          (match-string 1) "0"))
              (delim (aref (match-string 2) 0)))
          (if (or (= delim ?\()
                  (= delim ?\{)
-                 (= delim ?\«))
+                 (= delim 171)) ; «
              (replace-match (concat "\"("
                                     (cond ((= delim ?\() "mouse")
                                           ((= delim ?\{) "face")
@@ -505,7 +508,8 @@ are supported for %s."
          (delete-char -1))
         (t
          (if (null args)
-             (error 'wrong-number-of-arguments #'my-format n fstring))
+             (signal 'wrong-number-of-arguments
+                     (list #'gnus-xmas-format n fstring)))
          (let* ((minlen (string-to-number (or (match-string 2) "")))
                 (arg (car args))
                 (str (if (stringp arg) arg (format "%s" arg)))
@@ -726,7 +730,7 @@ If PROPS, insert the result."
 (provide 'gnus-spec)
 
 ;; Local Variables:
-;; coding: iso-8859-1
+;; coding: utf-8
 ;; End:
 
 ;;; gnus-spec.el ends here