emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: [PATCH] Mode-specific fontification of babel source blocks


From: Dan Davison
Subject: [Orgmode] Re: [PATCH] Mode-specific fontification of babel source blocks
Date: Sun, 15 Aug 2010 02:33:52 -0400
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

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

I've tested David's patch, and made some additions. It's really nice to
have fontified code in the Org buffer. It's not that smooth when editing
code in the Org buffer, but there seems to be no easy way round that
(happy to be proved wrong). In the continued absence of an alternative,
I think we should consider adding this. I've prepared a patch which does
the following:

- David's original patch
- Extend regexp to match full Org code src block syntax
- I've moved the fontification code out into a separate function
- I've provided a standalone manual fontification function
  `org-src-fontify-block'.

On my system, I have not managed to eliminate some point movement during
fontification. This occurs because of the heavy-duty method of
fontification (delete the code, re-insert fontified code generated in a
separate buffer). On the other hand, Org users are not really encouraged
to *edit* code in the Org buffer, and the slightly clunky fontification
is only experienced by those who go against that. David's variable
`org-src-fontify-natively' determines whether font-lock automatically
fontifies code blocks. Even if that variable is nil, it is still
possible to call `org-src-fontify-block' for manual fontification.

Buffer movement is especially problematic with org-indent-mode.

Patch against master attached, and also in branch org-src-fontification
at address@hidden:dandavison/org-devel.git.

Attachment: src-block-fontification.diff
Description: Text Data

Dan




> Anyone up for an icons theme standard
> discussion?
>
> _______________________________________________
> 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]