Pages

Monday, September 13, 2010

Process Emacs Command Line Options

(defvar server-emacs t
"If non-null, this emacs should run emacsclient.")
(defvar org-instance t
"If nil then no org bindings")
(defvar email-instance nil
"If nil then no email")
(defvar erc-instance nil
"If nil then no erc auto start")

(add-to-list
'command-switch-alist
'("email" . (lambda (&rest ignore)
;; Start Gnus when Emacs starts
(setq email-instance t))))

(add-to-list
'command-switch-alist
'("irc" . (lambda (&rest ignore)
(setq erc-instance t))))

(add-to-list
'command-switch-alist
'("no-server" . (lambda (&rest ignore)
(setq server-emacs nil))))

(add-to-list
'command-switch-alist
'("no-org" . (lambda (&rest ignore)
(setq org-instance nil))))

(add-hook 'emacs-startup-hook
(lambda ()
(when server-emacs
(server-start))
(when org-instance
(rgr-org))
(when erc-instance
(rgr/start-erc))
(when email-instance
(progn (gnus)))))




No comments:

Post a Comment