From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Devon Sean McCullough Newsgroups: gmane.emacs.bugs Subject: bug#5689: looking-back-p Date: Sat, 6 Mar 2010 13:29:46 -0500 (EST) Message-ID: <201003061829.o26ITkgP006003@jovi.net> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1267912534 20666 80.91.229.12 (6 Mar 2010 21:55:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 6 Mar 2010 21:55:34 +0000 (UTC) To: 5689@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 06 22:55:30 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 1No1Yw-0005BF-Gf for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Mar 2010 22:29:30 +0100 Original-Received: from localhost ([127.0.0.1]:52720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1No04s-0004Sq-QA for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Mar 2010 14:54:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1No04n-0004S2-AT for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2010 14:54:17 -0500 Original-Received: from [140.186.70.92] (port=51751 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1No04m-0004Rm-EK for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2010 14:54:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1No04k-0006Yk-IA for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2010 14:54:16 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52169) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1No04k-0006YY-FS for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2010 14:54:14 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Nnzvq-0001rr-Bb; Sat, 06 Mar 2010 14:45:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Devon Sean McCullough Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Mar 2010 19:45:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5689 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: X-Debbugs-Original-To: emacs-pretest-bug@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.12679046557147 (code B ref -1); Sat, 06 Mar 2010 19:45:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Mar 2010 19:44:15 +0000 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NnyuY-0000R0-TP for submit@debbugs.gnu.org; Sat, 06 Mar 2010 13:39:39 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]:44722) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NnyuU-00071M-Ga for emacs-pretest-bug@gnu.org; Sat, 06 Mar 2010 13:39:34 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35006) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NnyuU-0005AR-0U for emacs-pretest-bug@gnu.org; Sat, 06 Mar 2010 13:39:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nnyt6-0001Dr-Jo for emacs-pretest-bug@gnu.org; Sat, 06 Mar 2010 13:38:09 -0500 Original-Received: from jovi.net ([66.161.136.54]:4936) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nnyt6-0001Dh-EK for emacs-pretest-bug@gnu.org; Sat, 06 Mar 2010 13:38:08 -0500 Original-Received: from jovi.net (localhost [127.0.0.1]) by jovi.net (8.14.1/8.14.1) with ESMTP id o26ITu66006006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 6 Mar 2010 13:29:56 -0500 (EST) (envelope-from Devon@Jovi.Net) Original-Received: (from devon@localhost) by jovi.net (8.14.1/8.14.1/Submit) id o26ITkgP006003; Sat, 6 Mar 2010 13:29:46 -0500 (EST) (envelope-from Devon@Jovi.Net) X-Authentication-Warning: jovi.net: devon set sender to Devon@Jovi.Net using -f Received-SPF: Pass (client IP white listed); receiver=localhost; client-ip=127.0.0.1; envelope-from= Received-SPF: Pass (client IP white listed); receiver=localhost; client-ip=127.0.0.1; helo= X-DCC--Metrics: grant.org 1170; IP=ok Body=2 Fuz1=2 Fuz2=2 X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sat, 06 Mar 2010 14:45:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:35461 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."