From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Fontification of blocks Date: Mon, 13 Dec 2010 12:50:03 -0700 Message-ID: <8739q1ihas.fsf@gmail.com> References: <80aakevw4w.fsf@missioncriticalit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=42643 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSEPU-0002Lx-CI for emacs-orgmode@gnu.org; Mon, 13 Dec 2010 14:50:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSEPT-0004P0-4d for emacs-orgmode@gnu.org; Mon, 13 Dec 2010 14:50:12 -0500 Received: from mail-gx0-f180.google.com ([209.85.161.180]:59456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSEPT-0004Om-1J for emacs-orgmode@gnu.org; Mon, 13 Dec 2010 14:50:11 -0500 Received: by gxk19 with SMTP id 19so4325883gxk.39 for ; Mon, 13 Dec 2010 11:50:10 -0800 (PST) In-Reply-To: <80aakevw4w.fsf@missioncriticalit.com> (=?utf-8?Q?=22S=C3=A9b?= =?utf-8?Q?astien?= Vauban"'s message of "Fri, 10 Dec 2010 10:02:07 +0100") 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: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: emacs-orgmode@gnu.org Hi Seb, This looks like a very nice addition. Could you refactor your patch so that this behavior is controlled by a user configurable defcustom variable? Thanks -- Eric S=C3=A9bastien Vauban writes: > Hi, > > In order to make the blocks stand out more clearly in the mix of prose, c= ode > and table results of many Babel Org files, I've added 2 new faces: > > - org-block-begin-line > - org-block-end-line > > These apply to the line just before and after the block's body: > > #+srcname: top-10-dossiers-with-many-prestations > #+begin_src sql <<< org-block-begin-l= ine > SELECT TOP 10 prsPfiID_fk, COUNT(*) AS '# Prestations' > FROM prestations > GROUP BY prsPfiID_fk > ORDER BY COUNT(*) DESC > #+end_src <<< org-block-end-l= ine > > Not only for =3Dsrc=3D, but also for =3Dverse=3D, =3Dquote=3D, etc. > > This patch takes care of the correct fontification, both in native style,= and > in the "no native fontification" style: > > diff --git a/lisp/org.el b/lisp/org.el > index e03e9ca..f57c09b 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -5137,8 +5137,8 @@ will be prompted for." > (add-text-properties > beg end > '(font-lock-fontified t font-lock-multiline t)) > - (add-text-properties beg beg1 '(face org-meta-line)) > - (add-text-properties end1 (+ end 1) '(face org-meta-line)) > + (add-text-properties beg beg1 '(face org-block-begin-line)) > + (add-text-properties end1 (+ end 1) '(face org-block-end-line)) > ; for end_src > (cond > ((and lang org-src-fontify-natively) > @@ -5149,9 +5149,9 @@ will be prompted for." > ; end of source block > ((not org-fontify-quote-and-verse-blocks)) > ((string=3D block-type "quote") > - (add-text-properties beg1 end1 '(face org-quote))) > + (add-text-properties beg1 (1+ end1) '(face org-quote))) > ((string=3D block-type "verse") > - (add-text-properties beg1 end1 '(face org-verse)))) > + (add-text-properties beg1 (1+ end1) '(face org-verse)))) > t)) > ((member dc1 '("title:" "author:" "email:" "date:")) > (add-text-properties > @@ -5167,7 +5167,7 @@ will be prompted for." > ((not (member (char-after beg) '(?\ ?\t))) > ;; just any other in-buffer setting, but not indented > (add-text-properties > - beg (match-end 0) > + beg (1+ (match-end 0)) > '(font-lock-fontified t face org-meta-line)) > t) > ((or (member dc1 '("begin:" "end:" "caption:" "label:" > > Best regards, > Seb