From per.starback@gmail.com Fri Nov 6 07:35:42 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 6 Nov 2009 15:35:42 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.0 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA6FZfmk028517 for ; Fri, 6 Nov 2009 07:35:42 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6Qqi-0006nD-JE for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 10:35:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6Qqd-0006mH-Ct for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 10:35:39 -0500 Received: from [199.232.76.173] (port=52015 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6Qqd-0006mE-81 for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 10:35:35 -0500 Received: from mail-bw0-f215.google.com ([209.85.218.215]:48493) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N6Qqc-00072C-Ne for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 10:35:35 -0500 Received: by bwz7 with SMTP id 7so1343729bwz.26 for ; Fri, 06 Nov 2009 07:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=2IyxjscXnzAEYUv+5Hf72pf/0sVIP2x3rFwKOyEQ7Z0=; b=xznsjV7apc14M1GUBrLsPHR+6S0MgjpQQjdgg+czLOoZUX3cwZI2GYn5XZawLcv39F QbNRWLx551lop7U0QgON0PGMujN2iQxQpvTpvPawt7IeINnCgvAbJZRzcpxh+mSEP8TD wY+XqOr3zPII/wkHCYkrpkvTFXrjxqb1wx3RM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=UKLltNGECRdhDEHCLqCgoHOJ+ZE4fFLlId02tlc4Aa8jgX9ZPdajTaNch9Q1UE6FBj xNGjomjDUUjot0gxEXKSj1K8mTObnx3ex6NLVx2OOGeFQnp7mfQ8bPfn18aLTHVmomsL ux2m5UDKi8YWF28OzgSiTnAlqScpH2PjfFtB0= MIME-Version: 1.0 Sender: per.starback@gmail.com Received: by 10.223.3.85 with SMTP id 21mr575092fam.98.1257521732510; Fri, 06 Nov 2009 07:35:32 -0800 (PST) Date: Fri, 6 Nov 2009 16:35:32 +0100 X-Google-Sender-Auth: 864f0c4d6f8f1d3c Message-ID: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> Subject: point moves in other dired windows From: =?ISO-8859-1?Q?Per_Starb=E4ck?= To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) I have done this in 23.1 and in the current cvs version: emacs -q /tmp C-x 2 g Point in the *other* window now goes to the beginning of the buffer, which was unexpected for me. dired-revert saves the old point, but only for the current window. The enclosed patch fixes it so that dired-revert saves and restores the point in all windows showing that dired buffer. $ diff -c dired.el.~1.436~ dired.el *** dired.el.~1.436~ 2009-11-06 13:29:08.000000000 +0100 --- dired.el 2009-11-06 15:35:29.000000000 +0100 *************** *** 1103,1110 **** Preserves old cursor, marks/flags, hidden-p." (widen) ; just in case user narrowed (let ((modflag (buffer-modified-p)) ! (opoint (point)) ! (ofile (dired-get-filename nil t)) (mark-alist nil) ; save marked files (hidden-subdirs (dired-remember-hidden)) (old-subdir-alist (cdr (reverse dired-subdir-alist))) ; except pwd --- 1103,1109 ---- Preserves old cursor, marks/flags, hidden-p." (widen) ; just in case user narrowed (let ((modflag (buffer-modified-p)) ! (positions (dired-save-positions)) (mark-alist nil) ; save marked files (hidden-subdirs (dired-remember-hidden)) (old-subdir-alist (cdr (reverse dired-subdir-alist))) ; except pwd *************** *** 1124,1132 **** ;; ... run the hook for the whole buffer, and only after markers ;; have been reinserted (else omitting in dired-x would omit marked files) (run-hooks 'dired-after-readin-hook) ; no need to narrow ! (or (and ofile (dired-goto-file ofile)) ; move cursor to where it ! (goto-char opoint)) ; was before ! (dired-move-to-filename) (save-excursion ; hide subdirs that were hidden (dolist (dir hidden-subdirs) (if (dired-goto-subdir dir) --- 1123,1129 ---- ;; ... run the hook for the whole buffer, and only after markers ;; have been reinserted (else omitting in dired-x would omit marked files) (run-hooks 'dired-after-readin-hook) ; no need to narrow ! (dired-restore-positions positions) (save-excursion ; hide subdirs that were hidden (dolist (dir hidden-subdirs) (if (dired-goto-subdir dir) *************** *** 1140,1145 **** --- 1137,1161 ---- ;; Subroutines of dired-revert ;; Some of these are also used when inserting subdirs. + (defun dired-save-positions () + "Store the current positions in all windows displaying this dired buffer. + Store both filename (if any) and 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)) + (dired-move-to-filename))))) + (defun dired-remember-marks (beg end) "Return alist of files and their marks, from BEG to END." (if selective-display ; must unhide to make this work. From monnier@IRO.UMontreal.CA Thu Nov 12 14:38:56 2009 Received: (at 4880-done) by emacsbugs.donarmstrong.com; 12 Nov 2009 22:38:56 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nACMcrBX031003 for <4880-done@emacsbugs.donarmstrong.com>; Thu, 12 Nov 2009 14:38:55 -0800 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nACMcpso027865; Thu, 12 Nov 2009 17:38:51 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 9F25A3A461; Thu, 12 Nov 2009 17:38:51 -0500 (EST) From: Stefan Monnier To: Per =?iso-8859-1?Q?Starb=E4ck?= Subject: Re: bug#4880: point moves in other dired windows Message-ID: References: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> Date: Thu, 12 Nov 2009 17:38:51 -0500 In-Reply-To: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> ("Per =?iso-8859-1?Q?Starb=E4ck=22's?= message of "Fri, 6 Nov 2009 16:35:32 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3405=0 > dired-revert saves the old point, but only for the current window. The > enclosed patch fixes it so that dired-revert saves and restores the > point in all windows showing that dired buffer. Thank you, installed, Stefan From juri@jurta.org Fri Dec 4 13:50:42 2009 Received: (at 4880) by emacsbugs.donarmstrong.com; 4 Dec 2009 21:50:42 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx2.starman.ee (smtp-out4.starman.ee [85.253.0.6]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB4LoeTu030609 for <4880@emacsbugs.donarmstrong.com>; Fri, 4 Dec 2009 13:50:42 -0800 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Received: from mail.starman.ee (82.131.30.133.cable.starman.ee [82.131.30.133]) by mx2.starman.ee (Postfix) with ESMTP id 50F863F4108; Fri, 4 Dec 2009 23:50:34 +0200 (EET) From: Juri Linkov To: Stefan Monnier Cc: Per =?iso-8859-1?Q?Starb=E4ck?= , 4880@debbugs.gnu.org Subject: Re: bug#4880: point moves in other dired windows Organization: JURTA References: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> <87d42v8vhe.fsf@mail.jurta.org> Date: Fri, 04 Dec 2009 23:49:28 +0200 In-Reply-To: <87d42v8vhe.fsf@mail.jurta.org> (Juri Linkov's message of "Fri, 04 Dec 2009 01:54:05 +0200") Message-ID: <87k4x2xyd6.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Unfortunately, this doesn't work for dired buffers that are > not displayed in a window. This is a really annoying problem. What about the following patch that also restores buffer's point positions after dired-revert in hidden dired buffers? Index: lisp/dired.el =================================================================== RCS file: /sources/emacs/emacs/lisp/dired.el,v retrieving revision 1.446 diff -c -r1.446 dired.el *** lisp/dired.el 4 Dec 2009 05:00:44 -0000 1.446 --- lisp/dired.el 4 Dec 2009 21:49:19 -0000 *************** *** 1143,1161 **** ;; 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)) --- 1170,1211 ---- ;; Some of these are also used when inserting subdirs. (defun dired-save-positions () ! "Return the current positions in all buffers and windows with this directory. ! The positions have the form (BUFFER-POSITIONS WINDOW-POSITIONS). ! ! BUFFER-POSITIONS are positions in all dired buffers associated with ! the current directory. The buffer positions have the form (BUFFER ! 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 ! (mapcar (lambda (buffer) ! (cons buffer ! (with-current-buffer buffer ! (list ! (dired-get-filename nil t) ! (point))))) ! (dired-buffers-for-dir ! (if (consp dired-directory) (car dired-directory) dired-directory))) ! (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 (buf-file-pos (nth 0 positions)) ! (with-current-buffer (nth 0 buf-file-pos) ! (unless (and (nth 1 buf-file-pos) ! (dired-goto-file (nth 1 buf-file-pos))) ! (goto-char (nth 2 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/ From monnier@iro.umontreal.ca Fri Dec 4 21:00:55 2009 Received: (at 4880) by emacsbugs.donarmstrong.com; 5 Dec 2009 05:00:55 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB550rNr005123 for <4880@emacsbugs.donarmstrong.com>; Fri, 4 Dec 2009 21:00:55 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAGJ3GUtFpZ7i/2dsb2JhbACBTNQrhDMEihw X-IronPort-AV: E=Sophos;i="4.47,346,1257138000"; d="scan'208";a="50733869" Received: from 69-165-158-226.dsl.teksavvy.com (HELO ceviche.home) ([69.165.158.226]) by ironport2-out.pppoe.ca with ESMTP; 05 Dec 2009 00:00:47 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 53F8D70213; Sat, 5 Dec 2009 00:00:47 -0500 (EST) From: Stefan Monnier To: Juri Linkov Cc: Per =?iso-8859-1?Q?Starb=E4ck?= , 4880@debbugs.gnu.org Subject: Re: bug#4880: point moves in other dired windows Message-ID: References: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> <87d42v8vhe.fsf@mail.jurta.org> <87k4x2xyd6.fsf@mail.jurta.org> Date: Sat, 05 Dec 2009 00:00:47 -0500 In-Reply-To: <87k4x2xyd6.fsf@mail.jurta.org> (Juri Linkov's message of "Fri, 04 Dec 2009 23:49:28 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > ! (list > ! (mapcar (lambda (buffer) > ! (cons buffer > ! (with-current-buffer buffer > ! (list > ! (dired-get-filename nil t) > ! (point))))) > ! (dired-buffers-for-dir > ! (if (consp dired-directory) (car dired-directory) dired-directory))) > ! (mapcar (lambda (w) > ! (list w > ! (with-selected-window w > ! (dired-get-filename nil t)) > ! (window-point w))) > ! (get-buffer-window-list nil 0 t)))) 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)? Stefan From juri@jurta.org Sat Dec 5 11:52:42 2009 Received: (at 4880) by emacsbugs.donarmstrong.com; 5 Dec 2009 19:52:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 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) From: Juri Linkov To: Stefan Monnier Cc: Per =?iso-8859-1?Q?Starb=E4ck?= , 4880@debbugs.gnu.org Subject: Re: bug#4880: point moves in other dired windows Organization: JURTA References: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> <87d42v8vhe.fsf@mail.jurta.org> <87k4x2xyd6.fsf@mail.jurta.org> Date: Sat, 05 Dec 2009 21:42:16 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 05 Dec 2009 00:00:47 -0500") Message-ID: <87vdglctrb.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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/ From monnier@iro.umontreal.ca Sat Dec 5 13:09:38 2009 Received: (at 4880) by emacsbugs.donarmstrong.com; 5 Dec 2009 21:09:38 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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" 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 Received: by pastel.home (Postfix, from userid 20848) id DB21280B1; Sat, 5 Dec 2009 16:09:30 -0500 (EST) From: Stefan Monnier To: Juri Linkov Cc: Per =?iso-8859-1?Q?Starb=E4ck?= , 4880@debbugs.gnu.org Subject: Re: bug#4880: point moves in other dired windows Message-ID: References: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> <87d42v8vhe.fsf@mail.jurta.org> <87k4x2xyd6.fsf@mail.jurta.org> <87vdglctrb.fsf@mail.jurta.org> Date: Sat, 05 Dec 2009 16:09:30 -0500 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) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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 From juri@jurta.org Sat Dec 5 15:24:28 2009 Received: (at 4880) by emacsbugs.donarmstrong.com; 5 Dec 2009 23:24:28 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx2.starman.ee (smtp-out4.starman.ee [85.253.0.6]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB5NORjH015345 for <4880@emacsbugs.donarmstrong.com>; Sat, 5 Dec 2009 15:24:28 -0800 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Received: from mail.starman.ee (82.131.97.127.cable.starman.ee [82.131.97.127]) by mx2.starman.ee (Postfix) with ESMTP id 20E7E3F40AA; Sun, 6 Dec 2009 01:24:21 +0200 (EET) From: Juri Linkov To: Stefan Monnier Cc: Per =?iso-8859-1?Q?Starb=E4ck?= , 4880@debbugs.gnu.org Subject: Re: bug#4880: point moves in other dired windows Organization: JURTA References: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> <87d42v8vhe.fsf@mail.jurta.org> <87k4x2xyd6.fsf@mail.jurta.org> <87vdglctrb.fsf@mail.jurta.org> Date: Sun, 06 Dec 2009 01:22:19 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 05 Dec 2009 16:09:30 -0500") Message-ID: <87iqcl57mc.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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. Done. -- Juri Linkov http://www.jurta.org/emacs/ From unknown Fri Jun 20 07:19:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 29 Jan 2010 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator