Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: Re: Highlighting with GPG signed messages.
Date: Thu, 02 Aug 2007 14:53:21 +0900	[thread overview]
Message-ID: <b4mk5seo52m.fsf@jpl.org> (raw)
In-Reply-To: <87r6mn8hkf.fsf@lrde.org>


[-- Attachment #1.1: Type: text/plain, Size: 611 bytes --]

>>>>> Michaël Cadilhac wrote:

> When viewing a GPG signed message, the highlighting of citation and
> signature isn't made. This is due to the `last' condition for the
> highlighting to happen in the treatment functions.

> For example, if you have a two parts message (Text + sig),
> gnus-mime-display-security is called with the first one and the second
> part is like discarded. So current-part and total-parts are never
> equals and `last' is never validated.

> This is the shortest patch I could came with :

This is too short to work with forwarded signed messages.
How about this one?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Type: text/x-patch, Size: 950 bytes --]

--- gnus-art.el~	2007-07-20 11:23:53 +0000
+++ gnus-art.el	2007-08-02 05:46:46 +0000
@@ -5451,10 +5451,18 @@
 	  (save-excursion
 	    (save-restriction
 	      (narrow-to-region beg (point))
-	      (gnus-treat-article
-	       nil id
-	       (gnus-article-mime-total-parts)
-	       (mm-handle-media-type handle)))))))))
+	      ;; Don't count signature parts that are never displayed.
+	      ;; The part number should be re-calculated supposing this
+	      ;; might be a message/rfc822 part.
+	      (let (handles)
+		(dolist (part gnus-article-mime-handles)
+		  (unless (or (stringp part)
+			      (equal (car (mm-handle-type part))
+				     "application/pgp-signature"))
+		    (push part handles)))
+		(gnus-treat-article
+		 nil (length (memq handle handles)) (length handles)
+		 (mm-handle-media-type handle))))))))))
 
 (defun gnus-unbuttonized-mime-type-p (type)
   "Say whether TYPE is to be unbuttonized."

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

  reply	other threads:[~2007-08-02  5:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-01 14:17 Michaël Cadilhac
2007-08-02  5:53 ` Katsumi Yamaoka [this message]
2007-08-02  6:28   ` Katsumi Yamaoka
2007-08-03 12:08     ` Katsumi Yamaoka
2007-08-03 12:38     ` Michaël Cadilhac
2007-08-06  2:14       ` Katsumi Yamaoka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mk5seo52m.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).