From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bill Sacks Newsgroups: gmane.emacs.bugs Subject: bug#56397: 28.1; Incorrect behavior of buffer-modified-p after undo in indirect buffer Date: Tue, 5 Jul 2022 07:24:29 -0600 Message-ID: <08ce3b7e-2f84-795e-9f11-a3b1d1fc83a0@ucar.edu> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------257213C7298B52A9C315EE1A" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28625"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:52.0) Gecko/20100101 PostboxApp/7.0.56 To: 56397@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 05 15:25:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1o8iYD-0007Fk-9B for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 15:25:13 +0200 Original-Received: from localhost ([::1]:59322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8iYB-00006a-Sn for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 09:25:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8iY3-00006Q-1E for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 09:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55793) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8iY2-0001xN-Ol for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 09:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8iY2-0004pL-LK for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 09:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bill Sacks Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jul 2022 13:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56397 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165702748018517 (code B ref -1); Tue, 05 Jul 2022 13:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jul 2022 13:24:40 +0000 Original-Received: from localhost ([127.0.0.1]:49690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8iXf-0004ob-OO for submit@debbugs.gnu.org; Tue, 05 Jul 2022 09:24:40 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8iXc-0004oS-Q0 for submit@debbugs.gnu.org; Tue, 05 Jul 2022 09:24:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8iXc-0008W8-KG for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 09:24:36 -0400 Original-Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:35650) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8iXZ-0001vC-Rj for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 09:24:36 -0400 Original-Received: by mail-io1-xd33.google.com with SMTP id y18so11064362iof.2 for ; Tue, 05 Jul 2022 06:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucar-edu.20210112.gappssmtp.com; s=20210112; h=to:subject:from:message-id:date:user-agent:mime-version :content-language; bh=S5nuqp1cT5EBRRHy3retWE7BudD+AWRct2LM9kvdWdI=; b=lgo4DJnLfSfjxjjdgTWfouTgg5qBl1EuwEBpsRwQZ+meZ6m/m2K87E6T2iT6O8iURq yr5yxjHia4h4HjRGyPryF8LONZfYKFQ9sjg/R7fYchPNF14etGEJdywV+XKH22lJKU60 NX4ApVWNYIew9yD+QpUP4qsfM+Nv2eGccvpcIUHk68U8tmrsh/niNtsDdkoaN8ELjekS FcmDpWDKPPsKKvps3JITgC+y/OcuuKJoW8w/oj9oZ4thXc+K/qHs4sTdJ7dH+ajWKvNL NqY4sHvvMYqCIoP71I0X/5UiAXKMC+ovV4l6DSe1fJrha0eEqZQSCmbZtTcf+wtNVebw FvDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:subject:from:message-id:date:user-agent :mime-version:content-language; bh=S5nuqp1cT5EBRRHy3retWE7BudD+AWRct2LM9kvdWdI=; b=r01ocmRGXIPAYB4a+cdT8Mr1HfibTAv6rl3F9Qi2FHEs1FdaqFOy9y7yjO0qlUfnCZ AzS0ujqtWp46ZLZ9ZdMFdBzhPM2PeZBgltOOwU9P3GDPEC5Aa74A49O8jgDI1/KnEJoq FvJ0Pl7C/l2hAquE5IxWDwH2ZWLknyjwvYObEgZbarj8up3OyRYsgBzfzad7X6cqd/5V +kCyypYgURzPAah1oebOr0KIrunVfGOP7JrusNensZkFlqTq8QUVlHXQFiuGrsxN1oOT luyjvtt6fQQPpvEIpev4SVpgLzAfLo7cMdf/1h0GYgkJncIY7kDzxsEwLHmvFy+z7De+ LirA== X-Gm-Message-State: AJIora+Qig/t0saYOZmMkPTBA3VWPwoQVbFhuhYV1JV56B+0U3B7aQoq 0BZB5NA+qIwta8zwUzEUs5kUl+FqRwcbjGKVZdICXzUNZJaSfplOUsNC1FOw38gvAhoWrcCEYOl byxyKIiM+EcrLec7IRFFDzszAOM4soDWm1a24AjQYRWR4Pn/zAL8NmlY+L8rauPDl X-Google-Smtp-Source: AGRyM1s+B7FQhYxLrvKSnkji2mA03xGzNSGYOcA+MCFG9IWanjKgo1B94T/C2IwfmT/uFXz/3pjF5w== X-Received: by 2002:a6b:5803:0:b0:674:fd08:13b7 with SMTP id m3-20020a6b5803000000b00674fd0813b7mr18903783iob.160.1657027471737; Tue, 05 Jul 2022 06:24:31 -0700 (PDT) Original-Received: from [192.168.0.79] (97-118-158-229.hlrn.qwest.net. [97.118.158.229]) by smtp.gmail.com with ESMTPSA id r19-20020a02c853000000b00339dfb793aesm14803577jao.86.2022.07.05.06.24.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jul 2022 06:24:31 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::d33; envelope-from=sacks@ucar.edu; helo=mail-io1-xd33.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236117 Archived-At: This is a multi-part message in MIME format. --------------257213C7298B52A9C315EE1A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit When working in a cloned indirect buffer, if I type something then save the buffer then undo my changes, buffer-modified-p returns nil and I am not able to save the version with these changes undone. Steps to reproduce: 1. Create a text buffer with some text in it (e.g., test.txt) and save it 2. Clone the buffer with M-x clone-indirect-buffer 3. Type some more text into the indirect buffer (e.g., test.txt<2>) and save it with C-x C-s 4. While still in the indirect buffer, undo the text entered in (3) with C-/ until the buffer has returned to the state at the start of (3) 5. Notice that (buffer-modified-p) returns nil. Attempting to save the buffer gives the message "(No changes need to be saved)". However, viewing the file on disk shows that it is still at the state from the end of (3). This is using emacs installed via homebrew with: brew tap d12frosted/emacs-plus brew install emacs-plus --with-native-comp In GNU Emacs 28.1 (build 2, aarch64-apple-darwin21.5.0, NS appkit-2113.50 Version 12.4 (Build 21F79)) of 2022-06-20 built on cgdm-green.local Windowing system distributor 'Apple', version 10.3.2113 System Description: macOS 12.4 Configured using: 'configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs-plus@28/28.1/share/info/emacs --prefix=/opt/homebrew/Cellar/emacs-plus@28/28.1 --with-xml2 --with-gnutls --with-native-compilation --without-dbus --without-imagemagick --with-modules --with-rsvg --with-ns --disable-ns-self-contained 'CFLAGS=-Os -w -pipe -mmacosx-version-min=12 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk' 'CPPFLAGS=-I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/icu4c/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/libffi/include -isystem/opt/homebrew/include -F/opt/homebrew/Frameworks -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk' 'LDFLAGS=-L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/icu4c/lib -L/opt/homebrew/opt/sqlite/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/libffi/lib -L/opt/homebrew/lib -F/opt/homebrew/Frameworks -Wl,-headerpad_max_install_names -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk'' Configured features: ACL GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils vc-dispatcher vc-svn iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 68991 8497) (symbols 48 6697 0) (strings 32 19792 2373) (string-bytes 1 682174) (vectors 16 14103) (vector-slots 8 305273 10795) (floats 8 28 36) (intervals 56 264 0) (buffers 992 14)) --------------257213C7298B52A9C315EE1A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit When working in a cloned indirect buffer, if I type something then save the buffer then undo my changes, buffer-modified-p returns nil and I am not able to save the version with these changes undone.

Steps to reproduce:

1. Create a text buffer with some text in it (e.g., test.txt) and save it
2. Clone the buffer with M-x clone-indirect-buffer
3. Type some more text into the indirect buffer (e.g., test.txt<2>) and save it with C-x C-s
4. While still in the indirect buffer, undo the text entered in (3) with C-/ until the buffer has returned to the state at the start of (3)
5. Notice that (buffer-modified-p) returns nil. Attempting to save the buffer gives the message "(No changes need to be saved)". However, viewing the file on disk shows that it is still at the state from the end of (3).

This is using emacs installed via homebrew with:
brew tap d12frosted/emacs-plus
brew install emacs-plus --with-native-comp

In GNU Emacs 28.1 (build 2, aarch64-apple-darwin21.5.0, NS appkit-2113.50 Version 12.4 (Build 21F79))
of 2022-06-20 built on cgdm-green.local
Windowing system distributor 'Apple', version 10.3.2113
System Description: macOS 12.4

Configured using:
'configure --disable-dependency-tracking --disable-silent-rules
--enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
--infodir=/opt/homebrew/Cellar/emacs-plus@28/28.1/share/info/emacs
--prefix=/opt/homebrew/Cellar/emacs-plus@28/28.1 --with-xml2
--with-gnutls --with-native-compilation --without-dbus
--without-imagemagick --with-modules --with-rsvg --with-ns
--disable-ns-self-contained 'CFLAGS=-Os -w -pipe
-mmacosx-version-min=12
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk'
'CPPFLAGS=-I/opt/homebrew/opt/zlib/include
-I/opt/homebrew/opt/icu4c/include -I/opt/homebrew/opt/sqlite/include
-I/opt/homebrew/opt/openssl@1.1/include
-I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/libffi/include
-isystem/opt/homebrew/include -F/opt/homebrew/Frameworks
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk'
'LDFLAGS=-L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/icu4c/lib
-L/opt/homebrew/opt/sqlite/lib -L/opt/homebrew/opt/openssl@1.1/lib
-L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/libffi/lib
-L/opt/homebrew/lib -F/opt/homebrew/Frameworks
-Wl,-headerpad_max_install_names
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk''

Configured features:
ACL GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY
KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM ZLIB

Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
vc-dispatcher vc-svn iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads kqueue cocoa ns lcms2
multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 68991 8497)
(symbols 48 6697 0)
(strings 32 19792 2373)
(string-bytes 1 682174)
(vectors 16 14103)
(vector-slots 8 305273 10795)
(floats 8 28 36)
(intervals 56 264 0)
(buffers 992 14))

--------------257213C7298B52A9C315EE1A--