all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Francesco Lazzarino" <flazzarino@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: bug#1555: OSX Emacs.app not containing enough paths (emacs lisp fix included)
Date: Fri, 12 Dec 2008 16:12:40 -0500	[thread overview]
Message-ID: <8574d28f0812121312q71d4c255wa849a4f0639d1925@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 3331 bytes --]

             reply	other threads:[~2008-12-12 21:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2C9FF472-FCE0-4CCA-B84C-2505BC87F037@gmail.com>
2008-12-12 21:12 ` Francesco Lazzarino [this message]
2008-12-13 19:42   ` bug#1555: OSX Emacs.app not containing enough paths (emacs lisp fix included) David Reitter
2009-01-19 19:00   ` bug#1555: marked as done (OSX Emacs.app not containing enough paths (emacs lisp fix included)) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8574d28f0812121312q71d4c255wa849a4f0639d1925@mail.gmail.com \
    --to=flazzarino@gmail.com \
    --cc=1555@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.