From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: How to add comments in a plain list Date: Mon, 28 Sep 2009 08:21:40 +0100 Message-ID: References: <87r5tzhawh.fsf@gollum.intra.norang.ca> <87my4n9qfp.wl%ucecesf@ucl.ac.uk> <87my4ngn0i.fsf@gollum.intra.norang.ca> <87d45j9kvj.wl%ucecesf@ucl.ac.uk> <877hvrgjdq.fsf@gollum.intra.norang.ca> <874oqv9dsi.wl%ucecesf@ucl.ac.uk> <87my4j49on.wl%ucecesf@ucl.ac.uk> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsAyb-0008T4-Oo for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsAyX-0008Q3-7f for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:53 -0400 Received: from [199.232.76.173] (port=37143 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsAyW-0008Pw-P2 for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:48 -0400 Received: from mx20.gnu.org ([199.232.41.8]:4362) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MsAyW-0005Gu-A5 for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:48 -0400 Received: from mail-ew0-f208.google.com ([209.85.219.208]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MsAyV-0007Vh-J3 for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:47 -0400 Received: by mail-ew0-f208.google.com with SMTP id 4so2290951ewy.31 for ; Mon, 28 Sep 2009 00:48:47 -0700 (PDT) In-Reply-To: <87my4j49on.wl%ucecesf@ucl.ac.uk> 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: Eric S Fraga Cc: emacs-orgmode@gnu.org On Sep 25, 2009, at 11:10 AM, Eric S Fraga wrote: > At Thu, 24 Sep 2009 10:27:57 +0100, Carsten Dominik wrote: >> On Sep 22, 2009, at 7:30 PM, Ren=E9 wrote: >>> Unfortunately, in this case Emacs doesn't fontify those lines as if >>> they were comments. >> >> It does now. >> >> - Carsten > > Carsten, thanks for this. It works perfectly. > > But this leads to me a more general question for all of you emacs > experts: comments in my org files typically consist of /less > important/ text and so I like to de-emphasise the text by changing the > face used (to a light gray, in my case, compared with the default of > firebrick). However, for programming, I prefer the default. Can > somebody suggest how I can have a different font-lock-comment-face for > org-mode files without making a global change? Should I put something > in the org-mode hook? > > Or even on a per-file basis? I've tried using Emacs local variables > but haven't found the right incantation... :( > > Any suggestions more than welcome! Hi Eric, I don't know how to change `font-lock-comment-face' on a per-buffer =20 level. What you can do though (I think) is use the function `font-lock-add-=20 keywords' to add your own regular expression for matching comments and specify an arbitrary font for this match. For example (untested): (font-lock-add-keywords 'org-mode '(("^[ \t]*#.*" 0 my-org-comment-face prepend))) - Carsten