From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Org now fontifies code blocks Date: Thu, 02 Sep 2010 08:51:16 -0700 Message-ID: <87lj7kqh3f.fsf_-_@stats.ox.ac.uk> References: <8739uvw0hg.fsf@stats.ox.ac.uk> <87vd7j1nck.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=55251 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrC4P-0002IW-Mx for emacs-orgmode@gnu.org; Thu, 02 Sep 2010 11:51:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrC4O-0003uT-Fv for emacs-orgmode@gnu.org; Thu, 02 Sep 2010 11:51:21 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:62304) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrC4O-0003uH-6K for emacs-orgmode@gnu.org; Thu, 02 Sep 2010 11:51:20 -0400 Received: from blackcap.stats.ox.ac.uk (blackcap.stats [163.1.210.5]) by markov.stats.ox.ac.uk (8.13.6/8.13.6) with ESMTP id o82FpIQV008605 for ; Thu, 2 Sep 2010 16:51:18 +0100 (BST) In-Reply-To: <87vd7j1nck.fsf@stats.ox.ac.uk> (Dan Davison's message of "Mon, 09 Aug 2010 17:35:07 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Mailinglist 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 writes: > Dan Davison writes: > >> "David O'Toole" 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. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode