emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [poll] Fontify code in code blocks
@ 2014-01-09 12:22 Sebastien Vauban
  2014-01-09 12:56 ` Thierry Banel
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Sebastien Vauban @ 2014-01-09 12:22 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

Currently, to get "code highlighting" (which is contextual to the
language of the code block) enabled within your Org buffers, you need to
add the following line to your Emacs config file:

  (setq org-src-fontify-natively t)

as the default value of `org-src-fontify-natively' is `nil'.

WDYT if we turn it on by default?

Are there users explicitly wanting to keep that variable turned off. If
yes, can you explain why: performance reasons, others?

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [poll] Fontify code in code blocks
  2014-01-09 12:22 [poll] Fontify code in code blocks Sebastien Vauban
@ 2014-01-09 12:56 ` Thierry Banel
  2014-01-09 13:01 ` Joseph Vidal-Rosset
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Thierry Banel @ 2014-01-09 12:56 UTC (permalink / raw)
  To: emacs-orgmode

Sebastien Vauban <sva-news@...> writes:

>...
>   (setq org-src-fontify-natively t)
> 
> as the default value of `org-src-fontify-natively' is `nil'.
> 
> WDYT if we turn it on by default?
>...

I vote: YES, true by default

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

* Re: [poll] Fontify code in code blocks
  2014-01-09 12:22 [poll] Fontify code in code blocks Sebastien Vauban
  2014-01-09 12:56 ` Thierry Banel
@ 2014-01-09 13:01 ` Joseph Vidal-Rosset
  2014-01-11  9:25   ` Bastien
  2014-01-09 17:10 ` Rick Frankel
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Joseph Vidal-Rosset @ 2014-01-09 13:01 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Le   jeu.   09   janv.   2014    à   01:22:31   ,   "Sebastien   Vauban"
<sva-news@mygooglest.com> a envoyé ce message:
> Hello,
>
> Currently, to get "code highlighting" (which is contextual to the
> language of the code block) enabled within your Org buffers, you need to
> add the following line to your Emacs config file:
>
>   (setq org-src-fontify-natively t)
>
> as the default value of `org-src-fontify-natively' is `nil'.
>
> WDYT if we turn it on by default?
>
> Are there users explicitly wanting to keep that variable turned off. If
> yes, can you explain why: performance reasons, others?
>
> Best regards,
>   Seb

Hello,

I must  add that  the highlighting  works only  in code  with begin_src-
... end_src à la org. But then,  at least in my configuration, it blocks
the export in LaTeX or in HTML. 

I have not succeeded to get the same highlighting of the latex syntax at
the moment in an org file with all the correct export functions. 

But in comparison of the advantages of org-mode, it is a very small problem. 

Best wishes,

Jo. 

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

* Re: [poll] Fontify code in code blocks
  2014-01-09 12:22 [poll] Fontify code in code blocks Sebastien Vauban
  2014-01-09 12:56 ` Thierry Banel
  2014-01-09 13:01 ` Joseph Vidal-Rosset
@ 2014-01-09 17:10 ` Rick Frankel
  2014-01-09 23:16 ` Alexander Baier
  2014-01-13 16:33 ` Eric S Fraga
  4 siblings, 0 replies; 15+ messages in thread
From: Rick Frankel @ 2014-01-09 17:10 UTC (permalink / raw)
  To: emacs-orgmode

On 2014-01-09 07:22, Sebastien Vauban wrote:
> Hello,
> (setq org-src-fontify-natively t)
> 
> as the default value of `org-src-fontify-natively' is `nil'.
> 
> WDYT if we turn it on by default?

+1.

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

* Re: [poll] Fontify code in code blocks
  2014-01-09 12:22 [poll] Fontify code in code blocks Sebastien Vauban
                   ` (2 preceding siblings ...)
  2014-01-09 17:10 ` Rick Frankel
@ 2014-01-09 23:16 ` Alexander Baier
  2014-01-13 16:33 ` Eric S Fraga
  4 siblings, 0 replies; 15+ messages in thread
From: Alexander Baier @ 2014-01-09 23:16 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



On 2014-01-09 13:22 Sebastien Vauban wrote:
> WDYT if we turn it on by default?

+1. I turned this on the minute I found out about this feature. This was
one of the many wow-moments while discovering Org-mode.

Regards,
-- 
 Alexander Baier

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

* Re: [poll] Fontify code in code blocks
  2014-01-09 13:01 ` Joseph Vidal-Rosset
@ 2014-01-11  9:25   ` Bastien
  2014-01-11  9:48     ` Nicolas Goaziou
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-01-11  9:25 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Sebastien Vauban, emacs-orgmode

Hi Joseph,

Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com> writes:

> I must  add that  the highlighting  works only  in code  with begin_src-
> ... end_src à la org.

Yes, this is by design.

> But then,  at least in my configuration, it blocks
> the export in LaTeX or in HTML. 

Not sure I grok this part...

> I have not succeeded to get the same highlighting of the latex syntax at
> the moment in an org file with all the correct export functions. 

Oh, maybe I see.  You want highlighting in #+BEGIN_LaTeX
and #+BEGIN_HTML.

Actually it makes sense.

So that #+BEGIN_HTML would really be short for #+BEGIN_SRC html-mode
but with no need for header vars and all the plumbing.

Nicolas, what do you think?

Would it be okay to enable syntax highlighting in #+BEGIN_{HTML,...}
blocks?

-- 
 Bastien

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

* Re: [poll] Fontify code in code blocks
  2014-01-11  9:25   ` Bastien
@ 2014-01-11  9:48     ` Nicolas Goaziou
  2014-01-11 11:35       ` Sebastien Vauban
  0 siblings, 1 reply; 15+ messages in thread
From: Nicolas Goaziou @ 2014-01-11  9:48 UTC (permalink / raw)
  To: Bastien; +Cc: Sebastien Vauban, emacs-orgmode, Joseph Vidal-Rosset

Hello,

Bastien <bzg@gnu.org> writes:

> Oh, maybe I see.  You want highlighting in #+BEGIN_LaTeX
> and #+BEGIN_HTML.
>
> Actually it makes sense.
>
> So that #+BEGIN_HTML would really be short for #+BEGIN_SRC html-mode
> but with no need for header vars and all the plumbing.
>
> Nicolas, what do you think?

I don't think it's a good idea.

#+begin_html is /very/ different from #+begin_src html-mode. The former
is raw html code that will be inserted in the output upon exporting. The
latter is handled by Babel and is not an export-only feature (more often
than not, it will not appear in the export output). Fontifying both the
same way could introduce confusion between them.

Additionally, some export back-ends allow multiple export block names
(e.g. #+begin_markdown and #+begin_md), which could add to the
confusion. And export one-liners, e.g. "#+HTML:" would probably need to
be also fontified since they really are a shorthand for
"#+begin_html...#+end_html". Too much trouble, IMO.

> Would it be okay to enable syntax highlighting in #+BEGIN_{HTML,...}
> blocks?

It is possible to get syntax highlighting with C-c ' on such blocks.
FWIW, I think this is enough.


Regards,

-- 
Nicolas Goaziou

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

* Re: [poll] Fontify code in code blocks
  2014-01-11  9:48     ` Nicolas Goaziou
@ 2014-01-11 11:35       ` Sebastien Vauban
  2014-01-14 20:50         ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastien Vauban @ 2014-01-11 11:35 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Nicolas Goaziou wrote:
>> Oh, maybe I see.  You want highlighting in #+BEGIN_LaTeX
>> and #+BEGIN_HTML.
>>
>> Actually it makes sense.
>>
>> So that #+BEGIN_HTML would really be short for #+BEGIN_SRC html-mode
>> but with no need for header vars and all the plumbing.
>>
>> Nicolas, what do you think?
>
> I don't think it's a good idea.
>
> #+begin_html is /very/ different from #+begin_src html-mode. The former
> is raw html code that will be inserted in the output upon exporting. The
> latter is handled by Babel and is not an export-only feature (more often
> than not, it will not appear in the export output). Fontifying both the
> same way could introduce confusion between them.
>
> Additionally, some export back-ends allow multiple export block names
> (e.g. #+begin_markdown and #+begin_md), which could add to the
> confusion. And export one-liners, e.g. "#+HTML:" would probably need to
> be also fontified since they really are a shorthand for
> "#+begin_html...#+end_html". Too much trouble, IMO.
>
>> Would it be okay to enable syntax highlighting in #+BEGIN_{HTML,...}
>> blocks?
>
> It is possible to get syntax highlighting with C-c ' on such blocks.
> FWIW, I think this is enough.

FWIW, I think this would be great. As soon as we have to type real
HTML/LaTeX or whatever code inside the Org document, it's a great
addition to see the code we type with correct syntax highlighting. That
helps preventing errors, and allows quicker and easier understanding of
what the code does.

That would be the same for #+HTML/LaTeX one-liners, yes!

Now, I have no idea about what's the work required. But I definitely
would love to see that implemented.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [poll] Fontify code in code blocks
  2014-01-09 12:22 [poll] Fontify code in code blocks Sebastien Vauban
                   ` (3 preceding siblings ...)
  2014-01-09 23:16 ` Alexander Baier
@ 2014-01-13 16:33 ` Eric S Fraga
  2014-01-13 20:26   ` Sebastien Vauban
  4 siblings, 1 reply; 15+ messages in thread
From: Eric S Fraga @ 2014-01-13 16:33 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Sebastien et al.,

+1 for org-src-fontify-natively set to t by default.  I've had this
turned on forever...  I cannot imagine using org without it!
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.4-322-gece429

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

* Re: [poll] Fontify code in code blocks
  2014-01-13 16:33 ` Eric S Fraga
@ 2014-01-13 20:26   ` Sebastien Vauban
  2014-01-14 20:47     ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastien Vauban @ 2014-01-13 20:26 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello Bastien,

Eric S Fraga wrote:
> +1 for org-src-fontify-natively set to t by default.  I've had this
> turned on forever...  I cannot imagine using org without it!

I think this overall results of the poll is quite clear, no?

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [poll] Fontify code in code blocks
  2014-01-13 20:26   ` Sebastien Vauban
@ 2014-01-14 20:47     ` Bastien
  2014-01-15 10:31       ` Carsten Dominik
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-01-14 20:47 UTC (permalink / raw)
  To: Sebastien Vauban, Carsten Dominik; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hi Sébastien,

"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:

> I think this overall results of the poll is quite clear, no?

Well, I think we should wait for Carsten's vote on this.

Carsten, do you think `org-src-fontify-natively' should
be set to `t' by default for Org 8.3?  Votes are for this
default in majority so far, but there are only a few votes.

-- 
 Bastien

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

* Re: [poll] Fontify code in code blocks
  2014-01-11 11:35       ` Sebastien Vauban
@ 2014-01-14 20:50         ` Bastien
  2014-01-15  9:05           ` Sebastien Vauban
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-01-14 20:50 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



When `org-src-fontify-natively' will be `t' by default,
it will be important to keep the distinction between source
blocks and HTML/LaTeX blocks.

So HTML blocks should remain unfontified by default, just
to mark the difference with "active" source blocks.

I still think an option to highlight them would be nice.

> That would be the same for #+HTML/LaTeX one-liners, yes!

For this I disagree... this would encourage using such
one-liners too much.

> Now, I have no idea about what's the work required. But I definitely
> would love to see that implemented.

Well, it's not hard but not straightforward -- and I'd rather
be sure that the decision is to take that route before I try to
implement this.

Waiting to read what other think.

-- 
 Bastien

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

* Re: [poll] Fontify code in code blocks
  2014-01-14 20:50         ` Bastien
@ 2014-01-15  9:05           ` Sebastien Vauban
  0 siblings, 0 replies; 15+ messages in thread
From: Sebastien Vauban @ 2014-01-15  9:05 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello Bastien,

Bastien wrote:
> When `org-src-fontify-natively' will be `t' by default,
> it will be important to keep the distinction between source
> blocks and HTML/LaTeX blocks.
>
> So HTML blocks should remain unfontified by default, just
> to mark the difference with "active" source blocks.

I can share your idea that it's good to see a difference between both
types of code snippets. But, then, instead of _not_ fontifying the code
in question, it'd be better (for example) to provide them with
a different background color (other than the current
`org-block-background', shared by both types of snippets).

> I still think an option to highlight them would be nice.

Ouf ;-)

>> That would be the same for #+HTML/LaTeX one-liners, yes!
>
> For this I disagree... this would encourage using such
> one-liners too much.

I don't think having highlighting or not encourages one-lines: we need
them (for their purpose) or not, with or without highlighting.

On the contrary, not highlighting one-liners would encourage to convert
them into 3-liners (if we "need" the colors):

#+begin_html/latex
... one-line code ...
#+end_html/latex

Not sure to understand why you'd make a distinction.

>> Now, I have no idea about what's the work required. But I definitely
>> would love to see that implemented.
>
> Well, it's not hard but not straightforward -- and I'd rather
> be sure that the decision is to take that route before I try to
> implement this.
>
> Waiting to read what other think.

So do I.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [poll] Fontify code in code blocks
  2014-01-14 20:47     ` Bastien
@ 2014-01-15 10:31       ` Carsten Dominik
  2014-01-16  0:12         ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2014-01-15 10:31 UTC (permalink / raw)
  To: Bastien; +Cc: public-emacs-orgmode-mXXj517/zsQ, Sebastien Vauban




On 14 Jan 2014, at 21:47, Bastien <bzg@gnu.org> wrote:

> Hi Sébastien,
> 
> "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
> writes:
> 
>> I think this overall results of the poll is quite clear, no?
> 
> Well, I think we should wait for Carsten's vote on this.
> 
> Carsten, do you think `org-src-fontify-natively' should
> be set to `t' by default for Org 8.3?  Votes are for this
> default in majority so far, but there are only a few votes.


Hi Bastien,

I don’t have strong feelings either way.  Lets turn it on a see what the impact will be.

- Carsten

> 
> -- 
> Bastien

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

* Re: [poll] Fontify code in code blocks
  2014-01-15 10:31       ` Carsten Dominik
@ 2014-01-16  0:12         ` Bastien
  0 siblings, 0 replies; 15+ messages in thread
From: Bastien @ 2014-01-16  0:12 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: public-emacs-orgmode-mXXj517/zsQ, Sebastien Vauban



Hi Carsten,

Carsten Dominik <carsten.dominik@gmail.com> writes:

> I don’t have strong feelings either way.  Lets turn it on a see what
> the impact will be.

Done in master, thanks,

-- 
 Bastien

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

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

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-09 12:22 [poll] Fontify code in code blocks Sebastien Vauban
2014-01-09 12:56 ` Thierry Banel
2014-01-09 13:01 ` Joseph Vidal-Rosset
2014-01-11  9:25   ` Bastien
2014-01-11  9:48     ` Nicolas Goaziou
2014-01-11 11:35       ` Sebastien Vauban
2014-01-14 20:50         ` Bastien
2014-01-15  9:05           ` Sebastien Vauban
2014-01-09 17:10 ` Rick Frankel
2014-01-09 23:16 ` Alexander Baier
2014-01-13 16:33 ` Eric S Fraga
2014-01-13 20:26   ` Sebastien Vauban
2014-01-14 20:47     ` Bastien
2014-01-15 10:31       ` Carsten Dominik
2014-01-16  0:12         ` Bastien

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