From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Richard Subject: Re: Possible regexp bug in org.el Date: Tue, 01 Apr 2014 12:16:49 +0200 Message-ID: <878urp1him.fsf@yahoo.fr> References: <87ob0lmlg2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUvkj-0000Fa-5b for emacs-orgmode@gnu.org; Tue, 01 Apr 2014 06:17:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUvka-0004Ht-8q for emacs-orgmode@gnu.org; Tue, 01 Apr 2014 06:17:09 -0400 Received: from mxin.ulb.ac.be ([164.15.128.112]:11440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUvka-0004Hh-2n for emacs-orgmode@gnu.org; Tue, 01 Apr 2014 06:17:00 -0400 In-Reply-To: <87ob0lmlg2.fsf@gmail.com> (Thorsten Jolitz's message of "Tue, 01 Apr 2014 11:46:21 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Thorsten Jolitz Cc: emacs-orgmode@gnu.org Thorsten Jolitz 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.