all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Juri Linkov <juri@linkov.net>
Cc: 33458@debbugs.gnu.org
Subject: bug#33458: 27.0.50; dired loses position when reverted from outside place
Date: Wed, 26 Dec 2018 10:42:40 +0100	[thread overview]
Message-ID: <5C234D10.6070609@gmx.at> (raw)
In-Reply-To: <87muotnvsa.fsf@mail.linkov.net>

 > Oh, I see now why this case fails:
 >
 > (let ((_ (view-emacs-todo))
 >        (w-c (current-window-configuration)))
 >    (view-emacs-news)
 >    (set-window-configuration w-c)
 >    (previous-buffer))
 >
 > I expected it not to change prev/next buffers of the window
 > saved in the window configuration, so the expectation for the
 > last call to 'previous-buffer' was to return from the TODO buffer
 > to the original buffer *scratch*.  But since the NEWS buffer
 > meddled with the same window, this is not the case.

A window configuration is a state, a snapshot at some given instant of
time.  A window's previous buffers are a history, a sequence of statse
over a certain period of time.  What you want to do is freeze history.
We could do that by making a copy of all windows' previous and next
buffers, storing those lists in separate variables and restoring them
from there.

But note that any such change might mess up the partial ordering of
events on your system.  The relative positions of buffers in a frame's
buffer list would be incongruent with their positions in the buffer
lists of that frame's windows.  A new buffer you switched to while the
present configuration was saved and not yet restored would appear in
its frame's buffer list but not in that of any of the frame's windows.
This would imply that all windows of the frame were created after the
buffer was shown.

So I think you should first reconsider any such behavior.  Eliding
things from history "as if they never happened" is often a bad thing
(although I wish Emacs' 'undo' could do that occasionally).  And if we
wanted to implement it we would have to make it customizable.  Hence
any package would have to cater for both ways of seeing the history of
buffers in a window.

 > This is why any code that saves window configurations has to care
 > about creating a new window after the current-window-configuration
 > call (thus removing the window saved in the window configuration),
 > like I fixed now in https://gitlab.com/link0ff/emacs-wincows/commit/226cf229

Restoring the window configuration would remove the window.  What else
would you want to do with it?

BTW, window parameters have to be made persistent in order to make
them replace current ones when restoring a window configuration.

martin





  reply	other threads:[~2018-12-26  9:42 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 20:40 bug#33458: 27.0.50; dired loses position when reverted from outside place v88m
2018-11-21 22:33 ` Stephen Berman
2018-11-22  9:07   ` v88m
2018-11-22  9:38     ` Stephen Berman
2018-11-23  7:41     ` martin rudalics
2018-11-23 15:40       ` v88m
2018-11-23 19:03         ` martin rudalics
2018-11-23 19:55           ` v88m
2018-11-25 20:45           ` Juri Linkov
2018-11-26  9:32             ` martin rudalics
2018-11-27  0:09               ` Juri Linkov
2018-11-27  8:08                 ` martin rudalics
2018-11-28  0:06                   ` Juri Linkov
2018-11-28  8:35                     ` martin rudalics
2018-11-28 23:45                       ` Juri Linkov
2018-11-29  7:41                         ` Eli Zaretskii
2018-11-29 22:33                           ` Juri Linkov
2018-11-30  7:05                             ` v88m
2018-12-01 22:33                               ` Juri Linkov
2018-11-30  8:21                             ` martin rudalics
2018-11-29  8:31                         ` martin rudalics
2018-11-29 22:46                           ` Juri Linkov
2018-11-30  7:10                             ` v88m
2018-11-30  8:22                               ` martin rudalics
2018-11-30  8:21                             ` martin rudalics
2018-12-01 22:30                               ` Juri Linkov
2018-12-02  8:33                                 ` martin rudalics
2018-12-04  8:33 ` martin rudalics
2018-12-04 14:41   ` v88m
2018-12-05  9:17     ` martin rudalics
2018-12-08  9:41       ` martin rudalics
2018-12-10  0:10         ` Juri Linkov
2018-12-10  7:58           ` martin rudalics
2018-12-10 23:59             ` Juri Linkov
2018-12-11  8:34               ` martin rudalics
2018-12-12  0:40                 ` Juri Linkov
2018-12-12  8:32                   ` martin rudalics
2018-12-12 23:29                     ` Juri Linkov
2018-12-13  9:02                       ` martin rudalics
2018-12-14  9:33                         ` martin rudalics
2018-12-16 23:49                           ` Juri Linkov
2018-12-17  8:06                             ` martin rudalics
2018-12-18  0:25                               ` Juri Linkov
2018-12-18  8:28                                 ` martin rudalics
2018-12-21  0:59                                   ` Juri Linkov
2018-12-21  9:15                                     ` martin rudalics
2018-12-22 23:36                                       ` Juri Linkov
2018-12-23  9:40                                         ` martin rudalics
2018-12-23 19:06                                           ` martin rudalics
2018-12-23 23:47                                             ` Juri Linkov
2018-12-24  8:15                                               ` martin rudalics
2018-12-25 21:25                                                 ` Juri Linkov
2018-12-26  9:42                                                   ` martin rudalics [this message]
2018-12-27  0:29                                                     ` Juri Linkov
2018-12-27  9:37                                                       ` martin rudalics
2020-08-22 14:49                                                         ` Lars Ingebrigtsen
2020-08-23 18:42                                                           ` Juri Linkov
2020-08-24 13:15                                                             ` Lars Ingebrigtsen
2018-12-13  7:39   ` v88m
2018-12-13  9:02     ` martin rudalics
2018-12-13  9:35       ` v88m
2018-12-13 10:10         ` martin rudalics
2018-12-14  8:25           ` v88m
2018-12-14  9:34             ` martin rudalics
2018-12-14 10:01               ` v88m

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5C234D10.6070609@gmx.at \
    --to=rudalics@gmx.at \
    --cc=33458@debbugs.gnu.org \
    --cc=juri@linkov.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.