From: Reiner Steib Date: Fri, 26 May 2006 17:50:12 +0000 (+0000) Subject: * deuglify.el (gnus-outlook-rearrange-article): Add missing citation X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=db9d01f6f4a9350d94b8410cdc24ca62660ce437;p=gnus * deuglify.el (gnus-outlook-rearrange-article): Add missing citation marks. * message.el (message-indent-citation): Add optional arguments to allow using it outside of message buffers. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 81794f13e..1a86e7276 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2006-05-26 Reiner Steib + * deuglify.el (gnus-outlook-rearrange-article): Add missing citation + marks. + + * message.el (message-indent-citation): Add optional arguments to allow + using it outside of message buffers. + * gnus-art.el (gnus-article-unfold-long-headers): New variable. (gnus-article-treat-unfold-headers): Use it. (gnus-article-truncate-lines): New variable. diff --git a/lisp/deuglify.el b/lisp/deuglify.el index 8eb75ce63..83cf7fc02 100644 --- a/lisp/deuglify.el +++ b/lisp/deuglify.el @@ -338,6 +338,7 @@ NODISPLAY is non-nil, don't redisplay 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." + ;; FIXME: 1. (*) text/plain ( ) text/html (let ((inhibit-read-only t) (cite-marks gnus-outlook-deuglify-cite-marks)) (gnus-with-article-buffer @@ -352,8 +353,18 @@ NODISPLAY is non-nil, don't redisplay the article buffer." (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))) + (widen)) (transpose-regions cur attr-start attr-start to)))))) ;; John Doe wrote in message diff --git a/lisp/message.el b/lisp/message.el index 628f804aa..fe4378299 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -3300,14 +3300,15 @@ Numeric argument means justify as well." (let ((fill-prefix message-yank-prefix)) (fill-individual-paragraphs (point) (point-max) justifyp)))) -(defun message-indent-citation () +(defun message-indent-citation (&optional start end yank-only) "Modify text just inserted from a message to be cited. The inserted text should be the region. When this function returns, the region is again around the modified text. Normally, indent each nonblank line `message-indentation-spaces' spaces. However, if `message-yank-prefix' is non-nil, insert that prefix on each line." - (let ((start (point))) + (unless start (setq start (point))) + (unless yank-only ;; Remove unwanted headers. (when message-ignored-cited-headers (let (all-removed) @@ -3335,21 +3336,21 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line." (insert "\n")) (while (and (zerop (forward-line -1)) (looking-at "$")) - (message-delete-line)) - ;; Do the indentation. - (if (null message-yank-prefix) - (indent-rigidly start (mark t) message-indentation-spaces) - (save-excursion - (goto-char start) - (while (< (point) (mark t)) - (cond ((looking-at ">") - (insert message-yank-cited-prefix)) - ((looking-at "^$") - (insert message-yank-empty-prefix)) - (t - (insert message-yank-prefix))) - (forward-line 1)))) - (goto-char start))) + (message-delete-line))) + ;; Do the indentation. + (if (null message-yank-prefix) + (indent-rigidly start (or end (mark t)) message-indentation-spaces) + (save-excursion + (goto-char start) + (while (< (point) (or end (mark t))) + (cond ((looking-at ">") + (insert message-yank-cited-prefix)) + ((looking-at "^$") + (insert message-yank-empty-prefix)) + (t + (insert message-yank-prefix))) + (forward-line 1)))) + (goto-char start)) (defun message-yank-original (&optional arg) "Insert the message being replied to, if any.