emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Xebar Saram <zeltakc@gmail.com>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: org mode <emacs-orgmode@gnu.org>
Subject: Re: custom emacs org-emphasis-alist breaks EXPORT, help ;-) ?
Date: Sat, 5 Oct 2013 20:09:00 +0300	[thread overview]
Message-ID: <CAOQHXPr6KusjqW3cKNstcUd7JvRFy31A2Dcyry1kUtX41as2sw@mail.gmail.com> (raw)
In-Reply-To: <87r4c08h21.fsf@ericabrahamsen.net>

[-- Attachment #1: Type: text/plain, Size: 2614 bytes --]

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 <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 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 <zeltakc@gmail.com> 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
> >
> >
>
>
>

[-- Attachment #2: Type: text/html, Size: 3875 bytes --]

  reply	other threads:[~2013-10-05 17:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-04  6:31 custom emacs org-emphasis-alist breaks EXPORT, help ;-) ? Xebar Saram
2013-10-04  7:21 ` Bastien
2013-10-04  7:50   ` Xebar Saram
2013-10-04  8:02     ` Bastien
2013-10-04  8:23       ` Xebar Saram
2013-10-04  8:27         ` Bastien
2013-10-04  9:15         ` Eric Abrahamsen
2013-10-04 19:12           ` Xebar Saram
2013-10-05  4:42             ` Eric Abrahamsen
2013-10-05 17:09               ` Xebar Saram [this message]
2013-10-06  5:04                 ` Eric Abrahamsen
2013-11-02  7:48                   ` Xebar Saram
2013-11-02 10:15                     ` Eric Abrahamsen
2013-11-02 12:50                       ` Xebar Saram
2013-11-02 15:12                         ` Jambunathan K
2013-11-03  4:15                         ` Eric Abrahamsen
2013-11-03  9:48                           ` Xebar Saram
2013-11-03  0:16                             ` Jambunathan K
2013-11-04  4:03                             ` Eric Abrahamsen
2013-11-04  7:14                               ` Xebar Saram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOQHXPr6KusjqW3cKNstcUd7JvRFy31A2Dcyry1kUtX41as2sw@mail.gmail.com \
    --to=zeltakc@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=eric@ericabrahamsen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).