[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#4880: point moves in other dired windows
From: |
Stefan Monnier |
Subject: |
bug#4880: point moves in other dired windows |
Date: |
Sat, 05 Dec 2009 16:09:30 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
> Since other buffers of the same dir won't be reverted, then yes,
> there is no point in saving their points.
That looks good, thanks. Just one more thing:
> (defun dired-restore-positions (positions)
> "Restore POSITIONS saved with `dired-save-positions'."
> ! (let ((buf-file-pos (nth 0 positions)))
> ! (unless (and (nth 0 buf-file-pos)
> ! (dired-goto-file (nth 0 buf-file-pos)))
> ! (goto-char (nth 1 buf-file-pos))
> ! (dired-move-to-filename)))
> ! (dolist (win-file-pos (nth 1 positions))
> ! (with-selected-window (nth 0 win-file-pos)
> (unless (and (nth 1 win-file-pos)
> (dired-goto-file (nth 1 win-file-pos)))
> (goto-char (nth 2 win-file-pos))
In restore, we should check that the window's buffer is still "our
buffer". In some rare occasions, revert-buffer may cause some prompt or
other thing that may change some window's configuration, so better be
safe than sorry.
I know this is not a new problem in your code, but while we're here, can
you fix this other one as well (and then commit)?
Stefan