fixed startup buffer switching

This commit is contained in:
Thomas von Dein
2017-07-14 13:57:56 +02:00
parent 335c0c0c93
commit 2c9abfc767
2 changed files with 449 additions and 425 deletions

12
.emacs
View File

@@ -545,6 +545,7 @@
;; - added here-doc support to config-general using mmm-mode ;; - added here-doc support to config-general using mmm-mode
;; - made outline faces a little bigger, added face for level 4 ;; - made outline faces a little bigger, added face for level 4
;; - rm initial buffer, doesnt open commandline files anymore with this ;; - rm initial buffer, doesnt open commandline files anymore with this
;; - finally initial buffer works, opens command line file or text scratch
;; ** TODO ;; ** TODO
@@ -1046,6 +1047,17 @@ to next buffer otherwise."
(with-current-buffer (get-buffer-create "*text*") (with-current-buffer (get-buffer-create "*text*")
(text-mode)) (text-mode))
(defun tvd-startup-scratch-or-file ()
"Jump to command line arg file, if any, or start with *text* buffer."
(interactive)
(let ((last-arg (find-buffer-visiting (replace-regexp-in-string "\\\\" "/" (car (last command-line-args))))))
(if last-arg
(switch-to-buffer last-arg)
(switch-to-buffer "*text*"))))
(setq initial-buffer-choice 'tvd-startup-scratch-or-file)
;; * Global Key Bindings ;; * Global Key Bindings
;; -------------------------------------------------------------------------------- ;; --------------------------------------------------------------------------------
;; ** c-h != delete ;; ** c-h != delete

File diff suppressed because it is too large Load Diff