chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71c95f6
)
el/dot-emacs.el: Factor out the command-line option scanning.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 13 Sep 2019 16:05:13 +0000
(17:05 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Fri, 13 Sep 2019 16:05:13 +0000
(17:05 +0100)
el/dot-emacs.el
patch
|
blob
|
blame
|
history
diff --git
a/el/dot-emacs.el
b/el/dot-emacs.el
index d2c9275cee2de514f33921bcfa169c584d550ea9..70d3b7a426056e59e16207df33709139e092e240 100644
(file)
--- a/
el/dot-emacs.el
+++ b/
el/dot-emacs.el
@@
-24,19
+24,23
@@
;;;--------------------------------------------------------------------------
;;; Check command-line.
;;;--------------------------------------------------------------------------
;;; Check command-line.
+(defun mdw-check-command-line-switch (switch)
+ (let ((probe nil) (next command-line-args) (found nil))
+ (while next
+ (cond ((string= (car next) switch)
+ (setq found t)
+ (if probe (rplacd probe (cdr next))
+ (setq command-line-args (cdr next))))
+ (t
+ (setq probe next)))
+ (setq next (cdr next)))
+ found))
+
(defvar mdw-fast-startup nil
"Whether .emacs should optimize for rapid startup.
This may be at the expense of cool features.")
(defvar mdw-fast-startup nil
"Whether .emacs should optimize for rapid startup.
This may be at the expense of cool features.")
-(let ((probe nil) (next command-line-args))
- (while next
- (cond ((string= (car next) "--mdw-fast-startup")
- (setq mdw-fast-startup t)
- (if probe
- (rplacd probe (cdr next))
- (setq command-line-args (cdr next))))
- (t
- (setq probe next)))
- (setq next (cdr next))))
+(setq mdw-fast-startup
+ (mdw-check-command-line-switch "--mdw-fast-startup"))
;;;--------------------------------------------------------------------------
;;; Some general utilities.
;;;--------------------------------------------------------------------------
;;; Some general utilities.