Post by Eric S Fraga[...]
Post by Thorsten Jolitzhmm ... I don't even know "who" is rendering/fontifying these blocks in
article mode. I'm not really up-to-date with gnus, but fairly up-to-date
with Org - is Org at all involved here?
Good questions. I know that I used to have, a very long time ago now,
my own customisations for viewing org snippets with fontification but
there is no sign of any such customisations in my files any
longer. Gnus itself must be taking care of it. So, from the git log of
,----
| commit 3313cd8482c0ac34077ae1ca4721bb6af8b0e0b6
| Date: Sat Jan 28 20:33:23 2012 +0100
|
| Make fontification of org modes work again
|
| * mm-view.el (mm-display-inline-fontify): Bind
| font-lock-support-mode'
| instead of setting it locally, since the latter doesn't seem to have
| any effect (most of the time).
`----
Maybe have a look at mm-view.el, specifically mm-display-inline-fontify?
Yes, this is the function doing the job:
,----[ C-h f mm-display-inline-fontify RET ]
| mm-display-inline-fontify is a Lisp function in `mm-view.el'.
|
| (mm-display-inline-fontify HANDLE &optional MODE)
|
| Insert HANDLE inline fontifying with MODE.
| If MODE is not set, try to find mode automatically.
`----
It looks alright to me, the only problem is that 'handle, i.e. the
org-element src-block in this case, lacks a trailing linefeed:
,----
| Result: "#+BEGIN_SRC emacs-lisp\n (- 2 2)\n#+END_SRC\n"
`----
now we need only to find out the place where 'handle' is parsed (I could
not find it in mm-view.el in reasonable time) then we would see the
cause of the problem.
If this uses the new parser, this is parsed:
,----[ C-h f org-element-src-block-parser RET ]
| org-element-src-block-parser is a compiled Lisp function in
| `org-element.el'.
| [...]
| Return a list whose CAR is `src-block' and CDR is a plist
| containing `:language', `:switches', `:parameters', `:begin',
| `:end', `:number-lines', `:retain-labels', `:use-labels',
| `:label-fmt', `:preserve-indent', `:value', `:post-blank' and
| `:post-affiliated' keywords.
`----
but the interpreter
,----[ C-h f org-element-src-block-interpreter RET ]
| org-element-src-block-interpreter is a compiled Lisp function in
| `org-element.el'.
|
| (org-element-src-block-interpreter SRC-BLOCK CONTENTS)
|
| Interpret SRC-BLOCK element as Org syntax.
| CONTENTS is nil.
`----
uses only these properties, thus the :post-blank's are lost.
,----
| (:language :switches :parameters :value :preserve-indent)
`----
Otherwise, with old-school regexp-matching, the trailing blank
line isn't part of the match either.
--
cheers,
Thorsten