From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/48630 Path: main.gmane.org!not-for-mail From: Raymond Scholz Newsgroups: gmane.emacs.gnus.general Subject: [patch] deuglify.el Date: Thu, 02 Jan 2003 22:59:04 +0100 Organization: =?UTF-8?Q?/=CB=8C=C9=94=CB=90=C9=A1=C9=99na=C9=AA=CB=88ze=C9=AA=CA=83n/?= Sender: owner-ding@hpc.uh.edu Message-ID: Reply-To: Raymond Scholz NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1041544958 1429 80.91.224.249 (2 Jan 2003 22:02:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 2 Jan 2003 22:02:38 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18UDQC-0000Mv-00 for ; Thu, 02 Jan 2003 23:02:37 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18UDQL-0002y4-00; Thu, 02 Jan 2003 16:02:45 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 02 Jan 2003 16:03:38 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id QAA25864 for ; Thu, 2 Jan 2003 16:03:22 -0600 (CST) Original-Received: (qmail 10499 invoked by alias); 2 Jan 2003 22:02:22 -0000 Original-Received: (qmail 10494 invoked from network); 2 Jan 2003 22:02:22 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by 66.230.238.6 with SMTP; 2 Jan 2003 22:02:22 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 18UDRN-00009Y-00 for ; Thu, 02 Jan 2003 23:03:49 +0100 Original-To: ding@gnus.org Original-Path: mde1.zonix.de!not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 119 Original-NNTP-Posting-Host: a9961.pppool.de Original-X-Trace: quimby.gnus.org 1041545029 584 213.6.153.97 (2 Jan 2003 22:03:49 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 2 Jan 2003 22:03:49 GMT X-Now-Playing: =?iso-8859-1?q?R=F6yksopp's?= _Poor Leno CDS_: =?iso-8859-1?q?"R=F6yksopp's?= Istanbul Forever Tale" X-Face: %.!RBc`e*wW)84O*\)VdkC}mU5c2Zh$y~ZRA3K594g/jp_&5bx\Oyes!/jK~4<<%KlaPn^\ 0 * 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. Ah, could someone correct my little accident with the last ChangeLog entry: --- ChangeLog 2003/01/02 19:56:50 6.1770 +++ ChangeLog 2003/01/02 21:49:30 @@ -149,7 +149,7 @@ * gnus-sum.el (gnus-summary-display-while-building): New variable. -2002-01-01 Raymond Scholz +2003-01-01 Raymond Scholz Cheers, Ray -- Gnus is already huge. Maybe it doesn't need all of this kind of stuff. - I think you mean "Gnus is huge, so adding more stuff won't make it noticeably bigger". (Chris Beggy and LMI on gnu.emacs.gnus) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=deuglify.el.patch Index: deuglify.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/deuglify.el,v retrieving revision 6.6 diff -u -r6.6 deuglify.el --- deuglify.el 2003/01/01 19:15:06 6.6 +++ deuglify.el 2003/01/02 21:52:21 @@ -310,18 +310,26 @@ (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 wrote in message ;; news:a87usw8$dklsssa$2@some.news.server... @@ -361,15 +369,13 @@ (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 wrote: @@ -426,7 +432,13 @@ (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) --=-=-=--