From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= Newsgroups: gmane.emacs.bugs Subject: bug#5689: looking-back-p Date: Sun, 07 Mar 2010 13:17:03 +0100 Message-ID: <4B93993F.5000208@easy-emacs.de> References: <201003061829.o26ITkgP006003@jovi.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1267964716 13913 80.91.229.12 (7 Mar 2010 12:25:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 7 Mar 2010 12:25:16 +0000 (UTC) Cc: 5689@debbugs.gnu.org To: Devon Sean McCullough Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 07 13:25:12 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NoFX1-0007Tk-3Q for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Mar 2010 13:24:27 +0100 Original-Received: from localhost ([127.0.0.1]:36806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NoFX0-0007J9-Bv for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Mar 2010 07:24:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NoFWv-0007HZ-On for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2010 07:24:21 -0500 Original-Received: from [140.186.70.92] (port=35540 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NoFWu-0007G8-2z for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2010 07:24:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NoFWq-0002JZ-TR for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2010 07:24:19 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60645) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NoFWq-0002JC-RY for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2010 07:24:16 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NoFOs-0007vg-1m; Sun, 07 Mar 2010 07:16:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Mar 2010 12:16:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5689 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5689-submit@debbugs.gnu.org id=B5689.126796411630472 (code B ref 5689); Sun, 07 Mar 2010 12:16:02 +0000 Original-Received: (at 5689) by debbugs.gnu.org; 7 Mar 2010 12:15:16 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NoFO7-0007vR-Od for submit@debbugs.gnu.org; Sun, 07 Mar 2010 07:15:15 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.186]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NoFO6-0007vK-3s for 5689@debbugs.gnu.org; Sun, 07 Mar 2010 07:15:15 -0500 Original-Received: from [192.168.178.27] (p54BEA3F1.dip0.t-ipconnect.de [84.190.163.241]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MGXWy-1NsfDp2ZFI-00Dn0O; Sun, 07 Mar 2010 13:14:38 +0100 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: <201003061829.o26ITkgP006003@jovi.net> X-Provags-ID: V01U2FsdGVkX18o6xwMoTUVu2NcfTWVy7c6phqn1GFxNaEzSXN 2JF5lAWVkl4RMLdRV5T61DvUf3iPrXqgY2Sm6XmNL59aJhzJsK 70fMQ8vIDpv+cLZVuyHBbjGGfjdjLXpYIU/Dhwuo4k= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 07 Mar 2010 07:16:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35460 Archived-At: Devon Sean McCullough wrote: > Please include the missing looking-back-p > either as a subst like looking-at-p and string-match-p > > --- lisp/subr.el.~1.667.~ 2009-11-24 22:59:23.000000000 -0500 > +++ lisp/subr.el 2010-03-06 12:52:30.000000000 -0500 > @@ -2984,6 +2984,12 @@ > (let ((inhibit-changing-match-data t)) > (looking-at regexp))) > > +(defsubst looking-back-p (regexp &optional limit greedy) > + "\ > +Same as `looking-back' except this saves the match data." > + (save-match-data > + (looking-back regexp limit greedy))) > + > (defsubst string-match-p (regexp string &optional start) > "\ > Same as `string-match' except this function does not change the match data." > > or as a macro like > > --- lisp/subr.el.~1.667.~ 2009-11-24 22:59:23.000000000 -0500 > +++ lisp/subr.el 2010-03-06 13:18:53.000000000 -0500 > @@ -2984,6 +2984,14 @@ > (let ((inhibit-changing-match-data t)) > (looking-at regexp))) > > +(defmacro looking-back-p (&rest args) > + "\ > +Same as `looking-back' except this saves the match data. > + > +\(fn REGEXP &optional LIMIT GREEDY)" > + `(save-match-data > + (looking-back .,args))) > + > (defsubst string-match-p (regexp string &optional start) > "\ > Same as `string-match' except this function does not change the match data." > > > > Hi Devon, thanks a lot. As a change usually has pros and cons, just my personal view: `save-match-data' changes the way of execution, I'd like to see it expressingly. Think code is pretty good readable as it's now. Andreas