From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: Fontification of blocks Date: Wed, 15 Dec 2010 10:22:45 -0700 Message-ID: <87ei9jkl0l.fsf@gmail.com> References: <80aakevw4w.fsf@missioncriticalit.com> <8739q1ihas.fsf@gmail.com> <80r5dlpfj6.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=48000 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSv4r-0007aT-Bw for emacs-orgmode@gnu.org; Wed, 15 Dec 2010 12:23:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSv4q-0005HI-9I for emacs-orgmode@gnu.org; Wed, 15 Dec 2010 12:23:45 -0500 Received: from mail-yx0-f169.google.com ([209.85.213.169]:45161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSv4q-0005EN-72 for emacs-orgmode@gnu.org; Wed, 15 Dec 2010 12:23:44 -0500 Received: by mail-yx0-f169.google.com with SMTP id 31so1399189yxl.0 for ; Wed, 15 Dec 2010 09:23:44 -0800 (PST) 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, I was thinking that it would be nice to be able to try this out through setting a variable (as most org customizations are handled) which would activate/de-activate the extra fontification. I think that adding a new block delimiter face which inherits from the org-meta face as you've suggested is the way to go. I would recommend however that rather than removing/changing the org-meta-line, quote and verse delimiting faces to cover the entire line you simply add the org-block-begin/end-line face overtop of these existing faces. That way the default behavior is not changed by the patch, and users have more control over the final display. In fact rather than having the org-block-begin/end-line faces inherit from org-meta-line why not have them begin as empty faces. Do you think this sounds like a good way to go? If so would you mind submitting a patch which - doesn't remove existing faces but rather adds these new faces overtop of them - includes of definition of the org-block-begin/end-line faces to empty faces (otherwise the elisp compiler will warn of references to undefined variables) Also, could you share an example code snippet which initializes the org-block-begin/end-line faces initialized (either here and/or on worg)? Many Thanks -- Eric S=C3=A9bastien Vauban writes: > Hi Eric, > > "Eric Schulte" wrote: >> S=C3=A9bastien Vauban writes: >>> In order to make the blocks stand out more clearly in the mix of prose, >>> code 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= -line >>> SELECT TOP 10 prsPfiID_fk, COUNT(*) AS '# Prestations' >>> FROM prestations >>> GROUP BY prsPfiID_fk >>> ORDER BY COUNT(*) DESC >>> #+end_src <<< org-block-end= -line >>> >>> Not only for =3Dsrc=3D, but also for =3Dverse=3D, =3Dquote=3D, etc. >> >> This looks like a very nice addition. Could you refactor your patch so >> that this behavior is controlled by a user configurable defcustom >> variable? > > For sure, I'm willing whatever is needed to make it more acceptable. But = I'm > not sure about the purpose of that variable... > > You want something such as =3Dorg-have-extra-faces=3D, and in case of: > > - =3Dt=3D, use them > - =3Dnil=3D, use the old face =3Dorg-meta-line=3D. > > Is is that? I find that to be uselessly complexifying the fontification c= ode. > What was in my mind was have 2 new deffaces (not provided in the patch), = with > the same default value (or even an inherit property, that's much better) = as > =3Dorg-meta-line=3D. > > Wouldn't that be better? In the case of the inheritage, if not customize= d in > the color theme, the user would not see any change (I guess)... > > FYI, my intention is to add different faces as well for header arguments = and > their values... > > Best regards, > Seb