unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* getenv behavior or bug
@ 2011-02-28 16:25 Thierry Volpiatto
  2011-02-28 16:38 ` Andreas Schwab
  2011-02-28 16:39 ` Harald Hanche-Olsen
  0 siblings, 2 replies; 7+ messages in thread
From: Thierry Volpiatto @ 2011-02-28 16:25 UTC (permalink / raw)
  To: emacs-devel

Hi,
(getenv "HOSTNAME") returns nil both on 23 and 24 branch, is this normal
or a bug?

In M-x shell, echo $HOSTNAME returns what expected, idem for uname -n.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* Re: getenv behavior or bug
  2011-02-28 16:25 getenv behavior or bug Thierry Volpiatto
@ 2011-02-28 16:38 ` Andreas Schwab
  2011-02-28 16:39 ` Harald Hanche-Olsen
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2011-02-28 16:38 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> (getenv "HOSTNAME") returns nil both on 23 and 24 branch, is this normal
> or a bug?

Does Emacs's environment include an entry for HOSTNAME?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: getenv behavior or bug
  2011-02-28 16:25 getenv behavior or bug Thierry Volpiatto
  2011-02-28 16:38 ` Andreas Schwab
@ 2011-02-28 16:39 ` Harald Hanche-Olsen
  2011-02-28 18:03   ` Thierry Volpiatto
  1 sibling, 1 reply; 7+ messages in thread
From: Harald Hanche-Olsen @ 2011-02-28 16:39 UTC (permalink / raw)
  To: thierry.volpiatto; +Cc: emacs-devel

[Thierry Volpiatto <thierry.volpiatto@gmail.com> (2011-02-28 16:25:56 UTC)]

> (getenv "HOSTNAME") returns nil both on 23 and 24 branch, is this
> normal or a bug?

Emacs doesn't try to set this environment variable if it is not
already set. So presumably whatever process you use to start your
emacs from doesn't have it.

> In M-x shell, echo $HOSTNAME returns what expected, idem for uname -n.

I guess that is done somewhere in your shell startup files, or maybe
the global one. M-x shell runs a login shell after all.

- Harald



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

* Re: getenv behavior or bug
  2011-02-28 16:39 ` Harald Hanche-Olsen
@ 2011-02-28 18:03   ` Thierry Volpiatto
  2011-02-28 18:33     ` Harald Hanche-Olsen
  0 siblings, 1 reply; 7+ messages in thread
From: Thierry Volpiatto @ 2011-02-28 18:03 UTC (permalink / raw)
  To: Harald Hanche-Olsen; +Cc: emacs-devel

Harald Hanche-Olsen <hanche@math.ntnu.no> writes:

> [Thierry Volpiatto <thierry.volpiatto@gmail.com> (2011-02-28 16:25:56 UTC)]
>
>> (getenv "HOSTNAME") returns nil both on 23 and 24 branch, is this
>> normal or a bug?
>
> Emacs doesn't try to set this environment variable if it is not
> already set. So presumably whatever process you use to start your
> emacs from doesn't have it.
Thanks for answer,
So what's the environment variables emacs set on startup?

>> In M-x shell, echo $HOSTNAME returns what expected, idem for uname -n.
>
> I guess that is done somewhere in your shell startup files, or maybe
> the global one. M-x shell runs a login shell after all.
>
> - Harald

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: getenv behavior or bug
  2011-02-28 18:03   ` Thierry Volpiatto
@ 2011-02-28 18:33     ` Harald Hanche-Olsen
  2011-02-28 22:18       ` Thierry Volpiatto
  2011-03-01 19:40       ` Thierry Volpiatto
  0 siblings, 2 replies; 7+ messages in thread
From: Harald Hanche-Olsen @ 2011-02-28 18:33 UTC (permalink / raw)
  To: thierry.volpiatto; +Cc: emacs-devel

[Thierry Volpiatto <thierry.volpiatto@gmail.com> (2011-02-28 18:03:13 UTC)]

> Thanks for answer,
> So what's the environment variables emacs set on startup?

Not very many. Perhaps none. You can find out yourself: Just run

  env - /usr/bin/emacs -q --batch --eval '(pp process-environment)'

from the command line. Replace /usr/bin/emacs by the absolute path to
your emacs; with an empty environment, the emacs executable can't be
found outherwise. The standard emacs on one ubuntu system I have
access to, prints just nil in response. (If I redirect stderr to
/dev/null that is.)

- Harald



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

* Re: getenv behavior or bug
  2011-02-28 18:33     ` Harald Hanche-Olsen
@ 2011-02-28 22:18       ` Thierry Volpiatto
  2011-03-01 19:40       ` Thierry Volpiatto
  1 sibling, 0 replies; 7+ messages in thread
From: Thierry Volpiatto @ 2011-02-28 22:18 UTC (permalink / raw)
  To: emacs-devel

Harald Hanche-Olsen <hanche@math.ntnu.no> writes:

> [Thierry Volpiatto <thierry.volpiatto@gmail.com> (2011-02-28 18:03:13 UTC)]
>
>> Thanks for answer,
>> So what's the environment variables emacs set on startup?
>
> Not very many. Perhaps none. You can find out yourself: Just run
>
>   env - /usr/bin/emacs -q --batch --eval '(pp process-environment)'
>
> from the command line. Replace /usr/bin/emacs by the absolute path to
> your emacs; with an empty environment, the emacs executable can't be
> found outherwise. The standard emacs on one ubuntu system I have
> access to, prints just nil in response. (If I redirect stderr to
> /dev/null that is.)
Yes, i have nil also on ubuntu. (with and without redirecting stderr to
/dev/null)

Thanks for this info about process-environment.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* Re: getenv behavior or bug
  2011-02-28 18:33     ` Harald Hanche-Olsen
  2011-02-28 22:18       ` Thierry Volpiatto
@ 2011-03-01 19:40       ` Thierry Volpiatto
  1 sibling, 0 replies; 7+ messages in thread
From: Thierry Volpiatto @ 2011-03-01 19:40 UTC (permalink / raw)
  To: Harald Hanche-Olsen; +Cc: emacs-devel

Harald Hanche-Olsen <hanche@math.ntnu.no> writes:

> [Thierry Volpiatto <thierry.volpiatto@gmail.com> (2011-02-28 18:03:13 UTC)]
>
>> Thanks for answer,
>> So what's the environment variables emacs set on startup?
>
> Not very many. Perhaps none. You can find out yourself: Just run
>
>   env - /usr/bin/emacs -q --batch --eval '(pp process-environment)'
>
> from the command line. Replace /usr/bin/emacs by the absolute path to
> your emacs; with an empty environment, the emacs executable can't be
> found outherwise. The standard emacs on one ubuntu system I have
> access to, prints just nil in response. (If I redirect stderr to
> /dev/null that is.)

For a final note, just found that `system-name' return $HOSTNAME, it is
used by `emacs-version'.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

end of thread, other threads:[~2011-03-01 19:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-28 16:25 getenv behavior or bug Thierry Volpiatto
2011-02-28 16:38 ` Andreas Schwab
2011-02-28 16:39 ` Harald Hanche-Olsen
2011-02-28 18:03   ` Thierry Volpiatto
2011-02-28 18:33     ` Harald Hanche-Olsen
2011-02-28 22:18       ` Thierry Volpiatto
2011-03-01 19:40       ` Thierry Volpiatto

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).