GNU TeXmacs - Bugs: bug #61418, Potential data loss without...
You are not allowed to post comments on this tracker with your current authentication level.
bug #61418: Potential data loss without warning after opening my-init-texmacs.scm
Submitter: | Jeroen Wouters <jeronim> | ||
Submitted: | Wed 03 Nov 2021 02:42:46 PM UTC | ||
Category: | None | Priority: | 5 - Normal |
Item Group: | Error | Status: | Confirmed |
Privacy: | Public | Assigned to: | mgubi |
Originator Name: | Open/Closed: | Open | |
Release: | None | Release: | 2.1 |
Fixed Release: | None | Fixed Release: | |
Keywords: |
Mon 06 Dec 2021 11:15:25 PM UTC, comment #3: |
Jeroen Wouters <jeronim>![]() |
Mon 06 Dec 2021 12:44:37 PM UTC, comment #2: I've done some testing and this seems to have been introduced in svn revision 13417 (git commit 7e010d0e0bc1e8d76509b49585668e51b681e159) "New attempt to fix bug #59996: New documents are sometimes created with "no-style"". |
Jeroen Wouters <jeronim>![]() |
Tue 09 Nov 2021 04:59:59 PM UTC, comment #1: The bug does not occur when using the 'Emacs' look and feel and 'Multiple documents share window', but it does occur with the default settings under MacOS.
|
Joris van der Hoeven <vdhoeven>![]() |
Wed 03 Nov 2021 02:42:46 PM UTC, original submission:
The following sequence allows closing unsaved work without being warned of potential data loss:
|
Jeroen Wouters <jeronim>![]() |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 2 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2021-11-09 | vdhoeven | Status | None | ![]() |
Confirmed |
Assigned to | None | ![]() |
mgubi |
The unsaved, modified buffer is erroneously marked as saved by `(buffer-pretend-saved (current-buffer)))` in `buffer-set-default-style` (file TeXmacs/progs/texmacs/texmacs/tm-files.scm).
The reason this function is called is because `(cpp-buffer-close)` is called when another window is closed, which calls `kill_buffer` and `get_new_view` (in src/Texmacs/Data/new_window.cpp). This in turn runs `init-buffer.scm`, which calls `buffer-set-default-style`.
In summary, the sequence of function calls leading to this is:
(cpp-buffer-close)
-> kill_buffer
-> get_new_view
-> init-buffer.scm
-> buffer-set-default-style
-> buffer-pretend-saved
After opening and closing a new window, we end up with two views on the unsaved modified buffer, which can be checked by doing (buffer->views (current-buffer)) before and after.
I believe this shouldn't be the case and that kill_buffer shouldn't open a new view when the buffer is already opened in another window. Is this interpretation correct?