emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Question about org-emph-re
@ 2010-05-21  2:46 Robert Goldman
  2010-05-21  7:31 ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Goldman @ 2010-05-21  2:46 UTC (permalink / raw)
  To: Org Mode

I have been trying to make the generic exporter do fontification (bold,
italic, underline, etc.) and have fairly successfully managed to do this
by cargo-culting the code in org-latex.

But I've run myself on a rock.  I can't figure out what the various
matches are that you get when you match org-emph-re.  There are at least
5 matches, and some may be empty, etc.  I don't /believe/ these are
documented anywhere (or I didn't find the docs).

Can anyone tell me what (match-string x) will be after a (string-match
org-emph-re string) call?  Or tell me where to look to figure it out?

If so, I think I can get the fontification to work for org-generic-export.

(also, emacs-lisp question --- is there some way to /clear/ all the
registers for MATCH-STRING?  When I have been doing this, I have
occasionally had troubles where match-string outputs from previous calls
to string-match seem to "bleed through.")

thanks!
r

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about org-emph-re
  2010-05-21  2:46 Question about org-emph-re Robert Goldman
@ 2010-05-21  7:31 ` Carsten Dominik
  2010-05-21 12:58   ` Robert Goldman
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2010-05-21  7:31 UTC (permalink / raw)
  To: rpgoldman; +Cc: Org Mode


On May 21, 2010, at 4:46 AM, Robert Goldman wrote:

> I have been trying to make the generic exporter do fontification  
> (bold,
> italic, underline, etc.) and have fairly successfully managed to do  
> this
> by cargo-culting the code in org-latex.
>
> But I've run myself on a rock.  I can't figure out what the various
> matches are that you get when you match org-emph-re.  There are at  
> least
> 5 matches, and some may be empty, etc.  I don't /believe/ these are
> documented anywhere (or I didn't find the docs).
>
> Can anyone tell me what (match-string x) will be after a (string-match
> org-emph-re string) call?  Or tell me where to look to figure it out?
>
> If so, I think I can get the fontification to work for org-generic- 
> export.


The match groups are now documented:

http://repo.or.cz/w/org-mode.git/commitdiff/67331a2de01cabc8e5bfc0f45d901c10aecf96a2

>
> (also, emacs-lisp question --- is there some way to /clear/ all the
> registers for MATCH-STRING?  When I have been doing this, I have
> occasionally had troubles where match-string outputs from previous  
> calls
> to string-match seem to "bleed through.")

You always need to check if there is actually a match by checking the  
return value of the call.  If there was a match, then you can rely on  
the group.  If there was no match, the groups bleed through

(when (string-match ...)
    ;; here you can rely on the groups
)


(when (re-search-forward "..." ...)
    ;; here you can rely on he groups
)


HTH

- Carsten

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about org-emph-re
  2010-05-21  7:31 ` Carsten Dominik
@ 2010-05-21 12:58   ` Robert Goldman
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Goldman @ 2010-05-21 12:58 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org Mode

On 5/21/10 May 21 -2:31 AM, Carsten Dominik wrote:
> 
> On May 21, 2010, at 4:46 AM, Robert Goldman wrote:
> 
>> I have been trying to make the generic exporter do fontification (bold,
>> italic, underline, etc.) and have fairly successfully managed to do this
>> by cargo-culting the code in org-latex.
>>
>> But I've run myself on a rock.  I can't figure out what the various
>> matches are that you get when you match org-emph-re.  There are at least
>> 5 matches, and some may be empty, etc.  I don't /believe/ these are
>> documented anywhere (or I didn't find the docs).
>>
>> Can anyone tell me what (match-string x) will be after a (string-match
>> org-emph-re string) call?  Or tell me where to look to figure it out?
>>
>> If so, I think I can get the fontification to work for
>> org-generic-export.
> 
> 
> The match groups are now documented:
> 
> http://repo.or.cz/w/org-mode.git/commitdiff/67331a2de01cabc8e5bfc0f45d901c10aecf96a2

Thank you very much, Carsten.  This is brilliant.  With this information
I hope to be able to improve the org-export-generic substantially.

Best,
R

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-21 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-21  2:46 Question about org-emph-re Robert Goldman
2010-05-21  7:31 ` Carsten Dominik
2010-05-21 12:58   ` Robert Goldman

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).