comp.emacs
[Top] [All Lists]

Re: Turning regexp-opt back to a list of words

Subject: Re: Turning regexp-opt back to a list of words
From: Kyle
Date: Sat, 30 Aug 2008 07:17:22 -0700 PDT
Newsgroups: comp.emacs

On Aug 29, 9:26 am, rgb <rbiel...@xxxxxx> wrote:
> Lets say some mode writer used regexp-opt to create their font-lock-
> keyword expression.
> So only something like this string is in the mode source, not the
> original word list.
>
> "\\<\\(d\\(?:o\\|efault\\)\\|else\\(if\\)?\\|f\\(?:oreach\\|unction\\)\
> \|if\\|switch\\|t\\(?:hrow\\|rap\\)\\|w\\(?:here\\|hile\\)\\)\\>"
>
> The mode is not supported and I want to take over maintenance.
> That means adding words.
> Is there any way to turn this back into a list so the new words can be
> added?

Not sure if there is an automated way, but a poor-man's method of just
looking at it should be pretty easy.

Looks like it matches any of the following:

<do>
<default>
<else>
<elseif>
<foreach>
<function>
<if>
<switch>
<throw>
<trap>
<where>
<while>

Kyle

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy