From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: custom emacs org-emphasis-alist breaks EXPORT, help ;-) ? Date: Sat, 5 Oct 2013 20:09:00 +0300 Message-ID: References: <87r4c1mrh1.fsf@bzg.ath.cx> <87d2nlzcoo.fsf@bzg.ath.cx> <878uy99z28.fsf@ericabrahamsen.net> <87r4c08h21.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11334a3cb10d7404e80179e6 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSVLk-0003df-03 for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 13:09:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSVLi-0002kr-Rg for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 13:09:03 -0400 Received: from mail-bk0-x22d.google.com ([2a00:1450:4008:c01::22d]:53418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSVLi-0002kX-DG for emacs-orgmode@gnu.org; Sat, 05 Oct 2013 13:09:02 -0400 Received: by mail-bk0-f45.google.com with SMTP id mx11so1998146bkb.4 for ; Sat, 05 Oct 2013 10:09:01 -0700 (PDT) In-Reply-To: <87r4c08h21.fsf@ericabrahamsen.net> 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: Eric Abrahamsen Cc: org mode --001a11334a3cb10d7404e80179e6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable thx again Eric i still have an issue with this when one of the symbols used to start/end the highlight is used in a sentence, for example using your code: (font-lock-add-keywords 'org-mode '(("-1-\\([^-1-]+\\)-1-" (0 '(:weight ultra-bold :background "#DDFFDD" :foreground "#000000") t)))) if i write this: -1- this is a test of 1x1 to show higlight -1- it will kill the highlight, if i use the same text omitting the '1' it works well, anyway around this issue? i thought it would have matcehd -1- but it seems it matches also just 1 by itself best wishes and thx again Z On Sat, Oct 5, 2013 at 7:42 AM, Eric Abrahamsen wr= ote: > 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: "\\(=E2=99=A9[^=E2=99=A9\n]+=E2=99=A9\\)". That wo= n'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 =E2=99=A9 symbol to highlight all the text between the = 2 =E2=99=A9, > > IE > > > > > > =E2=99=A9ALL THIS TEXT IS HIGHLIGHTED=E2=99=A9, currently with th= e above code > > the =E2=99=A9 > > > 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 > > '(("\\(=E2=99=A9[^=E2=99=A9]+=E2=99=A9\\)" (0 '(:weight ultra-bold= :background "# > > FFBF1E") t)))) > > > > You can use "=E2=99=A9\\([^=E2=99=A9]+\\)=E2=99=A9" 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 > > > > > > > --001a11334a3cb10d7404e80179e6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
thx again Eric

i still h= ave an issue with this when one of the symbols used to start/end the highli= ght is used in a sentence, for example using your code:

(font-lock-add-keywords
=C2=A0'org-mode
= =C2=A0'(("-1-\\([^-1-]+\\)-1-" (0 '(:weight ultra-bold :b= ackground "#DDFFDD" :foreground "#000000") t))))
<= /div>

if i write this:

-1- this is a test= of 1x1 to show higlight -1-

it will kill the high= light, if i use the same text omitting the '1' it works well, anywa= y around this issue? i thought it would have matcehd -1- but it seems it ma= tches also just 1 by itself

best wishes and thx again

Z



=

On Sat, Oct 5, 2013 at 7:42 AM, Eric Abr= ahamsen <eric@ericabrahamsen.net> wrote:
Xebar Saram <zeltakc@gmail.com> 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=C2=A0the number of newli= nes
> that
> the regexp can match?
>
> really=C2=A0appreciate=C2=A0the help

The easiest thing would be to add a newline to the list of non-matchi= ng
characters, like this: "\\(=E2=99=A9[^=E2=99=A9\n]+=E2=99=A9\\)".= 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:
>
> =C2=A0 =C2=A0 Xebar Saram <zel= takc@gmail.com> writes:
>
> =C2=A0 =C2=A0 > Thank you again
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > that works well but i think it dosent cover what i = had in org.
> =C2=A0 =C2=A0 in org
> =C2=A0 =C2=A0 > i use the=C2=A0=E2=99=A9 symbol to highlight all th= e text between the 2=C2=A0=E2=99=A9,
> =C2=A0 =C2=A0 IE
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =E2=99=A9ALL THIS TEXT IS HIGHLIGHTED=E2=99=A9, cur= rently with the above code
> =C2=A0 =C2=A0 the=C2=A0=E2=99=A9
> =C2=A0 =C2=A0 > is highlighted but not the text between, is it poss= ible to do
> =C2=A0 =C2=A0 achive
> =C2=A0 =C2=A0 > that with font-lock?
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > i really=C2=A0appreciate=C2=A0your help!
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > z
>
> =C2=A0 =C2=A0 Yup, it's pretty much the exact same thing, just wit= h a different
> =C2=A0 =C2=A0 regexp.
>
> =C2=A0 =C2=A0 (font-lock-add-keywords
> =C2=A0 =C2=A0 =C2=A0'org-mode
> =C2=A0 =C2=A0 =C2=A0'(("\\(=E2=99=A9[^=E2=99=A9]+=E2=99=A9\\)= " (0 '(:weight ultra-bold :background "#
> =C2=A0 =C2=A0 FFBF1E") t))))
>
> =C2=A0 =C2=A0 You can use "=E2=99=A9\\([^=E2=99=A9]+\\)=E2=99=A9&= quot; instead, if you only want the text
> =C2=A0 =C2=A0 between
> =C2=A0 =C2=A0 the symbols to be highlighted.
>
> =C2=A0 =C2=A0 It might be a good idea to somehow limit the number of n= ewlines
> =C2=A0 =C2=A0 that
> =C2=A0 =C2=A0 the regexp can match, I'm not sure.
>
> =C2=A0 =C2=A0 Yours,
> =C2=A0 =C2=A0 Eric
>
>



--001a11334a3cb10d7404e80179e6--