:warning))
(let ((file-count 0)
+ (pop-up-tabs pop-up-tabs)
first-file-buffer)
(when command-line-args-left
;; We have command args; process them.
;; This includes our standard options' long versions
;; and long versions of what's on command-switch-alist.
(longopts
- (append '("--funcall" "--load" "--insert" "--kill"
+ (append '("--funcall" "--load" "--insert" "--kill" "--tabs"
"--directory" "--eval" "--execute" "--no-splash"
"--find-file" "--visit" "--file" "--no-desktop")
(mapcar (lambda (elt) (concat "-" (car elt)))
(setq command-line-args-left
(nthcdr (nth 1 cl1-tem) command-line-args-left)))
+ ((equal argi "-tabs")
+ (setq pop-up-tabs t))
+
((member argi '("-find-file" "-file" "-visit"))
(setq inhibit-startup-screen t)
;; An explicit option to specify visiting a file.
cl1-dir)))
(if (= file-count 1)
(setq first-file-buffer (find-file file))
- (find-file-other-window file)))
+ (if pop-up-tabs
+ (find-file-other-tab file)
+ (find-file-other-window file))))
(unless (zerop cl1-line)
(goto-char (point-min))
(forward-line (1- cl1-line)))
cl1-dir)))
(cond ((= file-count 1)
(setq first-file-buffer (find-file file)))
+ (pop-up-tabs
+ (find-file-other-tab file))
(inhibit-startup-screen
(find-file-other-window file))
(t (find-file file))))
(and (> file-count 2)
(not noninteractive)
(not inhibit-startup-buffer-menu)
+ (not pop-up-tabs)
(or (get-buffer-window first-file-buffer)
(list-buffers)))
;; (with-no-warnings
;; (setq menubar-bindings-done t))
- (if (> file-count 0)
- (display-startup-screen t)
- (display-startup-screen nil)))))
+ (cond (pop-up-tabs
+ (select-tab (make-tab nil nil 1))
+ (display-startup-screen nil))
+ ((> file-count 0)
+ (display-startup-screen t))
+ (t
+ (display-startup-screen nil))))))
(defun command-line-normalize-file-name (file)
"Collapse multiple slashes to one, to handle non-Emacs file names."
--insert FILE insert contents of FILE into current buffer\n\
--kill exit without asking for confirmation\n\
--load, -l FILE load Emacs Lisp FILE using the load function\n\
+--tabs use tabs to visit files in a new tab\n\
--visit FILE visit FILE using find-file\n\
\n"
{ "-eval", "--eval", 0, 1 },
{ "-execute", "--execute", 0, 1 },
{ "-find-file", "--find-file", 0, 1 },
+ { "-tabs", "--tabs", 0, 0 },
{ "-visit", "--visit", 0, 1 },
{ "-file", "--file", 0, 1 },
{ "-insert", "--insert", 0, 1 },