GNU bug report logs - #43242
[PATCH] Fix CSS completion bug

Previous Next

Package: emacs;

Reported by: "Philip K." <philipk <at> posteo.net>

Date: Sun, 6 Sep 2020 12:52:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 43242 <at> debbugs.gnu.org (full text, mbox):

From: "Philip K." <philipk <at> posteo.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 43242 <at> debbugs.gnu.org
Subject: Re: bug#43242: [PATCH] Fix CSS completion bug
Date: Sun, 06 Sep 2020 23:55:43 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> "Philip K." <philipk <at> 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.

Oh, I wasn't familiar with that convention. I always save the match data
to avoid bugs bugs down the line. If it's wished for, I can resubmit the
patch without the save-match-data.

-- 
	Philip K.




This bug report was last modified 4 years and 315 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.