From 15c7ae5bdf5a22b0fbd2cdd4acb6ec9e9fdcc3f2 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 6 Jan 2016 23:01:27 -0500 Subject: [PATCH] core: hide home buffer if a file is passed on the command line Note that any non Emacsy command line parameter and non processed command line parameter (that is unknown from Spacemacs) will hide the home buffer. This should be good enough. Fixes #4057 --- core/core-command-line.el | 14 ++++++++++++-- core/core-spacemacs.el | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/core-command-line.el b/core/core-command-line.el index 4e5d563a3..26a55c1d9 100644 --- a/core/core-command-line.el +++ b/core/core-command-line.el @@ -10,9 +10,10 @@ ;; ;;; License: GPLv3 -;; process args (defun spacemacs//parse-command-line (args) - "Process ARGS relevant to core-debug.el" + "Handle Spacemacs specific command line arguments. +The reason why we don't use the Emacs hooks for processing user defined +arguments is that we want to process these arguments as soon as possible." (let ((i 0) new-args) (while (< i (length args)) (let ((arg (nth i args)) @@ -43,4 +44,13 @@ (setq command-line-args (spacemacs//parse-command-line command-line-args)) +(defun spacemacs//hide-home-buffer () + "Hides the Spacemacs home buffer at startup to not obfuscate the opened +startup file. +Note that any non Emacsy command line parameter will have the effect to +hide the home buffer." + (setq initial-buffer-choice nil)) + +(push 'spacemacs//hide-home-buffer command-line-functions) + (provide 'core-command-line) diff --git a/core/core-spacemacs.el b/core/core-spacemacs.el index 58d0eeea6..e2b8103d6 100644 --- a/core/core-spacemacs.el +++ b/core/core-spacemacs.el @@ -86,6 +86,7 @@ (spacemacs-buffer/warning "Cannot find font \"%s\"!" (car dotspacemacs-default-font)))) ;; spacemacs init + (setq inhibit-startup-screen t) (spacemacs-buffer/goto-buffer) (unless (display-graphic-p) ;; explicitly recreate the home buffer for the first GUI client