From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/79590 Path: news.gmane.org!not-for-mail From: Daniel Dehennin Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Fontification of an org-mode source block in PGP signed message does not work Date: Thu, 28 Jul 2011 19:44:24 +0200 Message-ID: <874o262tc7.fsf@hati.baby-gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1311875120 25791 80.91.229.12 (28 Jul 2011 17:45:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2011 17:45:20 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M27886@lists.math.uh.edu Thu Jul 28 19:45:16 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QmUe2-0007ag-IK for ding-account@gmane.org; Thu, 28 Jul 2011 19:45:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1QmUdL-0005vX-0t; Thu, 28 Jul 2011 12:44:31 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1QmUdJ-0005vE-1G for ding@lists.math.uh.edu; Thu, 28 Jul 2011 12:44:29 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1QmUdH-0005he-R8 for ding@lists.math.uh.edu; Thu, 28 Jul 2011 12:44:28 -0500 Original-Received: from zion.baby-gnu.org ([82.233.222.74]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1QmUdF-0000u7-04 for ding@gnus.org; Thu, 28 Jul 2011 19:44:25 +0200 Original-Received: from hati.asgardr.info ([192.168.1.2] helo=hati.baby-gnu.org) by zion.baby-gnu.org with esmtp (Exim 4.76) (envelope-from ) id 1QmUdE-0004Mz-MO for ding@gnus.org; Thu, 28 Jul 2011 19:44:24 +0200 Organisation: Dark Church of Emacs User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-Spam-Score: -3.1 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:79590 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable You can merge my changes from the dad/master branch of my repository[1]. As an exemple, here is an org-mode source block which should not work for unpatched 'mm-dissect-buffer': #+begin_src emacs-lisp ;; This is not fontified for unpatched sources. (setq foo "bar") #+end_src Regards. Signed messages are passed thought 'mm-uu-dissect-text-parts' and unsigned one thought 'mm-uu-dissect'. 'gnus-display-mime' do the job: =2D when no MIME header and 'gnus-article-emulate-mime' is t, it process mail to find emulated parts like #+begin_/#+end_ for org-mode source blocks, =2D when a MIME header is present, each part is processed using 'mm-uu-dissect-text-parts'. 'mm-uu-dissect-text-parts' should process each part with 'mm-uu-dissect' but does not in that case. The problem is located in 'mm-dissect-buffer' which does not define the content-disposition if none is present in the MIME header. * lisp/mm-decode.el (mm-dissect-buffer): Set undefined content-disposition to "inline" if the part is text based. =2D-- lisp/mm-decode.el | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) #+begin_src diff diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index a51c663..760d2d0 100644 =2D-- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -564,7 +564,14 @@ Postpone undisplaying of viewers for types in (setq ct (mail-fetch-field "content-type") ctl (and ct (mail-header-parse-content-type ct)) cte (mail-fetch-field "content-transfer-encoding") =2D cd (mail-fetch-field "content-disposition") + cd (or (mail-fetch-field "content-disposition") + (if (and (not (null ctl)) + (string-match "mm-inline-text" + (symbol-name + (cadr (mm-assoc-string-match + mm-inline-media-tests + (car ctl)))))) + "inline")) ;; Newlines in description should be stripped so as ;; not to break the MIME tag into two or more lines. description (message-fetch-field "content-description") =2D-=20 1.7.5.4 #+end_src Footnotes:=20 [1] http://www.baby-gnu.org/~nebu/archives/gnus/gnus.git/ =2D-=20 Daniel Dehennin R=C3=A9cup=C3=A9rer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iEYEAREKAAYFAk4xn/gACgkQb97L6l6P4FuBhQCfUTBuGUMFWMO73Ie3HmdCuRAD ZB8An2QDxJ3W+/Jop4GFgFHO7T9KN9U/ =pbnp -----END PGP SIGNATURE----- --=-=-=--