Subject: Re: bug#27243: closed (Re: bug#27243: dired-auto-revert-buffer jumps point to beginning of buffer)

From: Stephen Berman <[email-masked]>
Date: Sat, 15 Jul 2017 13:14:06 +0200

On Fri, 14 Jul 2017 22:52:18 -0700 John Wiegley <[email-masked]> wrote:

>>>>>> Stephen Berman <[email-masked]> writes:
>
>> 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?
>
> At first glance it looks OK to me, though I defer to Eli's experience in such
> matters.

On Sat, 15 Jul 2017 10:18:06 +0300 Eli Zaretskii <[email-masked]> wrote:

> No objections here.
> Thanks.

Thanks for okaying, but...

On Sat, 15 Jul 2017 09:36:41 +0200 martin rudalics <[email-masked]> 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

Wow, that's disastrous!  And frightening: I use the "(set-window-buffer
(selected-window) (set-buffer ...))" idiom a lot in todo-mode.el; I just
checked two commands using `C-h f' followed by the command invocation:
one worked fine but the other caused the same disaster.  So now I have
to check all uses :(.  Is there a general guideline for when to use
set-window-buffer and when to use pop-to-buffer-same-window?

Anyway, I'll commit the dired.el change you recommend; many thanks.

Steve Berman