[Top][All Lists]

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

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

From: Michael Heerdegen
Subject: Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
Date: Sat, 02 May 2020 23:08:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> E.g. for `on-screen`, AFAICT the after-change-function is only there to
> remove the highlighting when you modify the buffer (tho, AFAICT it
> doesn't seem to work in my tests, so maybe I misunderstand it).

Did you turn `on-screen-remove-when-edit' on (default: off)?

> So IIUC, your after-change-function only need to be installed in those
> buffers where there is highlighting to be removed.  IOW, the hook
> function should be added to the buffer when you add highlighting to it,
> and then removed when you remove the highlighting.  This will also
> ensure that it will only be called once per command in any given
> buffer.

Yes, exactly that.

> >> Not necessarily: it could be too slow (because of the cost to
> >> enter/leave `combine-change-calls`).
> > You mean when it's called in iteration?  That makes sense.
> Another reason is that we don't know that `object-write` is only called
> in temp buffers.

I understand that answer for `inhibit-modification-hooks', but not for
`combine-change-calls' - what is bad about combining change calls when
writing to an arbitrary buffer?

BTW, while we are on the subject, I don't understand this sentence in
the doc of the related `combine-after-change-calls' (which I don't
suggest to use):

| If BODY makes changes in the buffer, they are recorded and the
| functions on `after-change-functions' are called several times when
| BODY is finished.

Why several times - I thought this is what the thing would avoid?  And
how often is "several times"?



reply via email to

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