From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Move 'with-buffer-modified-unmodified' to simple.el Date: Fri, 18 Sep 2020 14:25:25 -0400 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11812"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 18 20:47:01 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJLPQ-0002x2-Sl for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Sep 2020 20:47:00 +0200 Original-Received: from localhost ([::1]:51816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJLPP-0008Q1-Nv for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Sep 2020 14:46:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJL4i-00037g-9v for emacs-devel@gnu.org; Fri, 18 Sep 2020 14:25:36 -0400 Original-Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:45343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJL4f-0005QM-PT for emacs-devel@gnu.org; Fri, 18 Sep 2020 14:25:35 -0400 Original-Received: by mail-qk1-x72a.google.com with SMTP id o5so7219782qke.12 for ; Fri, 18 Sep 2020 11:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=G8XaEKYbFbDgQf1M4rnAPIX5u+3y1c1QydkDRWRjwMQ=; b=QeFt9p0hN3jG6bGmBKb7p+qAehLiom2mVHxK9nzNWdWppZdk0lG1zosd7Zl7P4itDn dmiDvkd90XOSRQglboVcS9J0qp/iPG/GjpYMZSU2v8ra5Yev1vbymUz5OZjsj8+vwcQs 2JxoE66Cbnsk5P/bUBoF8Va4qec3Iv2c/C9nYf3ZWInemiQ1WgKi5007PRKGfbIRiI7L v0HjqxOmzx5XDR7Cac552t5brW1b8TPdkvGYgWAHEUr5KBpwogQf7MXnjI0z02Xp5ngL PAskMM1STKAvu+yi2HrZXSzumStbtPpvPMXHt97Yj1FGSTjd78uR/7hVyuCShNHgjLmb GNqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=G8XaEKYbFbDgQf1M4rnAPIX5u+3y1c1QydkDRWRjwMQ=; b=kD1uambtvxLN4Qfu2cag0+ObUx48RJ/ByYIPpJRd+nVylYvHY/Yj44EnWE0ViTMMrG /zGzqS8va6xeCLSb34PREGet1bNiVBbq2IxH5+7QOBXEGeZU3qYehgXxSNTh9mh7tQA/ mGMSllfd0dt383eKZjHTzafvf4qaz5lnrkPNwnw1loyOtJGpsJd+5z1Ph7jfLKY6a0ao OBHppfh3c6MduM1g8lWzHZo0OlW8CUPMQrtaRhZ2fo0XIXipZanQuyeOOO0b9/cUo0zr aL5Nw6siLLxhxABAXpD7e1QU1D3RZ2Z4OK7JznZX00VanE13UvFnE2Hw1xjLbE3b4uTC wdhg== X-Gm-Message-State: AOAM5325dCbAAujDnO1fDmwKRVbcP+gDuW3rm8Js+sa9q7O2wEb24Ace 7MA9jGnfiF4DCdrIwB6nwYXUMYMwpFv2R45j X-Google-Smtp-Source: ABdhPJzMYN8QJ1SLuzdHISQWof5zWf/GHJ+aepxOgs/8D2pyndklFs3eoijUEPF8+DmJDYjiqOJoNg== X-Received: by 2002:a05:620a:15f6:: with SMTP id p22mr34821659qkm.198.1600453527283; Fri, 18 Sep 2020 11:25:27 -0700 (PDT) Original-Received: from ?IPv6:2601:98a:4200:9210:698f:d3dd:778f:8619? ([2601:98a:4200:9210:698f:d3dd:778f:8619]) by smtp.gmail.com with ESMTPSA id 203sm2573321qke.59.2020.09.18.11.25.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2020 11:25:26 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=casouri@gmail.com; helo=mail-qk1-x72a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:256126 Archived-At: > On Sep 16, 2020, at 11:11 PM, Stefan Monnier = wrote: >=20 >> Currently it=E2=80=99s in bookmark.el. It seems to make more sense = to be in simple.el or sub.el. WDYT? >=20 > 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. >=20 > Could you look through our code (e.g. with something like >=20 > grep '(set-buffer-modified-p' **/*.el | grep -v 'd-p \(nil\|t\))' >=20 > ) to see where we could use `with-silent-modifications` and where only > 'with-buffer-modified-unmodified' can be used? >=20 >=20 > Stefan >=20 How should we determine if the extra bindings in = `with-silent-modifications=E2=80=99 aren=E2=80=99t right? In my = understanding `with-silent-modifications=E2=80=99 should only be used = when changing text properties and if you actually insert something you = should use `with-buffer-modified-unmodified=E2=80=99. 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=E2=80=99m not sure if = `with-silent-modifications=E2=80=99 would do any harm anyway. So, uh, maybe subr-x.el? Yuan=