emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Possible regexp bug in org.el


From: Nicolas Richard
Subject: Re: [O] Possible regexp bug in org.el
Date: Tue, 01 Apr 2014 12:16:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Thorsten Jolitz <address@hidden> writes:
> here is a possible regexp bug in org.el I discovered by accident:
>
> ,---------------------------------------------
> | 7734:       (and (not (looking-back "^\*+"))
> `---------------------------------------------

It's almost certainly a typo, but it introduces no bug because '*' can't
bear its special meaning after '^', so the regexp engine will make it
match exactly the '*' character. But it'd be better written as "^*+"
(but this is not recommended) or, preferably, "^\\*+" indeed.

Here's the relevant manual excerpt from (info "(elisp) Regexp Special") :

>    *Please note:* For historical compatibility, special characters are
> treated as ordinary ones if they are in contexts where their special
> meanings make no sense.  For example, `*foo' treats `*' as ordinary
> since there is no preceding expression on which the `*' can act.  It is
> poor practice to depend on this behavior; quote the special character
> anyway, regardless of where it appears.

-- 
Nico.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]