GNU bug report logs -
#5689
looking-back-p
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5689 in the body.
You can then email your comments to 5689 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5689
; Package
emacs
.
(Sat, 06 Mar 2010 19:45:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Devon Sean McCullough <Emacs-hacker <at> Jovi.Net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 06 Mar 2010 19:45:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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."
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5689
; Package
emacs
.
(Sat, 06 Mar 2010 21:23:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 5689 <at> debbugs.gnu.org (full text, mbox):
> Please include the missing looking-back-p
looking-back is a function that people should generally try to avoid,
because it's very costly and its behavior is not always as people
might expect. So if anything, I'd rename it to
do-something-like-looking-at-but-going-backward and would definitely
refrain from providing a "-p" alternative that would make it sound like
"it's more lightweight" even tho it's actually even worse (tho
unnoticeably so).
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5689
; Package
emacs
.
(Sun, 07 Mar 2010 12:16:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 5689 <at> debbugs.gnu.org (full text, mbox):
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
Severity set to 'wishlist' from 'normal'
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Mon, 08 Mar 2010 19:31:02 GMT)
Full text and
rfc822 format available.
Added tag(s) wontfix.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Mon, 08 Mar 2010 19:31:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
5689 <at> debbugs.gnu.org and Devon Sean McCullough <Emacs-hacker <at> Jovi.Net>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 01 Feb 2014 07:30:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 01 Mar 2014 12:24:09 GMT)
Full text and
rfc822 format available.
This bug report was last modified 10 years and 303 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.