Gnus development mailing list
 help / color / mirror / Atom feed
* Re: Org src-blocks not shown correctly
       [not found] <87r40a9j0k.fsf@gmail.com>
@ 2014-08-21 13:00 ` Eric S Fraga
  2014-08-21 13:59   ` Jorge A. Alfaro-Murillo
  2014-08-21 18:20   ` Thorsten Jolitz
  0 siblings, 2 replies; 11+ messages in thread
From: Eric S Fraga @ 2014-08-21 13:00 UTC (permalink / raw)
  To: ding

On Thursday, 21 Aug 2014 at 13:31, Thorsten Jolitz wrote:
> Hi list, 
>
> since a few weeks I noticed that when I send Org src-blocks in a post
> via gnus, the empty lines between them are lost when I open up my own
> post in gnus later (while C-u g shows that the raw message does have
> them).

What does the following look like when you receive it from somebody
else?

#+BEGIN_SRC emacs-lisp
  (+ 3 3)
#+END_SRC

#+BEGIN_SRC emacs-lisp
  (- 2 2)
#+END_SRC

This is a much a question as a test so that I can see what happens in my
case.

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.4.50.1 + Ma Gnus v0.12 + evil evil-git-c5fb03c
: BBDB version 3.1.2 (2014-05-06 11:45:08 -0500)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-21 13:00 ` Org src-blocks not shown correctly Eric S Fraga
@ 2014-08-21 13:59   ` Jorge A. Alfaro-Murillo
  2014-08-21 18:20   ` Thorsten Jolitz
  1 sibling, 0 replies; 11+ messages in thread
From: Jorge A. Alfaro-Murillo @ 2014-08-21 13:59 UTC (permalink / raw)
  To: ding

Eric S Fraga writes: 

> What does the following look like when you receive it from 
> somebody else? 
> 
> #+BEGIN_SRC emacs-lisp 
>   (+ 3 3) 
> #+END_SRC 
> 
> #+BEGIN_SRC emacs-lisp 
>   (- 2 2) 
> #+END_SRC 

It has a empty line in between for me. Are you using 
hard-newlines?  Maybe one is missing after SRC.

Best,

-- 
Jorge.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-21 13:00 ` Org src-blocks not shown correctly Eric S Fraga
  2014-08-21 13:59   ` Jorge A. Alfaro-Murillo
@ 2014-08-21 18:20   ` Thorsten Jolitz
  2014-08-21 18:51     ` Eric S Fraga
  1 sibling, 1 reply; 11+ messages in thread
From: Thorsten Jolitz @ 2014-08-21 18:20 UTC (permalink / raw)
  To: ding

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Thursday, 21 Aug 2014 at 13:31, Thorsten Jolitz wrote:
>> Hi list, 
>>
>> since a few weeks I noticed that when I send Org src-blocks in a post
>> via gnus, the empty lines between them are lost when I open up my own
>> post in gnus later (while C-u g shows that the raw message does have
>> them).
>
> What does the following look like when you receive it from somebody
> else?
>
> #+BEGIN_SRC emacs-lisp
>   (+ 3 3)
> #+END_SRC
> #+BEGIN_SRC emacs-lisp
>   (- 2 2)
> #+END_SRC
>
> This is a much a question as a test so that I can see what happens in my
> case.

I see it like this, without the empty lines, and following up keeps that
state. But C-u g shows the empty lines between the blocks, and following
up from that raw message does quote it correctly too (with empty lines). 

-- 
cheers,
Thorsten




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-21 18:20   ` Thorsten Jolitz
@ 2014-08-21 18:51     ` Eric S Fraga
  2014-08-21 19:09       ` Thorsten Jolitz
  0 siblings, 1 reply; 11+ messages in thread
From: Eric S Fraga @ 2014-08-21 18:51 UTC (permalink / raw)
  To: ding

On Thursday, 21 Aug 2014 at 20:20, Thorsten Jolitz wrote:

[...]

> I see it like this, without the empty lines, and following up keeps that
> state. But C-u g shows the empty lines between the blocks, and following
> up from that raw message does quote it correctly too (with empty lines). 

Are you doing any /article washing/ perhaps, something that's doing more
than you wish?  Maybe one of the gnus-treat- variables, although none
should be doing this as far as I can tell.

My own message looked fine to me, by the way.

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.4.50.1 + Ma Gnus v0.12 + evil-git-c5fb03c
: BBDB version 3.1.2 (2014-05-06 11:45:08 -0500)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-21 18:51     ` Eric S Fraga
@ 2014-08-21 19:09       ` Thorsten Jolitz
  2014-08-22  8:01         ` Eric S Fraga
  0 siblings, 1 reply; 11+ messages in thread
From: Thorsten Jolitz @ 2014-08-21 19:09 UTC (permalink / raw)
  To: ding

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Thursday, 21 Aug 2014 at 20:20, Thorsten Jolitz wrote:
>
> [...]
>
>> I see it like this, without the empty lines, and following up keeps that
>> state. But C-u g shows the empty lines between the blocks, and following
>> up from that raw message does quote it correctly too (with empty lines). 
>
> Are you doing any /article washing/ perhaps, something that's doing more
> than you wish?  Maybe one of the gnus-treat- variables, although none
> should be doing this as far as I can tell.

no, actually I did not touch my gnus configuration for quite some time
now, this symptom just appeared out of nowhere, at it seems other people
see it too. 

> My own message looked fine to me, by the way.

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?

-- 
cheers,
Thorsten




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-21 19:09       ` Thorsten Jolitz
@ 2014-08-22  8:01         ` Eric S Fraga
  2014-08-22  8:24           ` Eric Abrahamsen
                             ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Eric S Fraga @ 2014-08-22  8:01 UTC (permalink / raw)
  To: ding

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 <larsi@gnus.org>
| 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?

In any case, org must be involved somehow as the faces used are those
defined by org...

HTH,
eric

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.4.50.1 + Ma Gnus v0.12 + evil-git-c5fb03c
: BBDB version 3.1.2 (2014-05-06 11:45:08 -0500)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-22  8:01         ` Eric S Fraga
@ 2014-08-22  8:24           ` Eric Abrahamsen
  2014-08-22  8:49             ` Thorsten Jolitz
  2014-08-22 10:45             ` Eric S Fraga
  2014-08-22  9:20           ` Thorsten Jolitz
  2014-08-22 10:01           ` Katsumi Yamaoka
  2 siblings, 2 replies; 11+ messages in thread
From: Eric Abrahamsen @ 2014-08-22  8:24 UTC (permalink / raw)
  To: ding

Eric S Fraga <e.fraga@ucl.ac.uk> 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 <larsi@gnus.org>
> | 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?
>
> In any case, org must be involved somehow as the faces used are those
> defined by org...

Looks like that function was touched in Gnus commit ceed93, late May --
are you guys using Gnus or Emacs from git?




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-22  8:24           ` Eric Abrahamsen
@ 2014-08-22  8:49             ` Thorsten Jolitz
  2014-08-22 10:45             ` Eric S Fraga
  1 sibling, 0 replies; 11+ messages in thread
From: Thorsten Jolitz @ 2014-08-22  8:49 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:

>> ,----
>> | commit 3313cd8482c0ac34077ae1ca4721bb6af8b0e0b6
>> | Author: Lars Ingebrigtsen <larsi@gnus.org>
>> | 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).
>> `----

> Looks like that function was touched in Gnus commit ceed93, late May --
> are you guys using Gnus or Emacs from git?

No I use the fairly up-to-date Emacs from the Archlinux repo:

#+BEGIN_SRC emacs-lisp
 (emacs-version)
#+END_SRC

#+results:
: GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)
:  of 2014-06-11 on var-lib-archbuild-staging-x86_64-jgc

#+BEGIN_SRC emacs-lisp
(gnus-version)
#+END_SRC

#+results:
: Gnus v5.13

-- 
cheers,
Thorsten




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-22  8:01         ` Eric S Fraga
  2014-08-22  8:24           ` Eric Abrahamsen
@ 2014-08-22  9:20           ` Thorsten Jolitz
  2014-08-22 10:01           ` Katsumi Yamaoka
  2 siblings, 0 replies; 11+ messages in thread
From: Thorsten Jolitz @ 2014-08-22  9:20 UTC (permalink / raw)
  To: ding

Eric S Fraga <e.fraga@ucl.ac.uk> 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 <larsi@gnus.org>
> | 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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-22  8:01         ` Eric S Fraga
  2014-08-22  8:24           ` Eric Abrahamsen
  2014-08-22  9:20           ` Thorsten Jolitz
@ 2014-08-22 10:01           ` Katsumi Yamaoka
  2 siblings, 0 replies; 11+ messages in thread
From: Katsumi Yamaoka @ 2014-08-22 10:01 UTC (permalink / raw)
  To: ding

On Fri, 22 Aug 2014 09:01:15 +0100, Eric S Fraga wrote:
> ,----
>| commit 3313cd8482c0ac34077ae1ca4721bb6af8b0e0b6
>| Author: Lars Ingebrigtsen <larsi@gnus.org>
>| 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).
> `----

I'm not quite sure of the topic in this thread, but I made
a change[1] in 'mm-display-inline-fontify' in question today
since I got an error[2] when I read articles in this thread.
I'm using the very fresh Emacs from the trunk and get a good
fontification on those articles.

[1] <http://article.gmane.org/gmane.emacs.gnus.cvs/12674>
[2]
Debugger entered--Lisp error:
 (error "`recenter'ing a window that does not display current-buffer.")
  recenter((4))
  org-overview()
  org-set-startup-visibility()
  org-mode()
  funcall(org-mode)
[...]
  mm-display-inline-fontify((#<buffer  *mm-uu*-275065> ("text/x-org") ...
  mm-display-org-inline((#<buffer  *mm-uu*-275065> ("text/x-org") ...
  mm-display-inline((#<buffer  *mm-uu*-275065> ("text/x-org") ...
  mm-display-part((#<buffer  *mm-uu*-275065> ("text/x-org") ...
[...]
  gnus-summary-show-article(nil)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Org src-blocks not shown correctly
  2014-08-22  8:24           ` Eric Abrahamsen
  2014-08-22  8:49             ` Thorsten Jolitz
@ 2014-08-22 10:45             ` Eric S Fraga
  1 sibling, 0 replies; 11+ messages in thread
From: Eric S Fraga @ 2014-08-22 10:45 UTC (permalink / raw)
  To: ding

On Friday, 22 Aug 2014 at 16:24, Eric Abrahamsen wrote:

[...]

> Looks like that function was touched in Gnus commit ceed93, late May --
> are you guys using Gnus or Emacs from git?

I am using the weekly emacs snapshot (so bleeding edge) and gnus from
git, normally updated every couple of weeks.

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.4.50.2 + Ma Gnus v0.12 + evil-git-a6a27e0
: BBDB version 3.1.2 (2014-04-27 15:05:20 -0500)



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-08-22 10:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87r40a9j0k.fsf@gmail.com>
2014-08-21 13:00 ` Org src-blocks not shown correctly Eric S Fraga
2014-08-21 13:59   ` Jorge A. Alfaro-Murillo
2014-08-21 18:20   ` Thorsten Jolitz
2014-08-21 18:51     ` Eric S Fraga
2014-08-21 19:09       ` Thorsten Jolitz
2014-08-22  8:01         ` Eric S Fraga
2014-08-22  8:24           ` Eric Abrahamsen
2014-08-22  8:49             ` Thorsten Jolitz
2014-08-22 10:45             ` Eric S Fraga
2014-08-22  9:20           ` Thorsten Jolitz
2014-08-22 10:01           ` Katsumi Yamaoka

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).