bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27243: closed (Re: bug#27243: dired-auto-revert-buffer jumps point t


From: Stephen Berman
Subject: bug#27243: closed (Re: bug#27243: dired-auto-revert-buffer jumps point to beginning of buffer)
Date: Fri, 14 Jul 2017 11:56:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

On Sun, 09 Jul 2017 19:37:53 +0200 Antoine Levitt <antoine.levitt@gmail.com> 
wrote:

> Works for me, feel free to merge!
>
> Best,
> Antoine

Thanks for confirming.  I think this is the right fix and would commit
it, but since this exchange has taken place in a closed bug, it may have
fallen under the radar, so I'd like an explicit go-ahead.  Eli, John?

Steve Berman

> 17 June 2017 15:32 +02, Stephen Berman <stephen.berman@gmx.net>:
>> On Sat, 17 Jun 2017 14:16:01 +0200 Antoine Levitt <antoine.levitt@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.
>>
>> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]