Subject: Re: bug#13466: find-file-noselect scrolls current buffer

From: Stefan Monnier <[email-masked]>
Date: Wed, 16 Jan 2013 18:10:22 -0500

> $ yes | nl | head -999 > /tmp/n
> $ cp /tmp/n /tmp/m.txt
> $ emacs -q /tmp/n
> M-: (scroll-up)
> M-: (add-hook 'text-mode-hook 'end-of-buffer)
> M-: (find-file-noselect "/tmp/m.txt")

The problem is end-of-buffer, which affects the selected-window, even if
it does not display the current-buffer.  Of course, its docstring says
not to use it from Lisp, so we could argue it's not quite a bug.
I.e. use

  M-: (add-hook 'text-mode-hook (lambda () (goto-char (point-max))))

-- Stefan