emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alex Bochannek <alexb@juniper.net>
To: Carsten Dominik <dominik@science.uva.nl>
Cc: emacs-orgmode@gnu.org
Subject: Re: Remember templates and time stamp rounding.
Date: Fri, 17 Mar 2006 10:40:42 -0800	[thread overview]
Message-ID: <ubqw4gbit.fsf@juniper.net> (raw)
In-Reply-To: <ff7823fe9c92fcb41c9a3b45b6949ecd@science.uva.nl> (Carsten Dominik's message of "Fri, 17 Mar 2006 10:57:08 +0100")

Carsten Dominik <dominik@science.uva.nl> writes:

>> For the emphasis font-locks, these regexps work well for me:
>>
>> (if em  '("\\([[:punct:][:space:]]\\|^\\)\\(\\*\\([^*[:
>> space:]]+\\)\\*\\)\\([[:space:][:punct:]]\\|$\\)" 0 'bold))
>> (if em
>> ("\\([[:punct:][:space:]]\\|^\\)\\(/\\([^/[:space:]]+\\)/\\)\\([[:
>> space:][:punct:]]\\|$\\)" 0 'italic))
>> (if em
>> ("\\([[:punct:][:space:]]\\|^\\)\\(_\\([^_[:space:]]+\\)_\\)\\([[:
>> space:][:punct:]]\\|$\\)" 0 'underline))
>
> Hi Alex, what is wrong with the expressions I have in org.el?

The issue was that there would be no emphasis added when there was
punctuation before or after it. Punctuation inside would also break
it. Finally, I think the :space: character class is a bit more
inclusive than what you used, but I don't recall for sure.

Basically, the regexp above says:

punctuation or white space or beginning of line
 followed by the emphasis character
  at least one non-emphasis or space character
 followed by the emphasis character
punctuation or white space or end of line

I seem to recall that I ran into an issue when I did something like:
*foo-bar* and it wouldn't emphasize.

By the way, I am also leaning towards allowing multiple tokens that
are separated by one space since I sometimes would use it to emphasize
commands like: *ls -l*.

Maybe this would be better:

'("\\([[:punct:][:space:]]\\|^\\)\\(\\*\\([^*[:space:]]+\\)\\( \\([^*[:space:]]+\\)\\)*\\*\\)\\([[:space:][:punct:]]\\|$\\)" 0 'bold)

Alex.

  parent reply	other threads:[~2006-03-17 18:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-17  7:28 Remember templates and time stamp rounding Carsten Dominik
2006-03-17  8:02 ` Alex Bochannek
     [not found]   ` <ff7823fe9c92fcb41c9a3b45b6949ecd@science.uva.nl>
2006-03-17 18:40     ` Alex Bochannek [this message]
2006-03-19 22:23 ` Philip Rooke
2006-03-20 13:24   ` Jason F. McBrayer

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=ubqw4gbit.fsf@juniper.net \
    --to=alexb@juniper.net \
    --cc=dominik@science.uva.nl \
    --cc=emacs-orgmode@gnu.org \
    /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).