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

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

bug#33414: 27.0.50; inhibit-changing-match-data can be t in syntax-prope


From: Eli Zaretskii
Subject: bug#33414: 27.0.50; inhibit-changing-match-data can be t in syntax-propertize functions, breaking backtrace and looking-at
Date: Sun, 05 Sep 2021 12:40:25 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  Pip Cet <pipcet@gmail.com>,
>   33414@debbugs.gnu.org
> Date: Sun, 05 Sep 2021 11:29:38 +0200
> 
> Philipp <p.stephani2@gmail.com> writes:
> 
> >> `inhibit-changing-match-data' just seems like a bad interface to me.
> >
> > Yes, using a public dynamic variable (i.e., public global mutable
> > state) to influence the behavior of a function is normally a bad idea.

FWIW, I don't share the above view.  We bind variables to affect
behavior of functions all over the place, and that is perfectly okay,
IMO.

> -@defun looking-at regexp
> +@defun looking-at regexp &optional inhibit-save
                                      ^^^^^^^^^^^^
A typo?

> --- a/lisp/auth-source.el
> +++ b/lisp/auth-source.el
> @@ -1447,12 +1447,13 @@ auth-source-netrc-saver
>  `auth-source-netrc-cache' to avoid prompting more than once."
>    (let* ((key (format "%s %s" file (rfc2104-hash 'md5 64 16 file add)))
>           (cached (assoc key auth-source-netrc-cache)))
> -
> +    (message "hello 2 %s" cached)
>      (if cached
>          (auth-source-do-trivia
>           "auth-source-netrc-saver: found previous run for key %s, returning"
>           key)
>        (with-temp-buffer
> +        (message "hello 3 %s" file)
>          (when (file-exists-p file)
>            (insert-file-contents file))
>          (when auth-source-gpg-encrypt-to
> @@ -1472,8 +1473,11 @@ auth-source-netrc-saver
>                (done (not (eq auth-source-save-behavior 'ask)))
>                (bufname "*auth-source Help*")
>                k)
> +          (message "hello 3 %s %s" auth-source-save-behavior done)
>            (while (not done)
> +            (message "hello 3.5")
>              (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ?e ??)))
> +            (message "hello 4 %s" k)
>              (cl-case k
>                (?y (setq done t))
>                (?? (save-excursion

Debugging code left-overs?

> +(make-obsolete-variable 'inhibit-changing-match-data nil "28.1")

Really? why obsolete it?





reply via email to

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