From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#4880: marked as done (point moves in other dired windows) Date: Thu, 12 Nov 2009 22:45:04 +0000 Message-ID: References: <912155b0911060735o6f81038hcc5927f21c119700@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1258065904-31492-0" X-Trace: ger.gmane.org 1258066062 20255 80.91.229.12 (12 Nov 2009 22:47:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Nov 2009 22:47:42 +0000 (UTC) To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 12 23:47:35 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 1N8iRy-0005Df-9n for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Nov 2009 23:47:34 +0100 Original-Received: from localhost ([127.0.0.1]:49839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8iRx-0000Ol-ME for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Nov 2009 17:47:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8iRs-0000OJ-Fw for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2009 17:47:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8iRn-0000MK-39 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2009 17:47:27 -0500 Original-Received: from [199.232.76.173] (port=43758 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8iRm-0000Ly-Hr for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2009 17:47:22 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37418) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N8iRl-0001Ot-Vy for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2009 17:47:22 -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 nACMlID9031829; Thu, 12 Nov 2009 14:47:19 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nACMj4Tj031527; Thu, 12 Nov 2009 14:45:04 -0800 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 4880 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:32579 Archived-At: This is a multi-part message in MIME format... ------------=_1258065904-31492-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Thu, 12 Nov 2009 17:38:51 -0500 with message-id and subject line Re: bug#4880: point moves in other dired windows has caused the Emacs bug report #4880, regarding point moves in other dired windows to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 4880: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D4880 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1258065904-31492-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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. ------------=_1258065904-31492-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 ------------=_1258065904-31492-0--