I set up emacs so that it shows the scratch buffer at startup.
How did you achieve this? By setting the variable
initial-buffer-choice to a non-
nil value or some other means?
I would like that in this circumstance only the file buffer is shown and not the scratch one.
Usually you can achieve your desired behaviour by leaving
initial-buffer-choice to its default
nil value and setting the variable
inhibit-startup-screen to a non-
nil value in your
(setq inhibit-startup-screen t
If this does not work, see the following:
When I open a file via a file manager with right-click -> open with -> emacs, emacs starts up with a split screen and two buffers
Are you able to replicate this behaviour when manually invoking Emacs from a command-line or a program launcher? For example, try running the following two commands in a terminal emulator:
$ emacs # w/o file argument
$ emacs foo # w/ file argument
If the manual Emacs invocation works as desired (i.e. no split screen), then the issue may lie with your desktop environment (e.g. the command-line arguments passed to Emacs in the installed
emacs.desktop file), though I'd be very surprised if this is the case.