From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Question about org-emph-re Date: Fri, 21 May 2010 09:31:33 +0200 Message-ID: <06CB43AB-CF0A-4BA3-BD53-5AA504A37621@gmail.com> References: <4BF5F3F9.8040809@sift.info> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=44597 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFSET-0000CC-94 for emacs-orgmode@gnu.org; Fri, 21 May 2010 09:25:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFRyG-000825-7c for emacs-orgmode@gnu.org; Fri, 21 May 2010 09:09:02 -0400 Received: from mail-ew0-f216.google.com ([209.85.219.216]:54823) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFMiH-0001Xs-0I for emacs-orgmode@gnu.org; Fri, 21 May 2010 03:32:11 -0400 Received: by ewy8 with SMTP id 8so143813ewy.8 for ; Fri, 21 May 2010 00:32:07 -0700 (PDT) In-Reply-To: <4BF5F3F9.8040809@sift.info> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: rpgoldman@sift.info 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