From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Francesco Lazzarino" Newsgroups: gmane.emacs.bugs Subject: bug#1555: OSX Emacs.app not containing enough paths (emacs lisp fix included) Date: Fri, 12 Dec 2008 16:12:40 -0500 Message-ID: <8574d28f0812121312q71d4c255wa849a4f0639d1925@mail.gmail.com> Reply-To: Francesco Lazzarino , 1555@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_119255_9361416.1229116360255" X-Trace: ger.gmane.org 1229151523 28372 80.91.229.12 (13 Dec 2008 06:58:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Dec 2008 06:58:43 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 13 07:59:50 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LBOTc-0003mK-Mn for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Dec 2008 07:59:49 +0100 Original-Received: from localhost ([127.0.0.1]:37306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBOSR-0008Kc-9H for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Dec 2008 01:58:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBFUl-0007F2-1s for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2008 16:24:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBFUj-0007El-Ek for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2008 16:24:22 -0500 Original-Received: from [199.232.76.173] (port=45272 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBFUj-0007Eb-7q for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2008 16:24:21 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:40139) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LBFUi-0008To-I4 for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2008 16:24:20 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBCLOI71012060; Fri, 12 Dec 2008 13:24:18 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mBCLK4ca010871; Fri, 12 Dec 2008 13:20:04 -0800 X-Loop: don@donarmstrong.com Resent-From: "Francesco Lazzarino" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 12 Dec 2008 21:20:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1555 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12291163669288 (code B ref -1); Fri, 12 Dec 2008 21:20:04 +0000 X-Spam-Bayes: score:0.0000 Tokens: new, 65; hammy, 83; neutral, 61; spammy, 5. spammytokens:0.999-2--bare, 0.990-+--H*c:alternative, 0.987-1--kinda, 0.944-+--H*c:multipart, 0.863-+--UD:com hammytokens:0.000-+--emacs, 0.000-+--23.0.60, 0.000-+--23060, 0.000-+--UD:app, 0.000-+--emacsapp Original-Received: (at submit) by emacsbugs.donarmstrong.com; 12 Dec 2008 21:12:46 +0000 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBCLChBM009280 for ; Fri, 12 Dec 2008 13:12:44 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBFJS-0001cu-Sn for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2008 16:12:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBFJS-0001bo-5R for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2008 16:12:42 -0500 Original-Received: from [199.232.76.173] (port=58891 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBFJR-0001bd-TY for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2008 16:12:41 -0500 Original-Received: from yx-out-1718.google.com ([74.125.44.157]:52036) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBFJR-00072I-CD for bug-gnu-emacs@gnu.org; Fri, 12 Dec 2008 16:12:41 -0500 Original-Received: by yx-out-1718.google.com with SMTP id 34so773823yxf.66 for ; Fri, 12 Dec 2008 13:12:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=fjhnFl+qAAjhx29NqwiVZe9xMV6CmSycJw00PnDHu5Q=; b=viXK50vodyj+R9kUFE3vWJwwpUAGo15oyJT2oIs0+bvjYD+qZCw81WRMft43g+V6eF 7Xj7fXpgFCjY6zUBrS+MlbSFOl8QqlxPyDqInaOBUBggnRmT7to4UUffOT1nhxKi4jbr n+1ggbmG1z/RCnxx6hZtOFhAIl95D1vBsFgD0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=k83YQRoZRNYdkQ+v4hdOGVOsR/ecSOMzuZCZaXCGRzGNjv9bVV8sBteiLOXzcfjYM/ YzRwBv+Ur+Cp0uIFyhq54+BEymWm57TE/nzS5S36eZZ4gYSf4+5hhyU3OU8MRk+ELPnG gehBlj/w/joE5KgExg7WyUs8WKc9U3LmE/qEs= Original-Received: by 10.142.141.21 with SMTP id o21mr1514547wfd.205.1229116360267; Fri, 12 Dec 2008 13:12:40 -0800 (PST) Original-Received: by 10.142.178.3 with HTTP; Fri, 12 Dec 2008 13:12:40 -0800 (PST) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Fri, 12 Dec 2008 16:24:22 -0500 X-Mailman-Approved-At: Sat, 13 Dec 2008 01:58:31 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:23263 Archived-At: ------=_Part_119255_9361416.1229116360255 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_119255_9361416.1229116360255 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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
------=_Part_119255_9361416.1229116360255--