all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Devon Sean McCullough <Emacs-hacker@Jovi.Net>
To: 5689@debbugs.gnu.org
Subject: bug#5689: looking-back-p
Date: Sat, 6 Mar 2010 13:29:46 -0500 (EST)	[thread overview]
Message-ID: <201003061829.o26ITkgP006003@jovi.net> (raw)

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."





             reply	other threads:[~2010-03-06 18:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-06 18:29 Devon Sean McCullough [this message]
2010-03-06 21:21 ` bug#5689: looking-back-p Stefan Monnier
2010-03-07 12:17 ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201003061829.o26ITkgP006003@jovi.net \
    --to=emacs-hacker@jovi.net \
    --cc=5689@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.