Subject: Re: bug#32356: 26.1; --file visits file later than expected

From: Noam Postavsky <[email-masked]>
Date: Fri, 03 Aug 2018 06:04:49 -0400

[email-masked] (Per Starbäck) writes:

> If this behavior is intended, I think something could be added to
> "(emacs) Action Arguments" about it. I think this text about "--insert" there
> gives the impression that action arguments are processed in the order
> they are given:
>
>>  Usually, this is the
>>     ‘*scratch*’ buffer (*note Lisp Interaction::), but if arguments
>>     earlier on the command line visit files or switch buffers, that
>>     might be a different buffer.

The buffer is set by then, e.g., try

    emacs -Q --file=test.txt --eval '(princ (cons (current-buffer) (frame-selected-window)))'

and you get (test.txt . #<window 3 on *scratch*>).  So it's just that
window selection doesn't happen immediately.