unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juri Linkov <juri@jurta.org>
Cc: 4880@emacsbugs.donarmstrong.com, "Per Starbäck" <per@starback.se>
Subject: bug#4880: point moves in other dired windows
Date: Sat, 05 Dec 2009 16:09:30 -0500	[thread overview]
Message-ID: <jwvvdglm8q9.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <87vdglctrb.fsf@mail.jurta.org> (Juri Linkov's message of "Sat, 05 Dec 2009 21:42:16 +0200")

> 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





  reply	other threads:[~2009-12-05 21:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwv639fs71y.fsf-monnier+emacsbugreports@gnu.org>
2009-11-06 15:35 ` bug#4880: point moves in other dired windows Per Starbäck
2009-11-12 22:45   ` bug#4880: marked as done (point moves in other dired windows) Emacs bug Tracking System
     [not found] ` <87d42v8vhe.fsf@mail.jurta.org>
2009-12-04 21:49   ` bug#4880: point moves in other dired windows Juri Linkov
2009-12-05  5:00     ` Stefan Monnier
2009-12-05 19:42       ` Juri Linkov
2009-12-05 21:09         ` Stefan Monnier [this message]
2009-12-05 23:22           ` Juri Linkov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvvdglm8q9.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=4880@emacsbugs.donarmstrong.com \
    --cc=juri@jurta.org \
    --cc=per@starback.se \
    /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 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).