emacs-devel
[Top][All Lists]
Advanced

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

Re: master c59e878: Inhibit modification hooks when saving eieio-persist


From: Stefan Monnier
Subject: Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
Date: Fri, 01 May 2020 17:01:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>     Inhibit modification hooks when saving eieio-persistent's
>     
>     * lisp/emacs-lisp/eieio-base.el (eieio-persistent-save): Bind
>     inhibit-modification-hooks -> t.

I think this deserves an explanation (as a extensive comment explaining
why it's needed and why we think it's safe to do it here.)

Binding `inhibit-modification-hooks` is not as dangerous as binding
`inhibit-quit` but it's something we should still avoid as much
as possible.


        Stefan


> ---
>  lisp/emacs-lisp/eieio-base.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
> index 2cb1f61..010a2b6 100644
> --- a/lisp/emacs-lisp/eieio-base.el
> +++ b/lisp/emacs-lisp/eieio-base.el
> @@ -473,7 +473,8 @@ instance."
>      (let* ((cfn (or file (oref this file)))
>             (default-directory (file-name-directory cfn)))
>        (cl-letf ((standard-output (current-buffer))
> -                ((oref this file)       ;FIXME: Why change it?
> +                (inhibit-modification-hooks t)
> +                ((oref this file) ;FIXME: Why change it?
>                   (if file
>                       ;; FIXME: Makes a name relative to (oref this file),
>                       ;; whereas I think it should be relative to cfn.




reply via email to

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