all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* exec path
@ 2013-08-21  8:28 Klaus Jantzen
  2013-08-21  8:46 ` Peter Dyballa
  0 siblings, 1 reply; 19+ messages in thread
From: Klaus Jantzen @ 2013-08-21  8:28 UTC (permalink / raw)
  To: emacs-list

Hi,

I am using 'call-process' in an emacs macro to call perl-scripts.

With emacs under Lenny that worked perfectly.
Under Wheezy emacs23 does not find the scripts and, judging by what I 
find in 'Exec Path'
(customization group 'Processes'), that is understandable because the 
exec path does not
correspond to what is specified in the environment variable  $PATH.

It says in that customization group that one should not modify the 
entries in Exec Path
because that is unreliable.
How then can I make emacs use $PATH?

Thank you for any hints.

K.D.J.



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

* Re: exec path
  2013-08-21  8:28 exec path Klaus Jantzen
@ 2013-08-21  8:46 ` Peter Dyballa
  2013-08-22  8:28   ` Klaus Jantzen
  0 siblings, 1 reply; 19+ messages in thread
From: Peter Dyballa @ 2013-08-21  8:46 UTC (permalink / raw)
  To: Klaus Jantzen; +Cc: emacs-list


Am 21.08.2013 um 10:28 schrieb Klaus Jantzen:

> How then can I make emacs use $PATH?

A shell process is used to launch GNU Emacs as X client. This shell is not a login shell. Depending on the kind of shell used, just read its documentation where you'll find the name of the file initialising that shell. For bash this is likely ~/.bashrc…

For testing you can temporarily add some statements to the ini files that they create files in which they record that it was this or that ini file and it had a particular PID or whatever.

--
Mit friedvollen Grüßen

  Pete

Irgendwer sollte den Kugelschreiber mit einem Kleiderbügel kreuzen, dass die Kulis sich vermehren, statt stets nur zu verschwinden!




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

* Re: exec path
  2013-08-21  8:46 ` Peter Dyballa
@ 2013-08-22  8:28   ` Klaus Jantzen
  2013-08-22 10:51     ` Peter Dyballa
  2013-08-22 14:40     ` Stefan Monnier
  0 siblings, 2 replies; 19+ messages in thread
From: Klaus Jantzen @ 2013-08-22  8:28 UTC (permalink / raw)
  To: Peter Dyballa, emacs-list

On 08/21/2013 10:46 AM, Peter Dyballa wrote:
> Am 21.08.2013 um 10:28 schrieb Klaus Jantzen:
>
>> How then can I make emacs use $PATH?
> A shell process is used to launch GNU Emacs as X client. This shell is not a login shell. Depending on the kind of shell used, just read its documentation where you'll find the name of the file initialising that shell. For bash this is likely ~/.bashrc…

The problem is not that I don't know how and where to define PATH
but that my definition of PATH is not found/used by emacs23.

>
> For testing you can temporarily add some statements to the ini files that they create files in which they record that it was this or that ini file and it had a particular PID or whatever.
>
> --
> Mit friedvollen Grüßen
>
>    Pete
>
> Irgendwer sollte den Kugelschreiber mit einem Kleiderbügel kreuzen, dass die Kulis sich vermehren, statt stets nur zu verschwinden!
>
>
K.D.J.



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

* Re: exec path
  2013-08-22  8:28   ` Klaus Jantzen
@ 2013-08-22 10:51     ` Peter Dyballa
  2013-08-22 17:11       ` Klaus Jantzen
  2013-08-22 14:40     ` Stefan Monnier
  1 sibling, 1 reply; 19+ messages in thread
From: Peter Dyballa @ 2013-08-22 10:51 UTC (permalink / raw)
  To: Klaus Jantzen; +Cc: emacs-list


Am 22.08.2013 um 10:28 schrieb Klaus Jantzen:

> The problem is not that I don't know how and where to define PATH
> but that my definition of PATH is not found/used by emacs23.

So find out the precise mechanism by which GNU Emacs gets launched!

In my GNU Emacs 23.4 exec-path is $PATH + "/usr/local/libexec/emacs/23.4/x86_64-apple-darwin10.8.0".

Have you tried to launch GNU Emacs with -Q, i.e., without any customisation? And also with -q, which means only system-wide customisation? Any differences? What is the difference to the value when GNU Emacs is launched the usual way?

--
Mit friedvollen Grüßen

  Pete

Der größte Aberglaube der Gegenwart ist der Glaube an die Vorfahrt.
				(Jacques Tati)




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

* Re: exec path
  2013-08-22  8:28   ` Klaus Jantzen
  2013-08-22 10:51     ` Peter Dyballa
@ 2013-08-22 14:40     ` Stefan Monnier
  1 sibling, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2013-08-22 14:40 UTC (permalink / raw)
  To: help-gnu-emacs

> The problem is not that I don't know how and where to define PATH
> but that my definition of PATH is not found/used by emacs23.

Same difference: the place where you currently define PATH is apparently
not consulted by the script/program that launches your Emacs.
Which means you need to set your PATH elsewhere.

Emacs just uses whichever value of $PATH it receives from its parent process.


        Stefan




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

* Re: exec path
  2013-08-22 10:51     ` Peter Dyballa
@ 2013-08-22 17:11       ` Klaus Jantzen
  2013-08-22 19:42         ` Andreas Röhler
  2013-08-26  7:40         ` Richard Riley
  0 siblings, 2 replies; 19+ messages in thread
From: Klaus Jantzen @ 2013-08-22 17:11 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: emacs-list

On 08/22/2013 12:51 PM, Peter Dyballa wrote:
> Am 22.08.2013 um 10:28 schrieb Klaus Jantzen:
>
>> The problem is not that I don't know how and where to define PATH
>> but that my definition of PATH is not found/used by emacs23.
> So find out the precise mechanism by which GNU Emacs gets launched!
>
> In my GNU Emacs 23.4 exec-path is $PATH + "/usr/local/libexec/emacs/23.4/x86_64-apple-darwin10.8.0".
>
> Have you tried to launch GNU Emacs with -Q, i.e., without any customisation? And also with -q, which means only system-wide customisation? Any differences? What is the difference to the value when GNU Emacs is launched the usual way?
>    

When launching emacs with -Q/-q exec path contains
$PATH + "/usr/lib/emacs/23.4/x86_64-linux-gnu"

This means that the initialization is messing up 'exec path'.
Any idea?
>
> --
> Mit friedvollen Grüßen
>
>    Pete
>
> Der größte Aberglaube der Gegenwart ist der Glaube an die Vorfahrt.
> 				(Jacques Tati)
>
>
K.D.J.



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

* Re: exec path
  2013-08-22 17:11       ` Klaus Jantzen
@ 2013-08-22 19:42         ` Andreas Röhler
  2013-08-22 20:36           ` Peter Dyballa
       [not found]           ` <mailman.594.1377203837.10748.help-gnu-emacs@gnu.org>
  2013-08-26  7:40         ` Richard Riley
  1 sibling, 2 replies; 19+ messages in thread
From: Andreas Röhler @ 2013-08-22 19:42 UTC (permalink / raw)
  To: help-gnu-emacs

Am 22.08.2013 19:11, schrieb Klaus Jantzen:
> On 08/22/2013 12:51 PM, Peter Dyballa wrote:
>> Am 22.08.2013 um 10:28 schrieb Klaus Jantzen:
>>
>>> The problem is not that I don't know how and where to define PATH
>>> but that my definition of PATH is not found/used by emacs23.
>> So find out the precise mechanism by which GNU Emacs gets launched!
>>
>> In my GNU Emacs 23.4 exec-path is $PATH + "/usr/local/libexec/emacs/23.4/x86_64-apple-darwin10.8.0".
>>
>> Have you tried to launch GNU Emacs with -Q, i.e., without any customisation? And also with -q, which means only system-wide customisation? Any differences? What is the
>> difference to the value when GNU Emacs is launched the usual way?
>
> When launching emacs with -Q/-q exec path contains
> $PATH + "/usr/lib/emacs/23.4/x86_64-linux-gnu"
>
> This means that the initialization is messing up 'exec path'.
> Any idea?
>>
>> --
>> Mit friedvollen Grüßen
>>
>>    Pete
>>
>> Der größte Aberglaube der Gegenwart ist der Glaube an die Vorfahrt.
>>                 (Jacques Tati)
>>
>>
> K.D.J.
>
>

exec-path might not be identic with $PATH if Emacs started from an X-environment.
Open a shell and start Emacs from there.

HTH,

Andreas





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

* Re: exec path
  2013-08-22 19:42         ` Andreas Röhler
@ 2013-08-22 20:36           ` Peter Dyballa
       [not found]           ` <mailman.594.1377203837.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 19+ messages in thread
From: Peter Dyballa @ 2013-08-22 20:36 UTC (permalink / raw)
  To: emacs-list Help


Am 22.08.2013 19:11, schrieb Klaus Jantzen:

>> When launching emacs with -Q/-q exec path contains
>> $PATH + "/usr/lib/emacs/23.4/x86_64-linux-gnu"
>> 
>> This means that the initialization is messing up 'exec path'.
>> Any idea?

How did you launch GNU Emacs with -q or -Q? Did you use the same method as is used for the GNU Emacs with faulty exec-path? It is rather clear that you need to use the same method when you're not able to determine how this method actually works and is possible having some potential influence on exec-path, because launching "emacs" or "emacs -q" or "emacs -Q" from some shell is likely to produce a GNU Emacs with correct exec-path.

If you think that your init file is changing exec-path, then search for the string "exec-path" in that file with GNU Emacs' isearch! And then make those statements comments with a comment why they are now comments!

--
Mit friedvollen Grüßen

  Pete

Time flies like an error – but fruit flies like a banana!
				- (almost) Groucho Marx




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

* Re: exec path
       [not found]           ` <mailman.594.1377203837.10748.help-gnu-emacs@gnu.org>
@ 2013-08-23 16:57             ` Rami A
  2013-08-23 17:45               ` Eli Zaretskii
       [not found]               ` <mailman.646.1377279939.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 19+ messages in thread
From: Rami A @ 2013-08-23 16:57 UTC (permalink / raw)
  To: help-gnu-emacs

I am in the same boat.
I have exec-path including the bin directory I have my scripts in but then doing:
M-x compile then echo $PATH I don't see that directory.
Trying to start any of the scripts by doing M-x compile then "script_name" will prompt emacs to recognize the command.
I also tried adding to $PATH from my .emscs file but that did not work as well.
So this did not work:
(setenv "PATH" (concat (getenv "PATH") ":" (expand-file-name "~/mybin")))
(setq exec-path (append exec-path (list (expand-file-name "~/mybin")))

Any pointers?


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

* Re: exec path
  2013-08-23 16:57             ` Rami A
@ 2013-08-23 17:45               ` Eli Zaretskii
       [not found]               ` <mailman.646.1377279939.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 19+ messages in thread
From: Eli Zaretskii @ 2013-08-23 17:45 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 23 Aug 2013 09:57:52 -0700 (PDT)
> From: Rami A <rami.ammari@gmail.com>
> Injection-Date: Fri, 23 Aug 2013 16:57:53 +0000
> 
> I am in the same boat.
> I have exec-path including the bin directory I have my scripts in but then doing:
> M-x compile then echo $PATH I don't see that directory.
> Trying to start any of the scripts by doing M-x compile then "script_name" will prompt emacs to recognize the command.
> I also tried adding to $PATH from my .emscs file but that did not work as well.
> So this did not work:
> (setenv "PATH" (concat (getenv "PATH") ":" (expand-file-name "~/mybin")))
> (setq exec-path (append exec-path (list (expand-file-name "~/mybin")))
> 
> Any pointers?

Set up your PATH outside Emacs to include that "bin directory you have
your scripts in", and Bob's your uncle.

Having exec-path and PATH different is asking for trouble, because
some Emacs commands go through the shell (which looks at PATH), while
others invoke programs directly using exec-path.  If you care about
your sanity, don't ever let these two be out of sync.



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

* Re: exec path
       [not found]               ` <mailman.646.1377279939.10748.help-gnu-emacs@gnu.org>
@ 2013-08-23 19:21                 ` Rami A
  2013-08-23 21:39                   ` Peter Dyballa
       [not found]                   ` <mailman.663.1377294001.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 19+ messages in thread
From: Rami A @ 2013-08-23 19:21 UTC (permalink / raw)
  To: help-gnu-emacs

The problem is that the shell $PATH "does" include the bin path.
When starting an eshell in emacs it does print $PATH as in the unix shell.
However, echoing the $PATH from M-! "echo $PATH" or M-x compile "echo $PATH" both print a subset of the shell $PATH.



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

* Re: exec path
  2013-08-23 19:21                 ` Rami A
@ 2013-08-23 21:39                   ` Peter Dyballa
       [not found]                   ` <mailman.663.1377294001.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 19+ messages in thread
From: Peter Dyballa @ 2013-08-23 21:39 UTC (permalink / raw)
  To: Rami A; +Cc: help-gnu-emacs


Am 23.08.2013 um 21:21 schrieb Rami A:

> The problem is that the shell $PATH "does" include the bin path.
> When starting an eshell in emacs it does print $PATH as in the unix shell.
> However, echoing the $PATH from M-! "echo $PATH" or M-x compile "echo $PATH" both print a subset of the shell $PATH.
> 

Which clearly states that these shells you mention either get initialised as if they were interactive or login shells or read you hacked variables while the shell to spawn GNU Emacs is not of this kind.

Why is this so?

On Mac OS X the answers (or causes) are quite clear… (And once you know them you can circumvent them in each instance.)

--
Greetings

  Pete

There is no national science just as there is no national multiplication table; what is national is no longer science.
				– Anton Checov




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

* Re: exec path
       [not found]                   ` <mailman.663.1377294001.10748.help-gnu-emacs@gnu.org>
@ 2013-08-23 22:35                     ` Rami A
  2013-08-24  0:14                       ` Thien-Thi Nguyen
  0 siblings, 1 reply; 19+ messages in thread
From: Rami A @ 2013-08-23 22:35 UTC (permalink / raw)
  To: help-gnu-emacs

I found out that emacs can't parse some strings in my aliases file which gets sourced when an xterm starts.
Took off these parts and now the path is complete within emacs.


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

* Re: exec path
  2013-08-23 22:35                     ` Rami A
@ 2013-08-24  0:14                       ` Thien-Thi Nguyen
  0 siblings, 0 replies; 19+ messages in thread
From: Thien-Thi Nguyen @ 2013-08-24  0:14 UTC (permalink / raw)
  To: Rami A; +Cc: help-gnu-emacs

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

() Rami A <rami.ammari@gmail.com>
() Fri, 23 Aug 2013 15:35:38 -0700 (PDT)

   I found out that emacs can't parse some strings in my aliases file
   which gets sourced when an xterm starts.

What are these strings?  How does Emacs fail?  How did you detect that?
(We can try to make Emacs more robust under such conditions, w/ more info.)

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: exec path
  2013-08-22 17:11       ` Klaus Jantzen
  2013-08-22 19:42         ` Andreas Röhler
@ 2013-08-26  7:40         ` Richard Riley
  2013-08-27 23:54           ` Suvayu Ali
  1 sibling, 1 reply; 19+ messages in thread
From: Richard Riley @ 2013-08-26  7:40 UTC (permalink / raw)
  To: help-gnu-emacs

Klaus Jantzen <k.d.jantzen@t-online.de> writes:

> On 08/22/2013 12:51 PM, Peter Dyballa wrote:
>> Am 22.08.2013 um 10:28 schrieb Klaus Jantzen:
>>
>>> The problem is not that I don't know how and where to define PATH
>>> but that my definition of PATH is not found/used by emacs23.
>> So find out the precise mechanism by which GNU Emacs gets launched!
>>
>> In my GNU Emacs 23.4 exec-path is $PATH + "/usr/local/libexec/emacs/23.4/x86_64-apple-darwin10.8.0".
>>
>> Have you tried to launch GNU Emacs with -Q, i.e., without any customisation?
>> And also with -q, which means only system-wide customisation? Any differences?
>> What is the difference to the value when GNU Emacs is launched the usual way?
>>    
>
> When launching emacs with -Q/-q exec path contains
> $PATH + "/usr/lib/emacs/23.4/x86_64-linux-gnu"
>
> This means that the initialization is messing up 'exec path'.
> Any idea?
>>
>> --
>> Mit friedvollen Grüßen
>>
>>    Pete
>>
>> Der größte Aberglaube der Gegenwart ist der Glaube an die Vorfahrt.
>> 				(Jacques Tati)
>>
>>
> K.D.J.
>
>
>

import your bashrc or bash_env wherever your $PATH is set into
.bash_profile


if [ -f ~/.bashrc ]; then
     . ~/.bashrc
fi

-- 
Sent using Emacs/Gnus from home ...




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

* Re: exec path
  2013-08-26  7:40         ` Richard Riley
@ 2013-08-27 23:54           ` Suvayu Ali
  2013-08-28  1:58             ` Stefan Monnier
  2013-08-28  9:56             ` Peter Dyballa
  0 siblings, 2 replies; 19+ messages in thread
From: Suvayu Ali @ 2013-08-27 23:54 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Aug 26, 2013 at 09:40:27AM +0200, Richard Riley wrote:
> 
> import your bashrc or bash_env wherever your $PATH is set into
> .bash_profile
> 
> 
> if [ -f ~/.bashrc ]; then
>      . ~/.bashrc
> fi

The OP is on a Mac.  I'm not sure Macs respect the rule: source the
profile file at login.

-- 
Suvayu

Open source is the future. It sets us free.



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

* Re: exec path
  2013-08-27 23:54           ` Suvayu Ali
@ 2013-08-28  1:58             ` Stefan Monnier
  2013-08-28  9:56             ` Peter Dyballa
  1 sibling, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2013-08-28  1:58 UTC (permalink / raw)
  To: help-gnu-emacs

> The OP is on a Mac.  I'm not sure Macs respect the rule: source the
> profile file at login.

Most graphical logins don't follow that rule, sadly.


        Stefan




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

* Re: exec path
  2013-08-27 23:54           ` Suvayu Ali
  2013-08-28  1:58             ` Stefan Monnier
@ 2013-08-28  9:56             ` Peter Dyballa
  2013-08-28 10:06               ` Neuwirth Erich
  1 sibling, 1 reply; 19+ messages in thread
From: Peter Dyballa @ 2013-08-28  9:56 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: help-gnu-emacs


Am 28.08.2013 um 01:54 schrieb Suvayu Ali:

> The OP is on a Mac.  I'm not sure Macs respect the rule: source the
> profile file at login.

It does. The problem is that Mac OS X windowing applications are not launched from a shell. So these processes can't inherit what's not there.

PATH and MANPATH can be set up by putting small files containing the path to the executables or the man directory into the directories /private/etc/paths.d resp. /private/etc/manpaths.d. The name of the files should give some good hint what they are about (I have for example "X11", "MacGPG2", "40-XQuartz", …). These files plus /private/etc/paths resp. /private/etc/manpaths set up PATH resp. MANPATH for processes launched by Mac OS X.

--
Greetings

  Pete

If you're not confused, you're not paying attention.




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

* Re: exec path
  2013-08-28  9:56             ` Peter Dyballa
@ 2013-08-28 10:06               ` Neuwirth Erich
  0 siblings, 0 replies; 19+ messages in thread
From: Neuwirth Erich @ 2013-08-28 10:06 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

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

This:
http://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications
has a description how to change the info.plist of an Application
to add or modify (among other things) Environment variables for this Application.


On Aug 28, 2013, at 11:56 AM, Peter Dyballa <Peter_Dyballa@Web.DE> wrote:

> 
> Am 28.08.2013 um 01:54 schrieb Suvayu Ali:
> 
>> The OP is on a Mac.  I'm not sure Macs respect the rule: source the
>> profile file at login.
> 
> It does. The problem is that Mac OS X windowing applications are not launched from a shell. So these processes can't inherit what's not there.
> 
> PATH and MANPATH can be set up by putting small files containing the path to the executables or the man directory into the directories /private/etc/paths.d resp. /private/etc/manpaths.d. The name of the files should give some good hint what they are about (I have for example "X11", "MacGPG2", "40-XQuartz", …). These files plus /private/etc/paths resp. /private/etc/manpaths set up PATH resp. MANPATH for processes launched by Mac OS X.
> 
> --
> Greetings
> 
>  Pete
> 
> If you're not confused, you're not paying attention.
> 
> 


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 1422 bytes --]

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

end of thread, other threads:[~2013-08-28 10:06 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21  8:28 exec path Klaus Jantzen
2013-08-21  8:46 ` Peter Dyballa
2013-08-22  8:28   ` Klaus Jantzen
2013-08-22 10:51     ` Peter Dyballa
2013-08-22 17:11       ` Klaus Jantzen
2013-08-22 19:42         ` Andreas Röhler
2013-08-22 20:36           ` Peter Dyballa
     [not found]           ` <mailman.594.1377203837.10748.help-gnu-emacs@gnu.org>
2013-08-23 16:57             ` Rami A
2013-08-23 17:45               ` Eli Zaretskii
     [not found]               ` <mailman.646.1377279939.10748.help-gnu-emacs@gnu.org>
2013-08-23 19:21                 ` Rami A
2013-08-23 21:39                   ` Peter Dyballa
     [not found]                   ` <mailman.663.1377294001.10748.help-gnu-emacs@gnu.org>
2013-08-23 22:35                     ` Rami A
2013-08-24  0:14                       ` Thien-Thi Nguyen
2013-08-26  7:40         ` Richard Riley
2013-08-27 23:54           ` Suvayu Ali
2013-08-28  1:58             ` Stefan Monnier
2013-08-28  9:56             ` Peter Dyballa
2013-08-28 10:06               ` Neuwirth Erich
2013-08-22 14:40     ` Stefan Monnier

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.