From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#27243: closed (Re: bug#27243: dired-auto-revert-buffer jumps point to beginning of buffer) Date: Mon, 17 Jul 2017 11:22:46 +0200 Message-ID: <87379vwh7d.fsf@rosalinde> References: <83d1ac6yih.fsf@gnu.org> <87shjf48se.fsf@epsilon> <87r2yizu66.fsf@beta> <87bmpm20zt.fsf@rosalinde> <87zicd1pfy.fsf@beta> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500283406 18200 195.159.176.226 (17 Jul 2017 09:23:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Jul 2017 09:23:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 27243@debbugs.gnu.org To: Antoine Levitt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 17 11:23:21 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX2FF-0003tw-Me for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Jul 2017 11:23:13 +0200 Original-Received: from localhost ([::1]:48957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX2FI-0007i3-2s for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Jul 2017 05:23:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX2F9-0007hi-1Y for bug-gnu-emacs@gnu.org; Mon, 17 Jul 2017 05:23:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX2F4-0008BX-3a for bug-gnu-emacs@gnu.org; Mon, 17 Jul 2017 05:23:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40536) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dX2F3-0008BR-Vr for bug-gnu-emacs@gnu.org; Mon, 17 Jul 2017 05:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dX2F3-00055E-NO for bug-gnu-emacs@gnu.org; Mon, 17 Jul 2017 05:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jul 2017 09:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27243 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27243-submit@debbugs.gnu.org id=B27243.150028337619528 (code B ref 27243); Mon, 17 Jul 2017 09:23:01 +0000 Original-Received: (at 27243) by debbugs.gnu.org; 17 Jul 2017 09:22:56 +0000 Original-Received: from localhost ([127.0.0.1]:43213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX2Ex-00054u-Ok for submit@debbugs.gnu.org; Mon, 17 Jul 2017 05:22:55 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:50043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX2Ev-00054f-NE for 27243@debbugs.gnu.org; Mon, 17 Jul 2017 05:22:54 -0400 Original-Received: from rosalinde ([83.135.12.56]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MFuWk-1dS8wq3Bo6-00Es8M; Mon, 17 Jul 2017 11:22:46 +0200 In-Reply-To: <87zicd1pfy.fsf@beta> (Antoine Levitt's message of "Sun, 09 Jul 2017 19:37:53 +0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xWvdVnTy6zLIJxD/hrHzbRPg5fCAKkNcBgshp3sKww+fc2I X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134655 Archived-At: On Sun, 09 Jul 2017 19:37:53 +0200 Antoine Levitt wrote: > Works for me, feel free to merge! > > Best, > Antoine > > 17 June 2017 15:32 +02, Stephen Berman : >> On Sat, 17 Jun 2017 14:16:01 +0200 Antoine Levitt wrote: >> >>> I just noticed this is not yet completely fixed: starting from emacs -Q, >>> (setq dired-auto-revert-buffer t), open dired, open any file in that >>> directory, C-x d RET to run dired again, the point jumps back to the >>> beginning of the buffer. >> >> I suppose the command `dired' should not use switch-to-buffer. With the >> following patch, executing the above recipe does not move point. >> >> diff --git a/lisp/dired.el b/lisp/dired.el >> index 8396652d50..aa59f01af9 100644 >> --- a/lisp/dired.el >> +++ b/lisp/dired.el >> @@ -786,7 +786,8 @@ dired >> If DIRNAME is already in a Dired buffer, that buffer is used without refresh." >> ;; Cannot use (interactive "D") because of wildcards. >> (interactive (dired-read-dir-and-switches "")) >> - (switch-to-buffer (dired-noselect dirname switches))) >> + (set-window-buffer (selected-window) >> + (set-buffer (dired-noselect dirname switches)))) >> >> ;;;###autoload (define-key ctl-x-4-map "d" 'dired-other-window) >> ;;;###autoload >> >> Steve Berman On Sat, 15 Jul 2017 09:36:41 +0200 martin rudalics wrote: >> + (set-window-buffer (selected-window) >> + (set-buffer (dired-noselect dirname switches)))) > > This really should be > > (pop-to-buffer-same-window (dired-noselect dirname switches)) > > Even if people disliked it in the past and some still dislike it: Try > > C-h f > M-x dired I installed the fix Martin recommended to master as commit b2150e0 (after confirming that it indeed DTRT). I also added a test for this case and the first one. Steve Berman