summaryrefslogtreecommitdiff
path: root/lisp/startup.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-11-03 17:36:14 -0800
committerGlenn Morris <rgm@gnu.org>2013-11-03 17:36:14 -0800
commita0833f62d5e41901b5ab12fb19a7728593b088ed (patch)
tree9152bef64e993d58d452648dc3ae498eeb33773c /lisp/startup.el
parente61845c1db42405938b9dca7dfff73b4ab6aa52a (diff)
downloademacs-a0833f62d5e41901b5ab12fb19a7728593b088ed.tar.gz
emacs-a0833f62d5e41901b5ab12fb19a7728593b088ed.tar.bz2
emacs-a0833f62d5e41901b5ab12fb19a7728593b088ed.zip
* lisp/startup.el (command-line-1): Allow `-L :...' to append to load-path.
* doc/emacs/cmdargs.texi (Action Arguments): Mention that `-L :...' appends. * etc/NEWS: Mention this.
Diffstat (limited to 'lisp/startup.el')
-rw-r--r--lisp/startup.el23
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index 391d65a3520..e93c3fa5826 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -2171,13 +2171,22 @@ A fancy display is used on graphic displays, normal otherwise."
(eval (read (or argval (pop command-line-args-left)))))
((member argi '("-L" "-directory"))
- (setq tem (expand-file-name
- (command-line-normalize-file-name
- (or argval (pop command-line-args-left)))))
- (cond (splice (setcdr splice (cons tem (cdr splice)))
- (setq splice (cdr splice)))
- (t (setq load-path (cons tem load-path)
- splice load-path))))
+ ;; -L :/foo adds /foo to the _end_ of load-path.
+ (let (append)
+ (if (string-match-p
+ "\\`:"
+ (setq tem (or argval (pop command-line-args-left))))
+ (setq tem (substring tem 1)
+ append t))
+ (setq tem (expand-file-name
+ (command-line-normalize-file-name tem)))
+ (cond (append (setq load-path
+ (append load-path (list tem)))
+ (if splice (setq splice load-path)))
+ (splice (setcdr splice (cons tem (cdr splice)))
+ (setq splice (cdr splice)))
+ (t (setq load-path (cons tem load-path)
+ splice load-path)))))
((member argi '("-l" "-load"))
(let* ((file (command-line-normalize-file-name