From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#4880: point moves in other dired windows Date: Sat, 05 Dec 2009 16:09:30 -0500 Message-ID: References: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> <87d42v8vhe.fsf@mail.jurta.org> <87k4x2xyd6.fsf@mail.jurta.org> <87vdglctrb.fsf@mail.jurta.org> Reply-To: Stefan Monnier , 4880@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260048545 7919 80.91.229.12 (5 Dec 2009 21:29:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Dec 2009 21:29:05 +0000 (UTC) Cc: 4880@emacsbugs.donarmstrong.com, Per =?UTF-8?Q?Starb=C3=A4ck?= To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 05 22:28:57 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NH2BV-0000rM-AD for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2009 22:28:57 +0100 Original-Received: from localhost ([127.0.0.1]:38835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NH2BV-0006ue-2X for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2009 16:28:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NH2AI-00063n-KI for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 16:27:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NH2AA-0005wr-PF for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 16:27:39 -0500 Original-Received: from [199.232.76.173] (port=52190 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NH2AA-0005wW-H5 for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 16:27:34 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37771) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NH2AA-00038W-0X for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 16:27:34 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB5LRPY8001791; Sat, 5 Dec 2009 13:27:31 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB5LF6bS000392; Sat, 5 Dec 2009 13:15:06 -0800 Resent-Date: Sat, 5 Dec 2009 13:15:06 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sat, 05 Dec 2009 21:15:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4880 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4880-submit@emacsbugs.donarmstrong.com id=B4880.126004737832237 (code B ref 4880); Sat, 05 Dec 2009 21:15:06 +0000 Original-Received: (at 4880) by emacsbugs.donarmstrong.com; 5 Dec 2009 21:09:38 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.183]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB5L9aVh032229 for <4880@emacsbugs.donarmstrong.com>; Sat, 5 Dec 2009 13:09:38 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4EALpaGktFpZ7i/2dsb2JhbACBS9J/hDMEih4 X-IronPort-AV: E=Sophos;i="4.47,347,1257138000"; d="scan'208";a="50759148" Original-Received: from 69-165-158-226.dsl.teksavvy.com (HELO pastel.home) ([69.165.158.226]) by ironport2-out.pppoe.ca with ESMTP; 05 Dec 2009 16:09:31 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id DB21280B1; Sat, 5 Dec 2009 16:09:30 -0500 (EST) In-Reply-To: <87vdglctrb.fsf@mail.jurta.org> (Juri Linkov's message of "Sat, 05 Dec 2009 21:42:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 05 Dec 2009 16:27:39 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33282 Archived-At: > 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