From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: custom emacs org-emphasis-alist breaks EXPORT, help ;-) ? Date: Sat, 05 Oct 2013 12:42:14 +0800 Message-ID: <87r4c08h21.fsf@ericabrahamsen.net> References: <87r4c1mrh1.fsf@bzg.ath.cx> <87d2nlzcoo.fsf@bzg.ath.cx> <878uy99z28.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSKcO-0001bv-Ay for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 01:41:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSKcI-0003k1-2t for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 01:41:32 -0400 Received: from plane.gmane.org ([80.91.229.3]:58260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSKcH-0003j0-Rh for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 01:41:25 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VSKcG-00013m-9O for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 07:41:24 +0200 Received: from 114.250.118.156 ([114.250.118.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Oct 2013 07:41:24 +0200 Received: from eric by 114.250.118.156 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Oct 2013 07:41:24 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Xebar Saram writes: > Thank you so much Eric > > that works well apart from as you said it sometime "spills" over to > other uneeded lines. any idea of how to limit the number of newlines > that > the regexp can match? > > really appreciate the help The easiest thing would be to add a newline to the list of non-matching characters, like this: "\\(♩[^♩\n]+♩\\)". That won't match _anything_ that goes longer than one line, though -- is that what you want? I'm actually not sure how to make the regexp match a specific number of newlines without things getting much more complicated... > On Fri, Oct 4, 2013 at 12:15 PM, Eric Abrahamsen < > eric@ericabrahamsen.net> wrote: > > Xebar Saram writes: > > > Thank you again > > > > that works well but i think it dosent cover what i had in org. > in org > > i use the ♩ symbol to highlight all the text between the 2 ♩, > IE > > > > ♩ALL THIS TEXT IS HIGHLIGHTED♩, currently with the above code > the ♩ > > is highlighted but not the text between, is it possible to do > achive > > that with font-lock? > > > > i really appreciate your help! > > > > z > > Yup, it's pretty much the exact same thing, just with a different > regexp. > > (font-lock-add-keywords >  'org-mode >  '(("\\(♩[^♩]+♩\\)" (0 '(:weight ultra-bold :background "# > FFBF1E") t)))) > > You can use "♩\\([^♩]+\\)♩" instead, if you only want the text > between > the symbols to be highlighted. > > It might be a good idea to somehow limit the number of newlines > that > the regexp can match, I'm not sure. > > Yours, > Eric > >