emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* "#+BEGIN_SRC mail" and org-src-fontify-natively
@ 2014-12-04  1:10 Andrea Rossetti
  2014-12-04  1:16 ` Andrea Rossetti
  2014-12-05  8:56 ` Nicolas Goaziou
  0 siblings, 2 replies; 4+ messages in thread
From: Andrea Rossetti @ 2014-12-04  1:10 UTC (permalink / raw)
  To: emacs-orgmode

Hello Org users,

  when I start emacs -Q and do the following recipe:

1) open the test file "prova.org" (see attach)
2) confirm at the file-local variable prompt, by typing "y"
3) quit with C-x C-c 

then Emacs unexpectedly asks for a confirm to save the
modified buffer "org-src-fontify:mail-mode", even if I took care
to avoid any editing between steps 2) and 3).

  The unexpected confirm is not asked if the same recipe is replayed
with a modified "prova.org", where org-src-fontify-natively has been
set to nil instead of t.

  May I please ask: it's reproducible for you as well? any clue on
how to suppress that annoying confirm? Thanks in advance for your
suggestions.

  Another minor issue is that "To:" and "Subject:" aren't fontified
if the mail text is indented by two spaces (typically added by default
if you edit the block by typing C-c '). Not a big deal, just to let
you know. One could just avoid using C-c ' and align the mail text
at left side. The issue is visible in the buffer window, but
HTML export is not affected, it works fine.

  Thanks for reading, kindest regards.

  Andrea

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

* Re: "#+BEGIN_SRC mail" and org-src-fontify-natively
  2014-12-04  1:10 "#+BEGIN_SRC mail" and org-src-fontify-natively Andrea Rossetti
@ 2014-12-04  1:16 ` Andrea Rossetti
  2014-12-05  8:56 ` Nicolas Goaziou
  1 sibling, 0 replies; 4+ messages in thread
From: Andrea Rossetti @ 2014-12-04  1:16 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

Andrea Rossetti <andrea.rossetti@gmail.com> writes:

> Hello Org users,
>
>   when I start emacs -Q and do the following recipe:
>
> 1) open the test file "prova.org" (see attach)

Apologies for the missing attach. "prova.org" is attached here:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: prova.org --]
[-- Type: text/x-org, Size: 155 bytes --]

#+BEGIN_SRC mail
To: andrea.rossetti@gmail.com
Subject: blah

Dear friends, blah blah..
#+END_SRC

# Local Variables:
# org-src-fontify-natively: t
# End:

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

* Re: "#+BEGIN_SRC mail" and org-src-fontify-natively
  2014-12-04  1:10 "#+BEGIN_SRC mail" and org-src-fontify-natively Andrea Rossetti
  2014-12-04  1:16 ` Andrea Rossetti
@ 2014-12-05  8:56 ` Nicolas Goaziou
  2014-12-21 16:58   ` Andrea Rossetti
  1 sibling, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2014-12-05  8:56 UTC (permalink / raw)
  To: Andrea Rossetti; +Cc: emacs-orgmode

Hello,

Andrea Rossetti <andrea.rossetti@gmail.com> writes:

> Hello Org users,
>
>   when I start emacs -Q and do the following recipe:
>
> 1) open the test file "prova.org" (see attach)
> 2) confirm at the file-local variable prompt, by typing "y"
> 3) quit with C-x C-c 
>
> then Emacs unexpectedly asks for a confirm to save the
> modified buffer "org-src-fontify:mail-mode", even if I took care
> to avoid any editing between steps 2) and 3).
>
>   The unexpected confirm is not asked if the same recipe is replayed
> with a modified "prova.org", where org-src-fontify-natively has been
> set to nil instead of t.
>
>   May I please ask: it's reproducible for you as well? any clue on
> how to suppress that annoying confirm? Thanks in advance for your
> suggestions.

I cannot reproduce it on development branch. It may have been fixed.

>   Another minor issue is that "To:" and "Subject:" aren't fontified
> if the mail text is indented by two spaces (typically added by default
> if you edit the block by typing C-c '). Not a big deal, just to let
> you know. One could just avoid using C-c ' and align the mail text
> at left side. The issue is visible in the buffer window, but
> HTML export is not affected, it works fine.

You may want to set `org-edit-src-content-indentation' to 0.


Regards,

-- 
Nicolas Goaziou

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

* Re: "#+BEGIN_SRC mail" and org-src-fontify-natively
  2014-12-05  8:56 ` Nicolas Goaziou
@ 2014-12-21 16:58   ` Andrea Rossetti
  0 siblings, 0 replies; 4+ messages in thread
From: Andrea Rossetti @ 2014-12-21 16:58 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Andrea Rossetti <andrea.rossetti@gmail.com> writes:
>>   when I start emacs -Q and do the following recipe:
>>
>> 1) open the test file "prova.org" (see attach)
>> 2) confirm at the file-local variable prompt, by typing "y"
>> 3) quit with C-x C-c 
>>
>> then Emacs unexpectedly asks for a confirm to save the
>> modified buffer "org-src-fontify:mail-mode", even if I took care
>> to avoid any editing between steps 2) and 3).
>
> I cannot reproduce it on development branch. It may have been fixed.

  Hello Nicolas and everyone else reading. Sorry for the late reply, it
took some time and edebugging for me to understand the problem.

  1) in summary: it was a mail-mode "fault", not Org's. Or better:
     it was my fault, not knowing in depth mail-mode.

  2) in detail: when you create a #+BLOCK_SRC mail and fontify it with
     M-x org-src-fontify-block RET, a buffer is created with name
     " org-src-fontify:mail-mode" (notice the initial space character).
     This buffer usually have a buffer-local variable
     `buffer-offer-save' set to nil, but mail-mode forces it to t. That
     doesn't seem a wrong workflow: you don't accidentally lose the mail
     you just composed.

  3) lesson learnt: you can't fontify whatever you want in a SRC block.
     Some modes work perfectly, some don't, some "almost" work (like
     mail-mode).

  4) future plans: I'm now curious and I'll probably try fontification
     of whatever mode I can think of (M-x apropos RET -mode$ RET) :)

Thanks for your time and attention, kindest regards.

Andrea

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

end of thread, other threads:[~2014-12-21 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-04  1:10 "#+BEGIN_SRC mail" and org-src-fontify-natively Andrea Rossetti
2014-12-04  1:16 ` Andrea Rossetti
2014-12-05  8:56 ` Nicolas Goaziou
2014-12-21 16:58   ` Andrea Rossetti

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).