emacs-devel
[Top][All Lists]
Advanced

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

running ./temacs


From: Dan Nicolaescu
Subject: running ./temacs
Date: Wed, 17 Nov 2010 01:57:10 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Running just ./temacs is currently not very useful.
The first think it does when starting up is complain that /.emacs.d/ cannot be 
found.

M-: (getenv "HOME")
return nil

This is because `process-environment' is nil.

emacs.c contains this code:

  /* Initialize and GC-protect Vinitial_environment and
     Vprocess_environment before set_initial_environment fills them
     in.  */
  if (!initialized)
    syms_of_callproc ();
  /* egetenv is a pretty low-level facility, which may get called in
     many circumstances; it seems flimsy to put off initializing it
     until calling init_callproc.  */
  set_initial_environment ();

The first comment above seems to be contradicted by the code in
set_initial_environment that only initializes Vprocess_environment if
`initialized' is true (which is not when running just ./temacs):


void
set_initial_environment (void)
{
  register char **envp;
#ifdef CANNOT_DUMP
  Vprocess_environment = Qnil;
#else
  if (initialized)
#endif
    {
      for (envp = environ; *envp; envp++)
      Vprocess_environment = Fcons (build_string (*envp),
                                         Vprocess_environment);
      /* Ideally, the `copy' shouldn't be necessary, but it seems it's frequent
       to use `delete' and friends on process-environment.  */
      Vinitial_environment = Fcopy_sequence (Vprocess_environment);
    }
}

What is the intention here?

[Hacking around this so that Vprocess_environment is initialized when
not dumping makes ./temacs work correctly]




reply via email to

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