From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#4880: point moves in other dired windows Date: Sat, 05 Dec 2009 21:42:16 +0200 Organization: JURTA Message-ID: <87vdglctrb.fsf@mail.jurta.org> References: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> <87d42v8vhe.fsf@mail.jurta.org> <87k4x2xyd6.fsf@mail.jurta.org> Reply-To: Juri Linkov , 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 1260043716 27352 80.91.229.12 (5 Dec 2009 20:08:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Dec 2009 20:08:36 +0000 (UTC) Cc: 4880@emacsbugs.donarmstrong.com, Per =?UTF-8?Q?Starb=C3=A4ck?= To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 05 21:08:29 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 1NH0vb-0004R8-8B for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2009 21:08:27 +0100 Original-Received: from localhost ([127.0.0.1]:43422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NH0va-0003h5-VC for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2009 15:08:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NH0ul-00038X-5w for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 15:07:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NH0uf-00034x-Vj for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 15:07:34 -0500 Original-Received: from [199.232.76.173] (port=50174 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NH0uf-00034o-SR for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 15:07:29 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:54793) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NH0uf-00040r-2U for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 15:07:29 -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 nB5K7POI024448; Sat, 5 Dec 2009 12:07:26 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB5Jt9nD022463; Sat, 5 Dec 2009 11:55:09 -0800 Resent-Date: Sat, 5 Dec 2009 11:55:09 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Juri Linkov Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sat, 05 Dec 2009 19:55:08 +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.126004276322232 (code B ref 4880); Sat, 05 Dec 2009 19:55:08 +0000 Original-Received: (at 4880) by emacsbugs.donarmstrong.com; 5 Dec 2009 19:52:43 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx1.starman.ee (smtp-out3.starman.ee [85.253.0.5]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB5Jqfe2022225 for <4880@emacsbugs.donarmstrong.com>; Sat, 5 Dec 2009 11:52:42 -0800 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.97.127.cable.starman.ee [82.131.97.127]) by mx1.starman.ee (Postfix) with ESMTP id BDF1B3F424D; Sat, 5 Dec 2009 21:52:34 +0200 (EET) In-Reply-To: (Stefan Monnier's message of "Sat, 05 Dec 2009 00:00:47 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 05 Dec 2009 15:07:34 -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:33260 Archived-At: > I do not understand, why we save the point of all > "dired-buffers-for-dir" but only the point of the windows showing the > current buffer. > I'd prefer to resolve this discrepancy by only saving the current > buffer's point (after all, the other buffer's won't be affected by the > revert, right)? Since other buffers of the same dir won't be reverted, then yes, there is no point in saving their points. Index: lisp/dired.el =================================================================== RCS file: /sources/emacs/emacs/lisp/dired.el,v retrieving revision 1.447 diff -c -r1.447 dired.el *** lisp/dired.el 4 Dec 2009 21:45:34 -0000 1.447 --- lisp/dired.el 5 Dec 2009 19:39:39 -0000 *************** *** 1169,1187 **** ;; Some of these are also used when inserting subdirs. (defun dired-save-positions () ! "Return the current positions in all windows displaying this dired buffer. ! The positions have the form (WINDOW FILENAME POINT)." ! (mapcar (lambda (w) ! (list w ! (with-selected-window w ! (dired-get-filename nil t)) ! (window-point w))) ! (get-buffer-window-list nil 0 t))) (defun dired-restore-positions (positions) "Restore POSITIONS saved with `dired-save-positions'." ! (dolist (win-file-pos positions) ! (with-selected-window (car 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)) --- 1169,1201 ---- ;; Some of these are also used when inserting subdirs. (defun dired-save-positions () ! "Return current positions in the buffer and all windows with this directory. ! The positions have the form (BUFFER-POSITION WINDOW-POSITIONS). ! ! BUFFER-POSITION is the point position in the current dired buffer. ! The buffer position have the form (DIRED-FILENAME BUFFER-POINT). ! ! WINDOW-POSITIONS are current positions in all windows displaying ! this dired buffer. The window positions have the form (WINDOW ! DIRED-FILENAME WINDOW-POINT)." ! (list ! (list (dired-get-filename nil t) (point)) ! (mapcar (lambda (w) ! (list w ! (with-selected-window w ! (dired-get-filename nil t)) ! (window-point w))) ! (get-buffer-window-list nil 0 t)))) (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)) -- Juri Linkov http://www.jurta.org/emacs/