GNU bug report logs - #27243
dired-auto-revert-buffer jumps point to beginning of buffer

Previous Next

Package: emacs;

Reported by: Antoine Levitt <antoine.levitt <at> gmail.com>

Date: Sun, 4 Jun 2017 23:46:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Antoine Levitt <antoine.levitt <at> gmail.com>
Cc: 27243 <at> debbugs.gnu.org
Subject: bug#27243: closed (Re: bug#27243: dired-auto-revert-buffer jumps point to beginning of buffer)
Date: Sat, 17 Jun 2017 15:32:38 +0200
[Message part 1 (text/plain, inline)]
On Sat, 17 Jun 2017 14:16:01 +0200 Antoine Levitt <antoine.levitt <at> gmail.com> 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.

[Message part 2 (text/x-patch, inline)]
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
[Message part 3 (text/plain, inline)]
Steve Berman

This bug report was last modified 4 years and 357 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.