emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] emacs-26 671dc5a: Fix calls to buffer modification hoo


From: Stefan Monnier
Subject: Re: [Emacs-diffs] emacs-26 671dc5a: Fix calls to buffer modification hooks from replace-buffer-contents
Date: Sat, 21 Jul 2018 14:16:29 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> -      prepare_to_modify_buffer (from, to, NULL);
> +      /* If k >= l, it means nothing needs to be deleted.  */
> +      if (k < l)
> +     prepare_to_modify_buffer (from, to, NULL);

This comment makes it sound like before-change-functions won't be run
when there are only insertions (which would be wrong).

> -      signal_after_change (from, to - from, updated_to - from);
> -      update_compositions (from, updated_to, CHECK_INSIDE);
> +      /* Only call after-change-functions if something was actually
> +      inserted.  */
> +      if (from < updated_to)
> +     {
> +       signal_after_change (from, to - from, updated_to - from);
> +       update_compositions (from, updated_to, CHECK_INSIDE);
> +     }

And this comment makes it sound like after-change-functions won't be run
when there are only deletions (which would be similarly wrong).


        Stefan



reply via email to

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