From: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
To: ding@gnus.org
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 [thread overview]
Message-ID: <874o262tc7.fsf@hati.baby-gnu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2214 bytes --]
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:
- 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,
- 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.
---
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
--- 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")
- 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")
--
1.7.5.4
#+end_src
Footnotes:
[1] http://www.baby-gnu.org/~nebu/archives/gnus/gnus.git/
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next reply other threads:[~2011-07-28 17:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 17:44 Daniel Dehennin [this message]
2011-07-29 8:48 ` Julien Danjou
2011-07-29 9:43 ` Daniel Dehennin
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=874o262tc7.fsf@hati.baby-gnu.org \
--to=daniel.dehennin@baby-gnu.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).