[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-orgmode] Remember templates and time stamp rounding.
From: |
Alex Bochannek |
Subject: |
Re: [Emacs-orgmode] Remember templates and time stamp rounding. |
Date: |
Fri, 17 Mar 2006 10:40:42 -0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
Carsten Dominik <address@hidden> 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.