[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Move 'with-buffer-modified-unmodified' to simple.el
From: |
Yuan Fu |
Subject: |
Re: Move 'with-buffer-modified-unmodified' to simple.el |
Date: |
Fri, 18 Sep 2020 14:25:25 -0400 |
> On Sep 16, 2020, at 11:11 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
>> Currently it’s in bookmark.el. It seems to make more sense to be in
>> simple.el or sub.el. WDYT?
>
> Most use cases should be covered by `with-silent-modifications`, but
> there might indeed be cases as in bookmark.el where the extra bindings
> in `with-silent-modifications` aren't right.
>
> Could you look through our code (e.g. with something like
>
> grep '(set-buffer-modified-p' **/*.el | grep -v 'd-p \(nil\|t\))'
>
> ) to see where we could use `with-silent-modifications` and where only
> 'with-buffer-modified-unmodified' can be used?
>
>
> Stefan
>
How should we determine if the extra bindings in `with-silent-modifications’
aren’t right? In my understanding `with-silent-modifications’ should only be
used when changing text properties and if you actually insert something you
should use `with-buffer-modified-unmodified’. Is that correct?
Looking though the result of the grep, I see some text property changes and
some content changes. But the content changes seems to appear in
program-generated buffers so I’m not sure if `with-silent-modifications’ would
do any harm anyway.
So, uh, maybe subr-x.el?
Yuan