emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Org now fontifies code blocks


From: Dan Davison
Subject: [Orgmode] Org now fontifies code blocks
Date: Thu, 02 Sep 2010 08:51:16 -0700
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

I've just pushed changes which mean that Org now fontifies code in code
blocks. Currently, this is turned on by default, so it would be helpful
if people could report any problems, and opinions as to whether it
should be on or off by default.

To turn it off, use

(setq org-src-fontify-natively nil)

With it off, there are two functions for manually fontifying code
blocks: `org-src-fontify-block' and `org-src-fontify-buffer'.

With it on, on my netbook, there is a slight delay when typing in code
blocks of over 100 lines in length, and this is pronounced in code
blocks of several hundred lines.

Just to be clear, this is fontification only -- no other language major
mode features -- so the default method of editing code is still C-c '
(org-edit-src-code).

Thanks to David O'Toole for the original patch. The final version of the
patch is based on Carsten's suggestions for a more efficient
implementation.

Dan


Dan Davison <address@hidden> writes:

> Dan Davison <address@hidden> writes:
>
>> "David O'Toole" <address@hidden> writes:
>>
>>> I've got a preliminary patch that adds optional "native" fontification
>>> for source blocks. It uses the block's declared mode to fontify the
>>> block text. So now blocks look the way they should, and this opens the
>>> way to further enhancements.
>>
>> Hi David,
>>
>> This is great! Here's a patch which allows the src blocks to have
>> switches and header args, and also uses `org-src-lang-modes' to find the
>> major mode. 
>
> I'm resending this as a match against the current master branch, and as
> an attachment so that it goes into the patchwork system. I am keeping
> this line of patches in branch `src-block-fontification' at
> git://github.com/dandavison/org-devel.git
>
> Dan
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

[Prev in Thread] Current Thread [Next in Thread]