bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43242: [PATCH] Fix CSS completion bug


From: Lars Ingebrigtsen
Subject: bug#43242: [PATCH] Fix CSS completion bug
Date: Sun, 06 Sep 2020 23:46:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

"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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]