From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Philip K." <philipk@posteo.net>
Cc: 43242@debbugs.gnu.org
Subject: bug#43242: [PATCH] Fix CSS completion bug
Date: Sun, 06 Sep 2020 23:46:54 +0200 [thread overview]
Message-ID: <87bliid1dd.fsf@gnus.org> (raw)
In-Reply-To: <87imcqeg85.fsf@posteo.net> (Philip K.'s message of "Sun, 06 Sep 2020 23:40:42 +0200")
"Philip K." <philipk@posteo.net> writes:
> Well, it's being used in the next line in the member call to extract the
> record from css-property-ids.
I think there may be a slight misunderstanding about what the point of
save-match-data is. Here's the code:
+ (save-match-data
+ (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*"
+ (line-beginning-position) t)
+ (car (member (match-string-no-properties 1)
+ css-property-ids))))))
The regexp operators set a global match state, but is you use
save-match-data, the previous global state is restored after the form
ends. So save-match-data is used to preserve the global state -- it's
not necessary if you don't care about overwriting it, and overwriting it
is the norm.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2020-09-06 21:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-06 12:51 bug#43242: [PATCH] Fix CSS completion bug Philip K.
2020-09-06 19:30 ` Lars Ingebrigtsen
2020-09-06 21:40 ` Philip K.
2020-09-06 21:46 ` Lars Ingebrigtsen [this message]
2020-09-06 21:55 ` Philip K.
2020-09-06 21:57 ` Lars Ingebrigtsen
2020-09-06 22:15 ` Philip K.
2020-09-06 22:17 ` Lars Ingebrigtsen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bliid1dd.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=43242@debbugs.gnu.org \
--cc=philipk@posteo.net \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).