Merge from gnus--rel--5.10
[gnus] / lisp / gnus-cite.el
index 4dd58b5..5d1b2b2 100644 (file)
@@ -9,7 +9,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,
@@ -271,7 +271,7 @@ It is merged with the face for the cited text belonging to the attribution."
 
 (defface gnus-cite-10 '((((class color)
                          (background dark))
-                        (:foreground "medium purple"))
+                        (:foreground "plum1"))
                        (((class color)
                          (background light))
                         (:foreground "medium purple"))
@@ -1150,8 +1150,8 @@ Returns nil if there is no such line before LIMIT, t otherwise."
                                       "[ \t [:alnum:]]+")))
                       gnus-message-max-citation-depth))
          (mlist (make-list (* (1+ gnus-message-max-citation-depth) 2) nil))
-         (start (line-beginning-position))
-         (end (line-end-position)))
+         (start (point-at-bol))
+         (end (point-at-eol)))
       (setcar mlist start)
       (setcar (cdr mlist) end)
       (setcar (nthcdr (* cdepth 2) mlist) start)
@@ -1175,12 +1175,18 @@ Returns nil if there is no such line before LIMIT, t otherwise."
   (defvar font-lock-keywords)
   (defvar font-lock-set-defaults))
 
+(eval-and-compile
+  (unless (featurep 'xemacs)
+    (autoload 'font-lock-set-defaults "font-lock")))
+
 (define-minor-mode gnus-message-citation-mode
   "Toggle `gnus-message-citation-mode' in current buffer.
 This buffer local minor mode provides additional font-lock support for
 nested citations.
-With prefix ARG, turn `gnus-message-citation-mode' on if and only if ARG is
-positive."
+With prefix ARG, turn `gnus-message-citation-mode' on if and only if ARG
+is positive.
+Automatically turn `font-lock-mode' on when `gnus-message-citation-mode'
+is turned on."
   nil ;; init-value
   "" ;; lighter
   nil ;; keymap
@@ -1207,11 +1213,16 @@ positive."
          (kill-local-variable default))))
     ;; Force `font-lock-set-defaults' to update `font-lock-keywords'.
     (if (featurep 'xemacs)
-       (setq font-lock-defaults-computed nil
-             font-lock-keywords nil)
+       (progn
+         (require 'font-lock)
+         (setq font-lock-defaults-computed nil
+               font-lock-keywords nil))
       (setq font-lock-set-defaults nil))
     (font-lock-set-defaults)
-    (font-lock-fontify-buffer)))
+    (cond ((symbol-value 'font-lock-mode)
+          (font-lock-fontify-buffer))
+         (gnus-message-citation-mode
+          (font-lock-mode 1)))))
 
 (defun turn-on-gnus-message-citation-mode ()
   "Turn on `gnus-message-citation-mode'."