From: Yuan Fu <casouri@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Move 'with-buffer-modified-unmodified' to simple.el
Date: Fri, 18 Sep 2020 14:25:25 -0400 [thread overview]
Message-ID: <D3BA143E-E928-4CED-A5A7-CA9A2DBDF60F@gmail.com> (raw)
In-Reply-To: <jwvpn6lnlyk.fsf-monnier+emacs@gnu.org>
> 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
next prev parent reply other threads:[~2020-09-18 18:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 23:12 Move 'with-buffer-modified-unmodified' to simple.el Yuan Fu
2020-09-17 3:11 ` Stefan Monnier
2020-09-18 18:25 ` Yuan Fu [this message]
2020-09-18 19:56 ` Stefan Monnier
2020-10-01 16:24 ` Yuan Fu
2020-10-01 16:51 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D3BA143E-E928-4CED-A5A7-CA9A2DBDF60F@gmail.com \
--to=casouri@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).