*** empty log message ***
[gnus] / lisp / gnus-cite.el
index 09d688c..0a1c4c5 100644 (file)
@@ -107,7 +107,7 @@ The first regexp group should match the Supercite attribution."
   :type 'regexp)
 
 (defcustom gnus-cite-attribution-suffix
-  "\\(\\(wrote\\|writes\\|said\\|says\\|>\\)\\(:\\|\\.\\.\\.\\)\\)[    ]*$"
+  "\\(\\(wrote\\|writes\\|said\\|says\\|>\\)\\(:\\|\\.\\.\\.\\)\\)[ \t]*$"
   "Regexp matching the end of an attribution line.
 The text matching the first grouping will be used as a button."
   :group 'gnus-cite
@@ -258,6 +258,7 @@ This should make it easier to see who wrote what."
 ;;; Internal Variables:
 
 (defvar gnus-cite-article nil)
+(defvar gnus-cite-overlay-list nil)
 
 (defvar gnus-cite-prefix-alist nil)
 ;; Alist of citation prefixes.
@@ -383,7 +384,7 @@ Lines matching `gnus-cite-attribution-suffix' and perhaps
       (gnus-article-search-signature)
       (push (cons (point-marker) "") marks)
       ;; Sort the marks.
-      (setq marks (sort marks (lambda (m1 m2) (< (car m1) (car m2)))))
+      (setq marks (sort marks 'car-less-than-car))
       (let ((omarks marks))
        (setq marks nil)
        (while (cdr omarks)
@@ -449,9 +450,7 @@ See the documentation for `gnus-article-highlight-citation'.
 If given a negative prefix, always show; if given a positive prefix,
 always hide."
   (interactive (append (gnus-article-hidden-arg) (list 'force)))
-  (setq gnus-cited-text-button-line-format-spec
-       (gnus-parse-format gnus-cited-text-button-line-format
-                          gnus-cited-text-button-line-format-alist t))
+  (gnus-set-format 'cited-text-button t)
   (save-excursion
     (set-buffer gnus-article-buffer)
     (cond
@@ -572,13 +571,15 @@ See also the documentation for `gnus-article-highlight-citation'."
 
 (defun gnus-cite-parse-maybe (&optional force)
   ;; Parse if the buffer has changes since last time.
-  (if (equal gnus-cite-article gnus-article-current)
+  (if (and (not force) (equal gnus-cite-article gnus-article-current))
       ()
     ;;Reset parser information.
     (setq gnus-cite-prefix-alist nil
          gnus-cite-attribution-alist nil
          gnus-cite-loose-prefix-alist nil
          gnus-cite-loose-attribution-alist nil)
+    (while gnus-cite-overlay-list
+      (gnus-delete-overlay (pop gnus-cite-overlay-list)))
     ;; Parse if not too large.
     (if (and (not force)
             gnus-cite-parse-max-size
@@ -858,9 +859,9 @@ See also the documentation for `gnus-article-highlight-citation'."
   ;; At line NUMBER, ignore PREFIX and add FACE to the rest of the line.
   (when face
     (let ((inhibit-point-motion-hooks t)
-         from to)
+         from to overlay)
       (goto-line number)
-      (unless (eobp);; Sometimes things become confused.
+      (unless (eobp)                   ; Sometimes things become confused.
        (forward-char (length prefix))
        (skip-chars-forward " \t")
        (setq from (point))
@@ -868,7 +869,9 @@ See also the documentation for `gnus-article-highlight-citation'."
        (skip-chars-backward " \t")
        (setq to (point))
        (when (< from to)
-         (gnus-overlay-put (gnus-make-overlay from to) 'face face))))))
+         (push (setq overlay (gnus-make-overlay from to))
+               gnus-cite-overlay-list)
+         (gnus-overlay-put overlay 'face face))))))
 
 (defun gnus-cite-toggle (prefix)
   (save-excursion