all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* add directories to load-path
@ 2009-09-15  5:36 henry atting
  2009-09-15  6:24 ` Gnutux
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: henry atting @ 2009-09-15  5:36 UTC (permalink / raw)
  To: help-gnu-emacs

How can I add directories to the load-path *including* all
subdirectories?

At present I do it this way

(setq load-path (append '( "/some/directory" "/some/directory/subdirectory") load-path))

which is not very handy when a directory contains several different
subdirectories with elisp files.

henry

-- 
http://literaturlatenight.de


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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
@ 2009-09-15  6:24 ` Gnutux
  2009-09-15  6:24 ` Gnutux
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Gnutux @ 2009-09-15  6:24 UTC (permalink / raw)
  To: help-gnu-emacs

Taken from http://emacs-fu.blogspot.com or from djcb's dot emacs (thanks by the way), I have the following in my init.el

; Load all recursively all folders
(defconst elisp-path '("~/.emacs.d"))
(mapcar '(lambda(p)
           (add-to-list 'load-path p)
           (cd p) (normal-top-level-add-subdirs-to-load-path)) elisp-path)




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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
  2009-09-15  6:24 ` Gnutux
@ 2009-09-15  6:24 ` Gnutux
  2009-09-15  7:10 ` Gnutux
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Gnutux @ 2009-09-15  6:24 UTC (permalink / raw)
  To: help-gnu-emacs

Taken from http://emacs-fu.blogspot.com or from djcb's dot emacs (thanks by the way), I have the following in my init.el

; Load all recursively all folders
(defconst elisp-path '("~/.emacs.d"))
(mapcar '(lambda(p)
           (add-to-list 'load-path p)
           (cd p) (normal-top-level-add-subdirs-to-load-path)) elisp-path)




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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
  2009-09-15  6:24 ` Gnutux
  2009-09-15  6:24 ` Gnutux
@ 2009-09-15  7:10 ` Gnutux
  2009-09-15  7:22 ` Gnutux
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Gnutux @ 2009-09-15  7:10 UTC (permalink / raw)
  To: help-gnu-emacs


Taken from http://emacs-fu.blogspot.com or from djcb's dot emacs (thanks by the way), I have the following in my init.el

; Load all recursively all folders
(defconst elisp-path '("~/.emacs.d"))
(mapcar '(lambda(p)
           (add-to-list 'load-path p)
           (cd p) (normal-top-level-add-subdirs-to-load-path)) elisp-path)




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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
                   ` (2 preceding siblings ...)
  2009-09-15  7:10 ` Gnutux
@ 2009-09-15  7:22 ` Gnutux
  2009-09-15 10:56 ` Bernardo
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Gnutux @ 2009-09-15  7:22 UTC (permalink / raw)
  To: help-gnu-emacs


Taken from http://emacs-fu.blogspot.com or from djcb's dot emacs (thanks by the way), I have the following in my init.el

; Load all recursively all folders
(defconst elisp-path '("~/.emacs.d"))
(mapcar '(lambda(p)
           (add-to-list 'load-path p)
           (cd p) (normal-top-level-add-subdirs-to-load-path)) elisp-path)




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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
                   ` (3 preceding siblings ...)
  2009-09-15  7:22 ` Gnutux
@ 2009-09-15 10:56 ` Bernardo
  2009-09-15 11:05 ` Florian Kaufmann
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Bernardo @ 2009-09-15 10:56 UTC (permalink / raw)
  To: help-gnu-emacs


> How can I add directories to the load-path *including* all
> subdirectories?
> 
possibly by creating subdirs.el there, with this contents:

(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
     (normal-top-level-add-subdirs-to-load-path))

however, i couldn't find any reference to subdirs.el trick in the 
documentation




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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
                   ` (4 preceding siblings ...)
  2009-09-15 10:56 ` Bernardo
@ 2009-09-15 11:05 ` Florian Kaufmann
  2009-09-15 11:16 ` Gnutux
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Florian Kaufmann @ 2009-09-15 11:05 UTC (permalink / raw)
  To: help-gnu-emacs

I can't give a self contained solution, but I think directory-files-
and-attributes might be a good starting point.

Flo


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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
                   ` (5 preceding siblings ...)
  2009-09-15 11:05 ` Florian Kaufmann
@ 2009-09-15 11:16 ` Gnutux
  2009-09-15 11:29 ` Gnutux
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Gnutux @ 2009-09-15 11:16 UTC (permalink / raw)
  To: help-gnu-emacs


At Tue, 15 Sep 2009 07:36:33 +0200,
henry atting <nsmp_01@online.de> wrote:
> 
> How can I add directories to the load-path *including* all
> subdirectories?
> 
> At present I do it this way
> 
> (setq load-path (append '( "/some/directory" "/some/directory/subdirectory") load-path))
> 
> which is not very handy when a directory contains several different
> subdirectories with elisp files.
> 
> henry

Taken from djcb's emacs or his website (http://emacs-fu.blogspot.com) - thanks by the way - here is what I use:

; Load recursively a directory
(defconst elisp-path '("~/.emacs.d"))
(mapcar '(lambda(p)
           (add-to-list 'load-path p)
           (cd p) (normal-top-level-add-subdirs-to-load-path)) elisp-path)





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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
                   ` (6 preceding siblings ...)
  2009-09-15 11:16 ` Gnutux
@ 2009-09-15 11:29 ` Gnutux
  2009-09-15 11:33 ` Gnutux
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Gnutux @ 2009-09-15 11:29 UTC (permalink / raw)
  To: help-gnu-emacs


At Tue, 15 Sep 2009 07:36:33 +0200,
henry atting <nsmp_01@online.de> wrote:
> 
> How can I add directories to the load-path *including* all
> subdirectories?
> 
> At present I do it this way
> 
> (setq load-path (append '( "/some/directory" "/some/directory/subdirectory") load-path))
> 
> which is not very handy when a directory contains several different
> subdirectories with elisp files.
> 
> henry

Taken from djcb's emacs or his website (http://emacs-fu.blogspot.com) - thanks by the way - here is what I use:

; Load recursively a directory
(defconst elisp-path '("~/.emacs.d"))
(mapcar '(lambda(p)
           (add-to-list 'load-path p)
           (cd p) (normal-top-level-add-subdirs-to-load-path)) elisp-path)




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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
                   ` (7 preceding siblings ...)
  2009-09-15 11:29 ` Gnutux
@ 2009-09-15 11:33 ` Gnutux
  2009-09-15 11:52 ` Gnutux
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Gnutux @ 2009-09-15 11:33 UTC (permalink / raw)
  To: help-gnu-emacs


At Tue, 15 Sep 2009 07:36:33 +0200,
henry atting <nsmp_01@online.de> wrote:
> 
> How can I add directories to the load-path *including* all
> subdirectories?
> 
> At present I do it this way
> 
> (setq load-path (append '( "/some/directory" "/some/directory/subdirectory") load-path))
> 
> which is not very handy when a directory contains several different
> subdirectories with elisp files.
> 
> henry

Taken from djcb's emacs or his website (http://emacs-fu.blogspot.com) - thanks by the way - here is what I use:

; Load recursively a directory
(defconst elisp-path '("~/.emacs.d"))
(mapcar '(lambda(p)
           (add-to-list 'load-path p)
           (cd p) (normal-top-level-add-subdirs-to-load-path)) elisp-path)




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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
                   ` (8 preceding siblings ...)
  2009-09-15 11:33 ` Gnutux
@ 2009-09-15 11:52 ` Gnutux
  2009-09-15 12:24 ` Maurizio Vitale
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Gnutux @ 2009-09-15 11:52 UTC (permalink / raw)
  To: help-gnu-emacs


That should do the job. :-)

; Load recursively a folder
(defconst elisp-path '("~/.emacs.d"))
(mapcar '(lambda(p)
           (add-to-list 'load-path p)
           (cd p) (normal-top-level-add-subdirs-to-load-path)) elisp-path)




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

* Re: add directories to load-path
  2009-09-15  5:36 add directories to load-path henry atting
                   ` (9 preceding siblings ...)
  2009-09-15 11:52 ` Gnutux
@ 2009-09-15 12:24 ` Maurizio Vitale
       [not found] ` <mailman.6765.1253076234.2239.help-gnu-emacs@gnu.org>
       [not found] ` <mailman.6708.1253017158.2239.help-gnu-emacs@gnu.org>
  12 siblings, 0 replies; 16+ messages in thread
From: Maurizio Vitale @ 2009-09-15 12:24 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "henry" == henry atting <nsmp_01@online.de> writes:

    henry> How can I add directories to the load-path *including* all
    henry> subdirectories?

    henry> At present I do it this way

    henry> (setq load-path (append '( "/some/directory"
    henry> "/some/directory/subdirectory") load-path))

    henry> which is not very handy when a directory contains several
    henry> different subdirectories with elisp files.

I use this:

(defun pm/add-tree-to-load-path (dirs)
  (mapc (lambda (dir)
    (let* ((default-directory dir))
      (setq load-path (cons dir load-path))
      (normal-top-level-add-subdirs-to-load-path)))
	dirs))

(pm/add-tree-to-load-path '("~/.emacs.d/config" "~/.emacs.d/packages"))

OTH,

  Maurizio





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

* Re: add directories to load-path
       [not found] ` <mailman.6765.1253076234.2239.help-gnu-emacs@gnu.org>
@ 2009-09-16  7:09   ` henry atting
  0 siblings, 0 replies; 16+ messages in thread
From: henry atting @ 2009-09-16  7:09 UTC (permalink / raw)
  To: help-gnu-emacs

On Di, Sep 15 2009, Gnutux wrote:

> That should do the job. :-)
>
> ; Load recursively a folder
> (defconst elisp-path '("~/.emacs.d"))
> (mapcar '(lambda(p)
>            (add-to-list 'load-path p)
>            (cd p) (normal-top-level-add-subdirs-to-load-path)) elisp-path)
>
>

You made your point absolutely clear ;)

Thanks to all

henry

-- 
http://literaturlatenight.de


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

* Re: add directories to load-path
       [not found] ` <mailman.6708.1253017158.2239.help-gnu-emacs@gnu.org>
@ 2009-10-12  3:24   ` David Combs
  2009-10-12 11:40     ` Richard Riley
  2009-10-13  7:12     ` Tim X
  0 siblings, 2 replies; 16+ messages in thread
From: David Combs @ 2009-10-12  3:24 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.6708.1253017158.2239.help-gnu-emacs@gnu.org>,
Maurizio Vitale  <maurizio.vitale@polymath-solutions.com> wrote:
>>>>>> "henry" == henry atting <nsmp_01@online.de> writes:
>
>    henry> How can I add directories to the load-path *including* all
>    henry> subdirectories?
>
>    henry> At present I do it this way
>
>    henry> (setq load-path (append '( "/some/directory"
>    henry> "/some/directory/subdirectory") load-path))
>
>    henry> which is not very handy when a directory contains several
>    henry> different subdirectories with elisp files.
>
>I use this:
>
>(defun pm/add-tree-to-load-path (dirs)
>  (mapc (lambda (dir)
>    (let* ((default-directory dir))
>      (setq load-path (cons dir load-path))
>      (normal-top-level-add-subdirs-to-load-path)))
>	dirs))
>
>(pm/add-tree-to-load-path '("~/.emacs.d/config" "~/.emacs.d/packages"))

What's that slash after the pm?

First time I've seen a slash in the name of a function...

Thanks,

David




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

* Re: add directories to load-path
  2009-10-12  3:24   ` David Combs
@ 2009-10-12 11:40     ` Richard Riley
  2009-10-13  7:12     ` Tim X
  1 sibling, 0 replies; 16+ messages in thread
From: Richard Riley @ 2009-10-12 11:40 UTC (permalink / raw)
  To: help-gnu-emacs

dkcombs@panix.com (David Combs) writes:

> In article <mailman.6708.1253017158.2239.help-gnu-emacs@gnu.org>,
> Maurizio Vitale  <maurizio.vitale@polymath-solutions.com> wrote:
>>>>>>> "henry" == henry atting <nsmp_01@online.de> writes:
>>
>>    henry> How can I add directories to the load-path *including* all
>>    henry> subdirectories?
>>
>>    henry> At present I do it this way
>>
>>    henry> (setq load-path (append '( "/some/directory"
>>    henry> "/some/directory/subdirectory") load-path))
>>
>>    henry> which is not very handy when a directory contains several
>>    henry> different subdirectories with elisp files.
>>
>>I use this:
>>
>>(defun pm/add-tree-to-load-path (dirs)
>>  (mapc (lambda (dir)
>>    (let* ((default-directory dir))
>>      (setq load-path (cons dir load-path))
>>      (normal-top-level-add-subdirs-to-load-path)))
>>	dirs))
>>
>>(pm/add-tree-to-load-path '("~/.emacs.d/config" "~/.emacs.d/packages"))
>
> What's that slash after the pm?

A slash.

>
> First time I've seen a slash in the name of a function...
>

Perfectly legal and often used to make functions more local/attributable e.g your own
functions might be

(defun dc/message(text)
...


> Thanks,
>
> David
>


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

* Re: add directories to load-path
  2009-10-12  3:24   ` David Combs
  2009-10-12 11:40     ` Richard Riley
@ 2009-10-13  7:12     ` Tim X
  1 sibling, 0 replies; 16+ messages in thread
From: Tim X @ 2009-10-13  7:12 UTC (permalink / raw)
  To: help-gnu-emacs

dkcombs@panix.com (David Combs) writes:

> In article <mailman.6708.1253017158.2239.help-gnu-emacs@gnu.org>,
> Maurizio Vitale  <maurizio.vitale@polymath-solutions.com> wrote:
>>>>>>> "henry" == henry atting <nsmp_01@online.de> writes:
>>
>>    henry> How can I add directories to the load-path *including* all
>>    henry> subdirectories?
>>
>>    henry> At present I do it this way
>>
>>    henry> (setq load-path (append '( "/some/directory"
>>    henry> "/some/directory/subdirectory") load-path))
>>
>>    henry> which is not very handy when a directory contains several
>>    henry> different subdirectories with elisp files.
>>
>>I use this:
>>
>>(defun pm/add-tree-to-load-path (dirs)
>>  (mapc (lambda (dir)
>>    (let* ((default-directory dir))
>>      (setq load-path (cons dir load-path))
>>      (normal-top-level-add-subdirs-to-load-path)))
>>	dirs))
>>
>>(pm/add-tree-to-load-path '("~/.emacs.d/config" "~/.emacs.d/packages"))
>
> What's that slash after the pm?
>
> First time I've seen a slash in the name of a function...
>

Its nothing *special* - just a style choice. Last time I looked, eshell
used this style quite a bit. It has no special meaning to elisp - just
another legal character that can be used in names.

Tim

-- 
tcross (at) rapttech dot com dot au


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

end of thread, other threads:[~2009-10-13  7:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15  5:36 add directories to load-path henry atting
2009-09-15  6:24 ` Gnutux
2009-09-15  6:24 ` Gnutux
2009-09-15  7:10 ` Gnutux
2009-09-15  7:22 ` Gnutux
2009-09-15 10:56 ` Bernardo
2009-09-15 11:05 ` Florian Kaufmann
2009-09-15 11:16 ` Gnutux
2009-09-15 11:29 ` Gnutux
2009-09-15 11:33 ` Gnutux
2009-09-15 11:52 ` Gnutux
2009-09-15 12:24 ` Maurizio Vitale
     [not found] ` <mailman.6765.1253076234.2239.help-gnu-emacs@gnu.org>
2009-09-16  7:09   ` henry atting
     [not found] ` <mailman.6708.1253017158.2239.help-gnu-emacs@gnu.org>
2009-10-12  3:24   ` David Combs
2009-10-12 11:40     ` Richard Riley
2009-10-13  7:12     ` Tim X

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.