Merge branch 'master' of https://git.gnus.org/gnus
[gnus] / lisp / gnus-cite.el
index 64c0864..9502bd8 100644 (file)
@@ -1,16 +1,16 @@
 ;;; gnus-cite.el --- parse citations in articles for Gnus
 
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Per Abhiddenware
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,9 +18,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -144,6 +142,7 @@ the envelope From line."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-attribution-face 'face-alias 'gnus-cite-attribution)
+(put 'gnus-cite-attribution-face 'obsolete-face "22.1")
 
 (defcustom gnus-cite-attribution-face 'gnus-cite-attribution
   "Face used for attribution lines.
@@ -164,6 +163,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-1 'face-alias 'gnus-cite-1)
+(put 'gnus-cite-face-1 'obsolete-face "22.1")
 
 (defface gnus-cite-2 '((((class color)
                         (background dark))
@@ -177,6 +177,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-2 'face-alias 'gnus-cite-2)
+(put 'gnus-cite-face-2 'obsolete-face "22.1")
 
 (defface gnus-cite-3 '((((class color)
                         (background dark))
@@ -190,6 +191,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-3 'face-alias 'gnus-cite-3)
+(put 'gnus-cite-face-3 'obsolete-face "22.1")
 
 (defface gnus-cite-4 '((((class color)
                         (background dark))
@@ -203,6 +205,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-4 'face-alias 'gnus-cite-4)
+(put 'gnus-cite-face-4 'obsolete-face "22.1")
 
 (defface gnus-cite-5 '((((class color)
                         (background dark))
@@ -216,6 +219,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-5 'face-alias 'gnus-cite-5)
+(put 'gnus-cite-face-5 'obsolete-face "22.1")
 
 (defface gnus-cite-6 '((((class color)
                         (background dark))
@@ -229,6 +233,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-6 'face-alias 'gnus-cite-6)
+(put 'gnus-cite-face-6 'obsolete-face "22.1")
 
 (defface gnus-cite-7 '((((class color)
                         (background dark))
@@ -242,6 +247,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-7 'face-alias 'gnus-cite-7)
+(put 'gnus-cite-face-7 'obsolete-face "22.1")
 
 (defface gnus-cite-8 '((((class color)
                         (background dark))
@@ -255,6 +261,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-8 'face-alias 'gnus-cite-8)
+(put 'gnus-cite-face-8 'obsolete-face "22.1")
 
 (defface gnus-cite-9 '((((class color)
                         (background dark))
@@ -268,6 +275,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-9 'face-alias 'gnus-cite-9)
+(put 'gnus-cite-face-9 'obsolete-face "22.1")
 
 (defface gnus-cite-10 '((((class color)
                          (background dark))
@@ -281,6 +289,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-10 'face-alias 'gnus-cite-10)
+(put 'gnus-cite-face-10 'obsolete-face "22.1")
 
 (defface gnus-cite-11 '((((class color)
                          (background dark))
@@ -294,6 +303,7 @@ It is merged with the face for the cited text belonging to the attribution."
   :group 'gnus-cite)
 ;; backward-compatibility alias
 (put 'gnus-cite-face-11 'face-alias 'gnus-cite-11)
+(put 'gnus-cite-face-11 'obsolete-face "22.1")
 
 (defcustom gnus-cite-face-list
   '(gnus-cite-1 gnus-cite-2 gnus-cite-3 gnus-cite-4 gnus-cite-5 gnus-cite-6
@@ -542,6 +552,24 @@ If WIDTH (the numerical prefix), use that text width when filling."
              gnus-cite-loose-attribution-alist nil
              gnus-cite-article nil)))))
 
+(defun gnus-article-natural-long-line-p ()
+  "Return true if the current line is long, and it's natural text."
+  (save-excursion
+    (beginning-of-line)
+    (and
+     ;; The line is long.
+     (> (- (line-end-position) (line-beginning-position))
+       (frame-width))
+     ;; It doesn't start with spaces.
+     (not (looking-at "    "))
+     ;; Not cited text.
+     (let ((line-number (1+ (count-lines (point-min) (point))))
+          citep)
+       (dolist (elem gnus-cite-prefix-alist)
+        (when (member line-number (cdr elem))
+          (setq citep t)))
+       (not citep)))))
+
 (defun gnus-article-hide-citation (&optional arg force)
   "Toggle hiding of all cited text except attribution lines.
 See the documentation for `gnus-article-highlight-citation'.
@@ -1238,5 +1266,5 @@ is turned on."
 ;; coding: iso-8859-1
 ;; End:
 
-;;; arch-tag: 1997b044-6067-471e-8c8f-dc903093098a
+;; arch-tag: 1997b044-6067-471e-8c8f-dc903093098a
 ;;; gnus-cite.el ends here