Re: Initial Paths Search

"David A. Cobb" <[email protected]>
Newsgroups gmane.emacs.xemacs.windows
Message-ID <[email protected]>
Adrian Aichner wrote:

>>>>>>"David" == David A Cobb <[email protected]> writes:
>>>>>>            
>>>>>>
>
>    David> Could you please advise me which lisp routines execute the startup
>    David> search for the load-path?
>
>See
>(defun paths-find-emacs-roots (root-p)
>and friends in
>lisp\setup-paths.el
>  
>
Well, actually in lisp\find-paths.el.  But I blundered my way around 
startup.el, find-paths.el, and UGH!! paths.el

Here's what I come up with.
;;; in startup.el, function 'normal-top-level . . .
    (setq default-directory (abbreviate-file-name default-directory))
    (initialize-xemacs-paths)                            ;;;; << This is 
just horrid [on a non-*nix system especially]

    (startup-set-invocation-environment)          ;;; here in 
startup.el, nothing useful

    (let ((debug-paths (or debug-paths
               (and (getenv "EMACSDEBUGPATHS")
                t))))

      (setq emacs-roots (paths-find-emacs-roots invocation-directory
                        invocation-name))
        ==> to find-paths.el.
        ;;; the only inputs used, other than the invocation-directory & 
-name are "configure-exec-prefix (== nil) and configure-prefix-directory 
(== "..\")

      (if debug-paths
      (princ (format "emacs-roots:\n%S\n" emacs-roots)
         'external-debugging-output))                                

      (if (null emacs-roots)
      (startup-find-roots-warning))                 ;;; << So, I'm 
doomed to a warning if I cannot get past this
      (startup-setup-paths emacs-roots           ;;; also here in startup.el
               user-init-directory
               inhibit-early-packages
               inhibit-site-lisp
               debug-paths)
      ====> to startup-setup-paths.  I'm excited to learn that it is 
idempotent -- I've never actually found a reason to use that word before!
For my purposes, the important thing is that it goes right to work on 
the package-paths.  After that, it calls . . .

        (setq lisp-directory (paths-find-lisp-directory roots)) ;;; Ah, 
that's in setup-paths.el
 calls    >>(paths-find-version-directory roots "lisp"  nil  
configure-lisp-directory)  ;;; Back to find-paths.el
 which calls >>> (paths-find-emacs-directory                  ;;; well, 
paths-find-emacs-directory knows how to use environment var's, but all 
it gets passed is an arg.'nil

By now, I'm a dead duck.
If I follow the logic, startup-setup-paths would be better calling 
paths-find-lisp-directory BEFORE messing about with the package 
hierarchy - to get the primary lisp directory in place.
And, again with only a cursory examination, paths-find-version-directory 
should be called with envvar="EMACSLOADPATH"

Of course, it could also be made to work if I could figure how to make 
the windows version follow a windows shortcut in "chase-symlink".

Any solution, sadly, touches on a dumped routine.  My score at building 
my own is running a dead 'nil at this time.

=
And, Adrian, thanks greatly for the patience.  I know the answers are 
all here inside the beast -- just waiting to be found by the persistent 
and patient.


-- 
David A. Cobb, Software Engineer, Public Access Advocate
"By God's Grace, I am a Christian man; by my actions a great sinner." -- The Way of a Pilgrim: R.French, Tr.
Life is too short to tolerate crappy software!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.