aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-11-03 17:36:14 -0800
committerGlenn Morris2013-11-03 17:36:14 -0800
commita0833f62d5e41901b5ab12fb19a7728593b088ed (patch)
tree9152bef64e993d58d452648dc3ae498eeb33773c
parente61845c1db42405938b9dca7dfff73b4ab6aa52a (diff)
downloademacs-a0833f62d5e41901b5ab12fb19a7728593b088ed.tar.gz
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.
-rw-r--r--doc/emacs/ChangeLog4
-rw-r--r--doc/emacs/cmdargs.texi2
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/startup.el23
5 files changed, 30 insertions, 7 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 79047e3285b..7f051e751e5 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,7 @@
12013-11-04 Glenn Morris <rgm@gnu.org>
2
3 * cmdargs.texi (Action Arguments): Mention that `-L :...' appends.
4
12013-11-02 Glenn Morris <rgm@gnu.org> 52013-11-02 Glenn Morris <rgm@gnu.org>
2 6
3 * cmdargs.texi (Action Arguments): Clarify `-L' a bit. 7 * cmdargs.texi (Action Arguments): Clarify `-L' a bit.
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 1ef6529f295..d0f5f1e06b1 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -139,6 +139,8 @@ Prepend directory @var{dir} to the variable @code{load-path}.
139If you specify multiple @samp{-L} options, Emacs preserves the 139If you specify multiple @samp{-L} options, Emacs preserves the
140relative order; i.e., using @samp{-L /foo -L /bar} results in 140relative order; i.e., using @samp{-L /foo -L /bar} results in
141a @code{load-path} of the form @code{("/foo" "/bar" @dots{})}. 141a @code{load-path} of the form @code{("/foo" "/bar" @dots{})}.
142If @var{dir} begins with @samp{:}, Emacs removes the @samp{:} and
143appends (rather than prepends) the remainder to @code{load-path}.
142 144
143@item -f @var{function} 145@item -f @var{function}
144@opindex -f 146@opindex -f
diff --git a/etc/NEWS b/etc/NEWS
index 0ab4e34a265..1c171ba6f51 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -62,6 +62,10 @@ To use the old backend by default, do on the command line:
62 62
63* Startup Changes in Emacs 24.4 63* Startup Changes in Emacs 24.4
64 64
65+++
66** The -L option, which normally prepends its argument to load-path,
67will instead append, if the argument begins with `:'.
68
65 69
66* Changes in Emacs 24.4 70* Changes in Emacs 24.4
67 71
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4f1b2142a69..522181b3e4f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12013-11-04 Glenn Morris <rgm@gnu.org>
2
3 * startup.el (command-line-1): Allow `-L :...' to append to load-path.
4
12013-11-03 Stefan Monnier <monnier@iro.umontreal.ca> 52013-11-03 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): Remove. 7 * progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): Remove.
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."
2171 (eval (read (or argval (pop command-line-args-left))))) 2171 (eval (read (or argval (pop command-line-args-left)))))
2172 2172
2173 ((member argi '("-L" "-directory")) 2173 ((member argi '("-L" "-directory"))
2174 (setq tem (expand-file-name 2174 ;; -L :/foo adds /foo to the _end_ of load-path.
2175 (command-line-normalize-file-name 2175 (let (append)
2176 (or argval (pop command-line-args-left))))) 2176 (if (string-match-p
2177 (cond (splice (setcdr splice (cons tem (cdr splice))) 2177 "\\`:"
2178 (setq splice (cdr splice))) 2178 (setq tem (or argval (pop command-line-args-left))))
2179 (t (setq load-path (cons tem load-path) 2179 (setq tem (substring tem 1)
2180 splice load-path)))) 2180 append t))
2181 (setq tem (expand-file-name
2182 (command-line-normalize-file-name tem)))
2183 (cond (append (setq load-path
2184 (append load-path (list tem)))
2185 (if splice (setq splice load-path)))
2186 (splice (setcdr splice (cons tem (cdr splice)))
2187 (setq splice (cdr splice)))
2188 (t (setq load-path (cons tem load-path)
2189 splice load-path)))))
2181 2190
2182 ((member argi '("-l" "-load")) 2191 ((member argi '("-l" "-load"))
2183 (let* ((file (command-line-normalize-file-name 2192 (let* ((file (command-line-normalize-file-name