unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7665: Emacs: add command line option -L to set more paths to load-path
@ 2010-12-17 17:50 Jari Aalto
  2010-12-17 18:49 ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Jari Aalto @ 2010-12-17 17:50 UTC (permalink / raw)
  To: 7665

Package: emacs
Version: 23.2+1-5.1
Severity: wishlist

To use and test packages outside of standard Emacs installation
directories, it would be nice to have option -L (like in linkers) to
prepend paths easily to load-path.

An example:

    emacs -L ~/elisp/package -L ~/.emacs.d/downloaded -l my-test.el

The long version of the option could be names:

    --load-path

-- System Information
Debian Release: squeeze/sid
  APT Prefers testing
  APT policy: (990, testing) (500, unstable) (1, experimental)
Architecture: amd64
Kernel: Linux picasso 2.6.32-5-amd64 #1 SMP Fri Sep 17 21:50:19 UTC 2010 x86_64 GNU/Linux
Locale: LANG=en_DK.UTF-8

-- Versions of packages `emacs depends on'.
Depends:
emacs23         23.2+1-5.1      GNU Emacs is the extensible self-documenting 
emacs23-lucid   23.2+1-5.1      GNU Emacs is the extensible self-documenting 
emacs23-nox     23.2+1-5.1      GNU Emacs is the extensible self-documenting 





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths toload-path
  2010-12-17 17:50 bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
@ 2010-12-17 18:49 ` Drew Adams
  2010-12-17 22:05 ` bug#7665: Emacs: add command line option -L to set more paths to load-path Stefan Monnier
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Drew Adams @ 2010-12-17 18:49 UTC (permalink / raw)
  To: 'Jari Aalto', 7665

> To use and test packages outside of standard Emacs installation
> directories, it would be nice to have option -L (like in linkers) to
> prepend paths easily to load-path.
> 
> An example:
> 
>  emacs -L ~/elisp/package -L ~/.emacs.d/downloaded -l my-test.el
> 
> The long version of the option could be names:
> 
>  --load-path

1+






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths to load-path
  2010-12-17 17:50 bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
  2010-12-17 18:49 ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
@ 2010-12-17 22:05 ` Stefan Monnier
  2010-12-18  0:46   ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
  2010-12-18 11:24   ` bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
  2011-04-30 16:39 ` bug#7665: Emacs: add command line option -L to set more paths to load-path - GNU bug report logs Jari Aalto
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 14+ messages in thread
From: Stefan Monnier @ 2010-12-17 22:05 UTC (permalink / raw)
  To: Jari Aalto; +Cc: 7665

> An example:
>     emacs -L ~/elisp/package -L ~/.emacs.d/downloaded -l my-test.el

I don't understand this example: why ~/elisp/package and
~/.emacs.d/downloaded?  What are these directories and how are they
related to my-test.el?


        Stefan





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths toload-path
  2010-12-17 22:05 ` bug#7665: Emacs: add command line option -L to set more paths to load-path Stefan Monnier
@ 2010-12-18  0:46   ` Drew Adams
  2010-12-18 11:24   ` bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
  1 sibling, 0 replies; 14+ messages in thread
From: Drew Adams @ 2010-12-18  0:46 UTC (permalink / raw)
  To: 'Stefan Monnier', 'Jari Aalto'; +Cc: 7665

> > An example:
> > emacs -L ~/elisp/package -L ~/.emacs.d/downloaded -l my-test.el
> 
> I don't understand this example: why ~/elisp/package and
> ~/.emacs.d/downloaded?  What are these directories and how are they
> related to my-test.el?

I shouldn't try to speak for Jari, but since I seconded the idea... This is what
I understood:

-L means add its arg to `load-path'

-l means load my-test.el (processing the `load-path' in the normal way).

-L's action would be done before -l's.  Presumably the -L's would be processed
in order.

The example given is only that: an example.  Nothing special about the
directories used in the example.

Again, Jari might have had something different in mind, but that's what I
imagined.






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths to load-path
  2010-12-17 22:05 ` bug#7665: Emacs: add command line option -L to set more paths to load-path Stefan Monnier
  2010-12-18  0:46   ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
@ 2010-12-18 11:24   ` Jari Aalto
  2010-12-18 16:01     ` Stefan Monnier
  1 sibling, 1 reply; 14+ messages in thread
From: Jari Aalto @ 2010-12-18 11:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7665, Jari Aalto

2010-12-18 00:05 Stefan Monnier <monnier@iro.umontreal.ca>:
| > An example:
| >     emacs -L ~/elisp/package -L ~/.emacs.d/downloaded -l my-test.el
| 
| I don't understand this example: why ~/elisp/package and
| ~/.emacs.d/downloaded?  What are these directories and how are they
| related to my-test.el?

Just like Drew explained. The above would effectively do:

    (add-to-list 'load-path "~/elisp/package")
    (add-to-list 'load-path "~/.emacs.d/downloaded")
    (load-library "my-test.el")

Paths and file names in the example were arbitrary and non-important.

The -L would also be useful for setting load-path prior byte
compiling files that require other files.

Jari





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths to load-path
  2010-12-18 11:24   ` bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
@ 2010-12-18 16:01     ` Stefan Monnier
  2010-12-18 19:10       ` jari
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2010-12-18 16:01 UTC (permalink / raw)
  To: Jari Aalto; +Cc: 7665

> | > An example:
> | >     emacs -L ~/elisp/package -L ~/.emacs.d/downloaded -l my-test.el
> | 
> | I don't understand this example: why ~/elisp/package and
> | ~/.emacs.d/downloaded?  What are these directories and how are they
> | related to my-test.el?

> Just like Drew explained. The above would effectively do:

>     (add-to-list 'load-path "~/elisp/package")
>     (add-to-list 'load-path "~/.emacs.d/downloaded")
>     (load-library "my-test.el")

I understood that part, of course.  The question is: why do you need to
do that?
Hence "What are these directories and how are they related to my-test.el?"
And "Why ~/elisp/package and ~/.emacs.d/downloaded?"

Hopefully you (or Drew) understand those two questions now and can
answer them,


        Stefan





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths to load-path
  2010-12-18 16:01     ` Stefan Monnier
@ 2010-12-18 19:10       ` jari
  2010-12-18 20:12         ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
  2011-01-21 18:52         ` bug#7665: Emacs: add command line option -L to set more paths to load-path Stefan Monnier
  0 siblings, 2 replies; 14+ messages in thread
From: jari @ 2010-12-18 19:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7665

On 2010-12-18 11:01, Stefan Monnier wrote:
| > | > An example:
| > | >     emacs -L ~/elisp/package -L ~/.emacs.d/downloaded -l my-test.el
|
| > Just like Drew explained. The above would effectively do:
| 
| >     (add-to-list 'load-path "~/elisp/package")
| >     (add-to-list 'load-path "~/.emacs.d/downloaded")
| >     (load-library "my-test.el")
| 
| I understood that part, of course.  The question is: why do you need to
| do that?
| Hence "What are these directories and how are they related to my-test.el?"
| And "Why ~/elisp/package and ~/.emacs.d/downloaded?"

Users download packages for Emas from emacswiki etc. and those packages are put
either under:

       ~/elisp/

or     ~/.emacs.d/


To set the load-path to include more directories at command line is
typically needed for

	- To test new features (as in above: my-test.el does
          something with 'require' commands).

	- To be able to set load-path for byte compiling packages

Jari





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths toload-path
  2010-12-18 19:10       ` jari
@ 2010-12-18 20:12         ` Drew Adams
  2010-12-19 11:05           ` jari
  2011-01-21 18:52         ` bug#7665: Emacs: add command line option -L to set more paths to load-path Stefan Monnier
  1 sibling, 1 reply; 14+ messages in thread
From: Drew Adams @ 2010-12-18 20:12 UTC (permalink / raw)
  To: 'jari', 'Stefan Monnier'; +Cc: 7665

> | The question is: why do you need to do that?
> | Hence "What are these directories and how are they related 
> | to my-test.el?" And "Why ~/elisp/package and ~/.emacs.d/downloaded?"
> 
> Users download packages for Emas from emacswiki etc. and 
> those packages are put either under: ~/elisp/ or ~/.emacs.d/
> 
> To set the load-path to include more directories at command line is
> typically needed for
> - To test new features (as in above: my-test.el does
>   something with 'require' commands).
> - To be able to set load-path for byte compiling packages

And I was thinking mainly of another use case: analyzing and reporting bugs.

I typically have many things open/loaded when I first detect a bug, and I use
lots of soft-`require's: (require 'foo nil t).

To narrow down the problem, I sometimes copy suspect files to a separate
directory, open `emacs -Q' and add just that directory to `load-path'.  I use a
Windows shortcut to launch Emacs, and it would be handy to just put the -L into
the run command for the shortcut.  This is also convenient if there are a couple
such directories that provide alternatives I want to compare.

Granted, this is all just convenience stuff - you can always modify `load-path'
using Lisp.  But I think it could be useful.

IMO (without too much thought, so I could be wrong), the order of switch
processing should be just left to right.  That way, you could use -L followed by
-l then a different -L followed by another -l etc.  Assuming that each -L pushes
a directory to `load-path', the second -L would shadow the first, in case the -l
library is in both directories.  Etc.

The real point of the last paragraph is that we should think over how we want
these switches to be processed, because the order can make a difference.  The
processing order should anyway be (deterministic and) documented for users.






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths toload-path
  2010-12-18 20:12         ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
@ 2010-12-19 11:05           ` jari
  0 siblings, 0 replies; 14+ messages in thread
From: jari @ 2010-12-19 11:05 UTC (permalink / raw)
  To: Drew Adams; +Cc: 7665

On 2010-12-18 12:12, Drew Adams wrote:
| 
| And I was thinking mainly of another use case: analyzing and reporting bugs.
| ... To narrow down the problem, I sometimes copy suspect files to a separate
| direactory, open `emacs -Q' and add just that directory to `load-path'.
|
| ...  the order of switch processing should be just left to right.
| That way, you could use -L followed by -l

Processing would be as they appear on the command line.

	-L path1 -l library1 -l path2 -l library2

as in:

	(add-to-list 'load-path "path1")
	(load "library1")
	(add-to-list 'load-path "path2")
	(load "library2")

Jari





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths to load-path
  2010-12-18 19:10       ` jari
  2010-12-18 20:12         ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
@ 2011-01-21 18:52         ` Stefan Monnier
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2011-01-21 18:52 UTC (permalink / raw)
  To: jari; +Cc: 7665

> Users download packages for Emas from emacswiki etc. and those
> packages are put either under:

>        ~/elisp/
> or     ~/.emacs.d/

That's the obvious part.

> To set the load-path to include more directories at command line is
> typically needed for

> 	- To test new features (as in above: my-test.el does
>           something with 'require' commands).

I don't understand: presumably your ~/.emacs.d or ~/elisp dir will be added
to your load-path by ~/.emacs, so you don't need it on the command line.

> 	- To be able to set load-path for byte compiling packages

Again, I don't understand what situation you're thinking about.
In my view, there are mainly two cases:
- single file packages, which you can handle with "emacs -l /where/ever/foo.el"
- multifile packages, which have an "autoloads" or "site-init" file and
  that file should set load-path for you, so
  "emacs -l /where/ever/autoloads" will again take care of the load-path.


        Stefan





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths to load-path - GNU bug report logs
  2010-12-17 17:50 bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
  2010-12-17 18:49 ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
  2010-12-17 22:05 ` bug#7665: Emacs: add command line option -L to set more paths to load-path Stefan Monnier
@ 2011-04-30 16:39 ` Jari Aalto
  2011-05-02 16:09   ` Stefan Monnier
  2011-05-05  6:49 ` bug#7665: Emacs: add command line option -L to set more paths to Jari Aalto
  2013-02-24  0:59 ` bug#7665: Emacs: add command line option -L to set more paths to load-path Glenn Morris
  4 siblings, 1 reply; 14+ messages in thread
From: Jari Aalto @ 2011-04-30 16:39 UTC (permalink / raw)
  To: 7665; +Cc: 7665-submitter


> In my view, there are mainly two cases:
> - single file packages, which you can handle with "emacs -l
> /where/ever/foo.el"
> - multifile packages, which have an "autoloads" or "site-init" file and
>   that file should set load-path for you, so
>   "emacs -l /where/ever/autoloads" will again take care of the load-path.
>
>         Stefan

To test third party packages that depends on other 3rd party libraries. Not
all packages have autoloads files.

Jari





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths to load-path - GNU bug report logs
  2011-04-30 16:39 ` bug#7665: Emacs: add command line option -L to set more paths to load-path - GNU bug report logs Jari Aalto
@ 2011-05-02 16:09   ` Stefan Monnier
  0 siblings, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2011-05-02 16:09 UTC (permalink / raw)
  To: Jari Aalto; +Cc: 7665-submitter, 7665

> To test third party packages that depends on other 3rd party
> libraries.  Not all packages have autoloads files.

That's a good opportunity to fix them,


        Stefan





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths to
  2010-12-17 17:50 bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
                   ` (2 preceding siblings ...)
  2011-04-30 16:39 ` bug#7665: Emacs: add command line option -L to set more paths to load-path - GNU bug report logs Jari Aalto
@ 2011-05-05  6:49 ` Jari Aalto
  2013-02-24  0:59 ` bug#7665: Emacs: add command line option -L to set more paths to load-path Glenn Morris
  4 siblings, 0 replies; 14+ messages in thread
From: Jari Aalto @ 2011-05-05  6:49 UTC (permalink / raw)
  To: 7665


Stefan Monnier <monnier <at> iro.umontreal.ca>:
> > To test third party packages that depends on other 3rd party
> > libraries.  Not all packages have autoloads files.
>
> That's a good opportunity to fix them.

Many packages are single source. They do not ship Makefiles or
*-autoloads.el. An example:

    Developer Joe publishes A

    Developer Mike publishes B, but uses A's package. To avoid troubles he
    bundes A in his archive.

    Later Developr A publishes new version. But B does not update his copy.

Elsewhere

    Zoe wants to use latest A and latest B, so he does downloads both from
    version control trees. He intends to test to see if B still works with
    latest A:

    emacs -L /patch/to/A -l A -l path/to/B -l B

The -L option would be helpful in combining code from differe directories.

Jari





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#7665: Emacs: add command line option -L to set more paths to load-path
  2010-12-17 17:50 bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
                   ` (3 preceding siblings ...)
  2011-05-05  6:49 ` bug#7665: Emacs: add command line option -L to set more paths to Jari Aalto
@ 2013-02-24  0:59 ` Glenn Morris
  4 siblings, 0 replies; 14+ messages in thread
From: Glenn Morris @ 2013-02-24  0:59 UTC (permalink / raw)
  To: 7665-done

Version: 19.29

Jari Aalto wrote:

> directories, it would be nice to have option -L (like in linkers) to
> prepend paths easily to load-path.
>
> An example:
>
>     emacs -L ~/elisp/package -L ~/.emacs.d/downloaded -l my-test.el
[...]
> The above would effectively do:
>
>    (add-to-list 'load-path "~/elisp/package")
>    (add-to-list 'load-path "~/.emacs.d/downloaded")
>    (load-library "my-test.el")

Emacs has had this feature since version 19.29...





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-02-24  0:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-17 17:50 bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
2010-12-17 18:49 ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
2010-12-17 22:05 ` bug#7665: Emacs: add command line option -L to set more paths to load-path Stefan Monnier
2010-12-18  0:46   ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
2010-12-18 11:24   ` bug#7665: Emacs: add command line option -L to set more paths to load-path Jari Aalto
2010-12-18 16:01     ` Stefan Monnier
2010-12-18 19:10       ` jari
2010-12-18 20:12         ` bug#7665: Emacs: add command line option -L to set more paths toload-path Drew Adams
2010-12-19 11:05           ` jari
2011-01-21 18:52         ` bug#7665: Emacs: add command line option -L to set more paths to load-path Stefan Monnier
2011-04-30 16:39 ` bug#7665: Emacs: add command line option -L to set more paths to load-path - GNU bug report logs Jari Aalto
2011-05-02 16:09   ` Stefan Monnier
2011-05-05  6:49 ` bug#7665: Emacs: add command line option -L to set more paths to Jari Aalto
2013-02-24  0:59 ` bug#7665: Emacs: add command line option -L to set more paths to load-path Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).