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 user-init-file
:
(setq inhibit-startup-screen t
initial-buffer-choice nil)
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.
(setq inhibit-startup-message t)
. I tried the changes you suggested but the behaviour of emacs remains unchanged, even if I run it from a terminal emulator, with the GUI or without (-nw). Without file argument it shows the scratch buffer, with a file argument it shows a split screen with the scratch buffer and file buffer as I described above. – rockemacs May 29 '17 at 13:29-q
it means there is something in your site lisp (e.g. emacs packages installed viaapt
) that is causing the issue. – Basil May 29 '17 at 14:53