bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#1555: OSX Emacs.app not containing enough paths (emacs lisp fix incl


From: Francesco Lazzarino
Subject: bug#1555: OSX Emacs.app not containing enough paths (emacs lisp fix included)
Date: Fri, 12 Dec 2008 16:12:40 -0500

Emacs.app version 23.0.60 (9.0)

(getenv "PATH") 
    => bare minimum (/usr/bin:/bin:/usr/sbin:/sbin)

exec-path 
    => bare minimum but with /Applications/Emacs.app/Contents/MacOS/bin

OSX seems to keep paths in /etc/paths and files in /etc/paths.d, programs launched from Terminal seem to pick this up but Emacs.app is not loaded from terminal so the path is kinda small. the problem was interacting with other programs via m-!, eshell, etc.

this seems to fix it, not sure if it's the right way tho.

(setenv "PATH"
        (let ((osx-path-files
               (append (mapcar (lambda (x) (concat "/etc/paths.d/" x))
                               (delete ".." (delete "." (directory-files "/etc/paths.d"))))
                       '("/etc/paths")))
              (read-path-file
               (lambda (file)
                 (when (file-readable-p file)
                   (delete ""
                           (split-string (with-temp-buffer (insert-file-contents file)
                                                           (buffer-substring (point-min) (point-max)))
                                         "\n"))))))
          (mapconcat 'identity
                     (reverse (delete-dups (reverse
                                            (append (reduce 'append
                                                            (mapcar read-path-file osx-path-files))
                                                    (split-string (getenv "PATH") ":")))))
                     ":")))



--
franco

reply via email to

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