emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114928: * lisp/startup.el (command-line-1): Allow `


From: Glenn Morris
Subject: [Emacs-diffs] trunk r114928: * lisp/startup.el (command-line-1): Allow `-L :...' to append to load-path.
Date: Mon, 04 Nov 2013 01:36:26 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114928
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sun 2013-11-03 17:36:14 -0800
message:
  * 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.
modified:
  doc/emacs/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-6227
  doc/emacs/cmdargs.texi         
cmdargs.texi-20091113204419-o5vbwnq5f7feedwu-6238
  etc/NEWS                       news-20100311060928-aoit31wvzf25yr1z-1
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/startup.el                startup.el-20091113204419-o5vbwnq5f7feedwu-260
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2013-11-02 23:36:32 +0000
+++ b/doc/emacs/ChangeLog       2013-11-04 01:36:14 +0000
@@ -1,3 +1,7 @@
+2013-11-04  Glenn Morris  <address@hidden>
+
+       * cmdargs.texi (Action Arguments): Mention that `-L :...' appends.
+
 2013-11-02  Glenn Morris  <address@hidden>
 
        * cmdargs.texi (Action Arguments): Clarify `-L' a bit.

=== modified file 'doc/emacs/cmdargs.texi'
--- a/doc/emacs/cmdargs.texi    2013-11-02 23:36:32 +0000
+++ b/doc/emacs/cmdargs.texi    2013-11-04 01:36:14 +0000
@@ -139,6 +139,8 @@
 If you specify multiple @samp{-L} options, Emacs preserves the
 relative order; i.e., using @samp{-L /foo -L /bar} results in
 a @code{load-path} of the form @code{("/foo" "/bar" @dots{})}.
+If @var{dir} begins with @samp{:}, Emacs removes the @samp{:} and
+appends (rather than prepends) the remainder to @code{load-path}.
 
 @item -f @var{function}
 @opindex -f

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2013-11-02 11:37:14 +0000
+++ b/etc/NEWS  2013-11-04 01:36:14 +0000
@@ -62,6 +62,10 @@
 
 * Startup Changes in Emacs 24.4
 
++++
+** The -L option, which normally prepends its argument to load-path,
+will instead append, if the argument begins with `:'.
+
 
 * Changes in Emacs 24.4
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-11-03 22:56:03 +0000
+++ b/lisp/ChangeLog    2013-11-04 01:36:14 +0000
@@ -1,3 +1,7 @@
+2013-11-04  Glenn Morris  <address@hidden>
+
+       * startup.el (command-line-1): Allow `-L :...' to append to load-path.
+
 2013-11-03  Stefan Monnier  <address@hidden>
 
        * progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): Remove.

=== modified file 'lisp/startup.el'
--- a/lisp/startup.el   2013-11-02 23:37:59 +0000
+++ b/lisp/startup.el   2013-11-04 01:36:14 +0000
@@ -2171,13 +2171,22 @@
                   (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]