2003-01-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 2 Jan 2003 22:16:11 +0000 (22:16 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 2 Jan 2003 22:16:11 +0000 (22:16 +0000)
* message.el (message-generate-headers): Let header formatters do
their work.

2003-01-02  Raymond Scholz  <ray-2003@zonix.de>

* deuglify.el (gnus-article-outlook-deuglify-article):
Rehighlight, reapply treatments and call
`gnus-article-prepare-hook'.  Suggested by Niels Olof Bouvin.
(gnus-outlook-repair-attribution-block): Recognize cited
attributions.  Suggested by Niklas Morberg.

2003-01-02  Pete Kazmier  <pete@kazmier.com>

* gnus-art.el (gnus-treat-predicate): Check condition first.

lisp/ChangeLog
lisp/deuglify.el
lisp/gnus-art.el
lisp/message.el

index aa14f51..0fd921b 100644 (file)
@@ -1,3 +1,20 @@
+2003-01-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * message.el (message-generate-headers): Let header formatters do
+       their work.
+
+2003-01-02  Raymond Scholz  <ray-2003@zonix.de>
+
+       * deuglify.el (gnus-article-outlook-deuglify-article):
+       Rehighlight, reapply treatments and call
+       `gnus-article-prepare-hook'.  Suggested by Niels Olof Bouvin.
+       (gnus-outlook-repair-attribution-block): Recognize cited
+       attributions.  Suggested by Niklas Morberg.
+
+2003-01-02  Pete Kazmier  <pete@kazmier.com>
+
+       * gnus-art.el (gnus-treat-predicate): Check condition first. 
+
 2003-01-02  Jesper Harder  <harder@ifa.au.dk>
 
        * lpath.el: Add url-http-file-exists-p.
@@ -46,8 +63,6 @@
 
        * dig.el (query-dig): Doc fix.
 
-Test.
-
 2003-01-02  Kai Gro\e,A_\e(Bjohann  <kai.grossjohann@uni-duisburg.de>
 
        * gnus-agent.el (gnus-agent-fetch-selected-article): Update whole
@@ -170,7 +185,7 @@ Test.
        * gnus-sum.el (gnus-summary-display-while-building): New
        variable.
 
-2002-01-01  Raymond Scholz  <ray-2003@zonix.de>
+2003-01-01  Raymond Scholz  <ray-2003@zonix.de>
 
        * deuglify.el (gnus-outlook-rearrange-article): Kill overlays
        before rearranging the article.
index 6c05034..81ba9e9 100644 (file)
@@ -310,18 +310,26 @@ length of an unwrapped citation line."
                  (replace-match "\\1\\2 \\3")
                  (goto-char (match-beginning 0))))))))))
 
-(defun gnus-outlook-rearrange-article (from-where)
-  "Put the text from `from-where' to the end of buffer at the top of the 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."
   (save-excursion
     (let ((inhibit-read-only t)
          (cite-marks gnus-outlook-deuglify-cite-marks))
       (gnus-with-article-buffer
        (article-goto-body)
-       ;; attribution out of place?
-       (unless (= (point) from-where)
+       ;; article does not start with attribution
+       (unless (= (point) attr-start)
          (gnus-kill-all-overlays)
-         (transpose-regions (point) (+ from-where 1)
-                            (+ from-where 1) (point-max)))))))
+         (let ((cur (point))
+               ;; before signature or end of buffer
+               (to (if (gnus-article-search-signature)
+                       (point)
+                     (point-max))))
+           ;; handle the case where the full quote is below the
+           ;; signature
+           (if (< to attr-start)
+               (setq to (point-max)))
+           (transpose-regions cur attr-start attr-start to)))))))
 
 ;; John Doe <john.doe@some.domain> wrote in message
 ;; news:a87usw8$dklsssa$2@some.news.server...
@@ -361,15 +369,13 @@ length of an unwrapped citation line."
       (gnus-with-article-buffer
        (article-goto-body)
        (if (re-search-forward
-            (concat "^----* ?[^-]+ ?----*\n"
-                    "[^\n]+: \\([^\n]+\\)\n"
-                    "[^\n]+: [^\n]+\n"
-                    "[^\n]+: [^\n]+\n"
-                    "[^\n]+: [^\n]+$")
+            (concat "^[" cite-marks " \t]*----* ?[^-]+ [^-]+ ?----*\n"
+                    "[^\n:]+:[ \t]*\\([^\n]+\\)\n"
+                    "\\([^\n:]+:[ \t]*[^\n]+\n\\)+")
             nil t)
            (progn
              (gnus-kill-all-overlays)
-             (replace-match "\\1 wrote:")
+             (replace-match "\\1 wrote:\n")
              (match-beginning 0)))))))
 
 ;; On Wed, 16 Jan 2002 23:23:30 +0100, John Doe <john.doe@some.domain> wrote:
@@ -426,7 +432,13 @@ length of an unwrapped citation line."
   (interactive)
   (gnus-outlook-deuglify-article)
   (with-current-buffer (or gnus-article-buffer (current-buffer))
-    (gnus-article-highlight t)))
+    ;; "Emulate" `gnus-article-prepare-display' without calling
+    ;; it. Calling `gnus-article-prepare-display' on an already
+    ;; prepared article removes all MIME parts.  I'm unsure whether
+    ;; this is a bug or not.
+    (gnus-article-highlight t)
+    (gnus-treat-article nil)
+    (gnus-run-hooks 'gnus-article-prepare-hook)))
 
 (provide 'deuglify)
 
index e1631db..b3f0b1a 100644 (file)
@@ -6253,6 +6253,8 @@ For example:
   (cond
    ((null val)
     nil)
+   (condition
+    (eq condition val))
    ((and (listp val)
         (stringp (car val)))
     (apply 'gnus-or (mapcar `(lambda (s)
@@ -6271,8 +6273,6 @@ For example:
        (equal (car val) type))
        (t
        (error "%S is not a valid predicate" pred)))))
-   (condition
-    (eq condition val))
    ((eq val t)
     t)
    ((eq val 'head)
index 69d57a4..a86b885 100644 (file)
@@ -4626,13 +4626,18 @@ Headers already prepared in the buffer are not modified."
                  (progn
                    ;; This header didn't exist, so we insert it.
                    (goto-char (point-max))
-                   (insert (if (stringp header) header (symbol-name header))
-                           ": " value)
-                   ;; We check whether the value was ended by a
-                   ;; newline.  If now, we insert one.
-                   (unless (bolp)
-                     (insert "\n"))
-                   (forward-line -1))
+                   (let ((formatter
+                          (cdr (assq header message-header-format-alist))))
+                     (if formatter
+                         (funcall formatter header value)
+                       (insert (if (stringp header)
+                                   header (symbol-name header))
+                               ": " value))
+                     ;; We check whether the value was ended by a
+                     ;; newline.  If now, we insert one.
+                     (unless (bolp)
+                       (insert "\n"))
+                     (forward-line -1)))
                ;; The value of this header was empty, so we clear
                ;; totally and insert the new value.
                (delete-region (point) (gnus-point-at-eol))