Carsten Dominik <[EMAIL PROTECTED]> 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.



_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to