From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84807 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.gnus.general Subject: Re: Org src-blocks not shown correctly Date: Fri, 22 Aug 2014 11:20:18 +0200 Message-ID: <87lhqg7uel.fsf@gmail.com> References: <87r40a9j0k.fsf@gmail.com> <87sikq0zhc.fsf@ucl.ac.uk> <8738cpwvpj.fsf@gmail.com> <874mx5y8uj.fsf@ucl.ac.uk> <87sikpveuz.fsf@gmail.com> <87bnrd6jhw.fsf@ucl.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1408714219 13326 80.91.229.3 (22 Aug 2014 13:30:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Aug 2014 13:30:19 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M33050@lists.math.uh.edu Fri Aug 22 15:30:12 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XKouy-0005wr-2V for ding-account@gmane.org; Fri, 22 Aug 2014 15:30:12 +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 1XKotz-0001PA-S3; Fri, 22 Aug 2014 08:29:11 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1XKl1e-00004s-Q0 for ding@lists.math.uh.edu; Fri, 22 Aug 2014 04:20:50 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1XKl1Q-0003ij-JU for ding@lists.math.uh.edu; Fri, 22 Aug 2014 04:20:50 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1XKl1P-0003LM-6Y for ding@gnus.org; Fri, 22 Aug 2014 11:20:35 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XKl1O-0004Tm-KB for ding@gnus.org; Fri, 22 Aug 2014 11:20:34 +0200 Original-Received: from e178058053.adsl.alicedsl.de ([85.178.58.53]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Aug 2014 11:20:34 +0200 Original-Received: from tjolitz by e178058053.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Aug 2014 11:20:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 90 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178058053.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:3Gw28T5HHRgZHkDt1Whd7ylAH44= X-Spam-Score: -2.7 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84807 Archived-At: Eric S Fraga writes: > On Thursday, 21 Aug 2014 at 21:09, Thorsten Jolitz wrote: > > [...] > >> hmm ... 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 > gnus: > > ,---- > | commit 3313cd8482c0ac34077ae1ca4721bb6af8b0e0b6 > | Author: Lars Ingebrigtsen > | 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