projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Give a better error message in the "go offline" case.
[gnus]
/
lisp
/
deuglify.el
diff --git
a/lisp/deuglify.el
b/lisp/deuglify.el
index
21ef5bc
..
60f8c95
100644
(file)
--- a/
lisp/deuglify.el
+++ b/
lisp/deuglify.el
@@
-1,29
+1,27
@@
;;; deuglify.el --- deuglify broken Outlook (Express) articles
;;; deuglify.el --- deuglify broken Outlook (Express) articles
-;; Copyright (C) 200
2, 2003 Free Software Foundation, Inc.
-;;
Copyright (C) 2001, 2002 Raymond Scholz
+;; Copyright (C) 200
1, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;;
Free Software Foundation, Inc.
;; Author: Raymond Scholz <rscholz@zonix.de>
;; Author: Raymond Scholz <rscholz@zonix.de>
-;; Thomas Steffen
(unwrapping algorithm,
-;;
based on an idea of Stefan Monnier)
+;; Thomas Steffen
+;;
(unwrapping algorithm,
based on an idea of Stefan Monnier)
;; Keywords: mail, news
;; This file is part of GNU Emacs.
;; Keywords: mail, news
;; 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
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation
; either version 2, 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
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; 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., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Commentary:
@@
-68,7
+66,7
@@
;; > verb. This sentence no verb. This sentence no verb. This
;; > sentence no verb.
;;
;; > verb. This sentence no verb. This sentence no verb. This
;; > sentence no verb.
;;
-;; Unwrapping "You forgot in all your sentences." would be i
llegal
as
+;; Unwrapping "You forgot in all your sentences." would be i
nvalid
as
;; this part wasn't intended to be cited text.
;; `gnus-article-outlook-unwrap-lines' will only unwrap lines if the resulting
;; citation line will be of a certain maximum length. You can control
;; this part wasn't intended to be cited text.
;; `gnus-article-outlook-unwrap-lines' will only unwrap lines if the resulting
;; citation line will be of a certain maximum length. You can control
@@
-146,7
+144,7
@@
;; Hey, John. There's no in all your sentences!
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Hey, John. There's no in all your sentences!
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
+;;
;; Usage
;; -----
;;
;; Usage
;; -----
;;
@@
-230,58
+228,66
@@
;;; User Customizable Variables:
(defgroup gnus-outlook-deuglify nil
;;; User Customizable Variables:
(defgroup gnus-outlook-deuglify nil
- "Deuglify articles generated by broken user agents like MS Outlook (Express).")
+ "Deuglify articles generated by broken user agents like MS Outlook (Express)."
+ :version "22.1"
+ :group 'gnus)
-;;;###autoload
(defcustom gnus-outlook-deuglify-unwrap-min 45
"Minimum length of the cited line above the (possibly) wrapped line."
(defcustom gnus-outlook-deuglify-unwrap-min 45
"Minimum length of the cited line above the (possibly) wrapped line."
+ :version "22.1"
:type 'integer
:group 'gnus-outlook-deuglify)
:type 'integer
:group 'gnus-outlook-deuglify)
-;;;###autoload
(defcustom gnus-outlook-deuglify-unwrap-max 95
"Maximum length of the cited line after unwrapping."
(defcustom gnus-outlook-deuglify-unwrap-max 95
"Maximum length of the cited line after unwrapping."
+ :version "22.1"
:type 'integer
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-cite-marks ">|#%"
"Characters that indicate cited lines."
:type 'integer
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-cite-marks ">|#%"
"Characters that indicate cited lines."
+ :version "22.1"
:type 'string
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-unwrap-stop-chars nil ;; ".?!" or nil
"Characters that inhibit unwrapping if they are the last one on the cited line above the possible wrapped line."
:type 'string
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-unwrap-stop-chars nil ;; ".?!" or nil
"Characters that inhibit unwrapping if they are the last one on the cited line above the possible wrapped line."
+ :version "22.1"
:type '(radio (const :format "None " nil)
:type '(radio (const :format "None " nil)
- (string :
size 0 :
value ".?!"))
+ (string :value ".?!"))
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-no-wrap-chars "`"
"Characters that inhibit unwrapping if they are the first one in the possibly wrapped line."
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-no-wrap-chars "`"
"Characters that inhibit unwrapping if they are the first one in the possibly wrapped line."
+ :version "22.1"
:type 'string
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-attrib-cut-regexp
"\\(On \\|Am \\)?\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),[^,]+, "
"Regular expression matching the beginning of an attribution line that should be cut off."
:type 'string
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-attrib-cut-regexp
"\\(On \\|Am \\)?\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),[^,]+, "
"Regular expression matching the beginning of an attribution line that should be cut off."
+ :version "22.1"
:type 'string
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-attrib-verb-regexp
"wrote\\|writes\\|says\\|schrieb\\|schreibt\\|meinte\\|skrev\\|a écrit\\|schreef\\|escribió"
"Regular expression matching the verb used in an attribution line."
:type 'string
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-attrib-verb-regexp
"wrote\\|writes\\|says\\|schrieb\\|schreibt\\|meinte\\|skrev\\|a écrit\\|schreef\\|escribió"
"Regular expression matching the verb used in an attribution line."
+ :version "22.1"
:type 'string
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-attrib-end-regexp
": *\\|\\.\\.\\."
"Regular expression matching the end of an attribution line."
:type 'string
:group 'gnus-outlook-deuglify)
(defcustom gnus-outlook-deuglify-attrib-end-regexp
": *\\|\\.\\.\\."
"Regular expression matching the end of an attribution line."
+ :version "22.1"
:type 'string
:group 'gnus-outlook-deuglify)
:type 'string
:group 'gnus-outlook-deuglify)
-;;;###autoload
(defcustom gnus-outlook-display-hook nil
"A hook called after an deuglified article has been prepared.
It is run after `gnus-article-prepare-hook'."
(defcustom gnus-outlook-display-hook nil
"A hook called after an deuglified article has been prepared.
It is run after `gnus-article-prepare-hook'."
+ :version "22.1"
:type 'hook
:group 'gnus-outlook-deuglify)
:type 'hook
:group 'gnus-outlook-deuglify)
@@
-322,15
+328,15
@@
NODISPLAY is non-nil, don't redisplay the article buffer."
nil t)
(let ((len12 (- (match-end 2) (match-beginning 1)))
(len3 (- (match-end 3) (match-beginning 3))))
nil t)
(let ((len12 (- (match-end 2) (match-beginning 1)))
(len3 (- (match-end 3) (match-beginning 3))))
- (if (and (> len12 gnus-outlook-deuglify-unwrap-min)
- (< (+ len12 len3) gnus-outlook-deuglify-unwrap-max))
- (progn
- (replace-match "\\1\\2 \\3")
- (goto-char (match-beginning 0))))))))
+ (when (and (> len12 gnus-outlook-deuglify-unwrap-min)
+ (< (+ len12 len3) gnus-outlook-deuglify-unwrap-max))
+ (replace-match "\\1\\2 \\3")
+ (goto-char (match-beginning 0)))))))
(unless nodisplay (gnus-outlook-display-article-buffer)))
(defun gnus-outlook-rearrange-article (attr-start)
"Put the text from ATTR-START to the end of buffer at the top of the article buffer."
(unless nodisplay (gnus-outlook-display-article-buffer)))
(defun gnus-outlook-rearrange-article (attr-start)
"Put the text from ATTR-START to the end of buffer at the top of the article buffer."
+ ;; FIXME: 1. (*) text/plain ( ) text/html
(let ((inhibit-read-only t)
(cite-marks gnus-outlook-deuglify-cite-marks))
(gnus-with-article-buffer
(let ((inhibit-read-only t)
(cite-marks gnus-outlook-deuglify-cite-marks))
(gnus-with-article-buffer
@@
-345,8
+351,18
@@
NODISPLAY is non-nil, don't redisplay the article buffer."
(point-max))))
;; handle the case where the full quote is below the
;; signature
(point-max))))
;; handle the case where the full quote is below the
;; signature
- (if (< to attr-start)
+ (when (< to attr-start)
+ (setq to (point-max)))
+ (save-excursion
+ (narrow-to-region attr-start to)
+ (goto-char attr-start)
+ (forward-line)
+ (unless (looking-at ">")
+ (message-indent-citation (point) (point-max) 'yank-only)
+ (goto-char (point-max))
+ (newline)
(setq to (point-max)))
(setq to (point-max)))
+ (widen))
(transpose-regions cur attr-start attr-start to))))))
;; John Doe <john.doe@some.domain> wrote in message
(transpose-regions cur attr-start attr-start to))))))
;; John Doe <john.doe@some.domain> wrote in message