unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56397: 28.1; Incorrect behavior of buffer-modified-p after undo in indirect buffer
@ 2022-07-05 13:24 Bill Sacks
  2022-07-07  8:59 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Bill Sacks @ 2022-07-05 13:24 UTC (permalink / raw)
  To: 56397

[-- Attachment #1: Type: text/plain, Size: 4784 bytes --]

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))


[-- Attachment #2: Type: text/html, Size: 5490 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#56397: 28.1; Incorrect behavior of buffer-modified-p after undo in indirect buffer
  2022-07-05 13:24 bug#56397: 28.1; Incorrect behavior of buffer-modified-p after undo in indirect buffer Bill Sacks
@ 2022-07-07  8:59 ` Eli Zaretskii
       [not found]   ` <431108d4-b611-10fe-fddf-0b3749069858@ucar.edu>
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2022-07-07  8:59 UTC (permalink / raw)
  To: Bill Sacks; +Cc: 56397

> From: Bill Sacks <sacks@ucar.edu>
> Date: Tue, 5 Jul 2022 07:24:29 -0600
> 
> 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).

Thanks, I think I've now fixed this on the master branch.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#56397: 28.1; Incorrect behavior of buffer-modified-p after undo in indirect buffer
       [not found]   ` <431108d4-b611-10fe-fddf-0b3749069858@ucar.edu>
@ 2022-07-07 13:48     ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2022-07-07 13:48 UTC (permalink / raw)
  To: Bill Sacks; +Cc: 56397-done

> From: Bill Sacks <sacks@ucar.edu>
> Date: Thu, 7 Jul 2022 07:30:06 -0600
> 
> Thank you very much for this – and for all of your work to make emacs great!

You are welcome.

I'm therefore closing the bug.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-07 13:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05 13:24 bug#56397: 28.1; Incorrect behavior of buffer-modified-p after undo in indirect buffer Bill Sacks
2022-07-07  8:59 ` Eli Zaretskii
     [not found]   ` <431108d4-b611-10fe-fddf-0b3749069858@ucar.edu>
2022-07-07 13:48     ` Eli Zaretskii

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).