unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: CHENG Gao <chenggao@gmail.com>
Subject: Re: single init file/directory for windows and linux using version control svn or cvs
Date: Fri, 22 Sep 2006 22:31:59 +0800	[thread overview]
Message-ID: <m264fg2crk.fsf@eqiao.com> (raw)
In-Reply-To: ueju4m5l9.fsf@gnu.org

*On Fri, 22 Sep 2006 15:46:42 +0300
* Eli Zaretskii <eliz@gnu.org> climbed out of the dark hell and cried out:

>> IIRC, there is no fallback dir for HOME under GNU/Linux and BSD, and
>> user always (and should) know where HOME is. Why Windoze is so special
>> that a (or even some) fallback dir(s) is(are) provided?
>
> Because a GNU/Linux system _always_ has the HOME environment variable
> defined for every user, while a Windows system doesn't. So Emacs that
> runs on Windows needs to find some place to look for its per-user files
> if HOME is not defined; it cannot rely on the fact that HOME is _always_
> defined. By contrast, a GNU/Linux system where HOME is not defined is
> broken in many ways, so Emacs on GNU/Linux does not need to consider
> such a situation.

Yes I know. Windoze has its HOME, with name as HOMEPATH (for Windoze
XP). And you can always set HOME environment var.

>> Even Windoze users should know where HOME is.
>
> I hope by now you understand why they do NOT know. The notion of a HOME
> directory simply doesn't exist on Windows.
>
>> Maybe the clearer and simpler solution is to tell users to set HOME
>> dir explicitly in manual.
>
> That's not a good idea, since one needs a working Emacs to read the
> manual.

Emacs does not need .emacs to work. Without .emacs, you have a barebone
emacs, and you can read Info.

>
>> If a user can not handle HOME thing, my suggestion is DONT use Emacs.
>> notepad.exe is better choice.
>
> Why treat users harshly when we can solve the issue in the code. As we
> have, actually, which is why I think it's pointless to discuss such
> suggestions now.
Sorry I dont mean to be harsh.

I just think things are getting complicated for NT Emacs.

CVS Emacs (HEAD and unicode-2 branch) does not add any registry item
now. As I read in addpm.c, 
,----
| 
|   /* Previous versions relied on registry settings, but we do not need
|      them any more.  If registry settings are installed from a previous
|      version, replace them to ensure they are the current settings.
|      Otherwise, do nothing.  */
`----

so addpm only updates existed registry items for upgrading installation,
and wont add registry for fresh installation. Personally I think
avoiding registry is very good decision.

So why should NT Emacs depend on registry items as APPDATA or HOMEPATH? It
seems contradictory to what new way addpm.c follows. 

And providing fallbacks to HOME in Windoze seems very bizarre. 

As I read from Info:
,----
| G.4 HOME Directory on MS-Windows
| ================================
| 
| The Windows equivalent of the `HOME' directory is the "user-specific
| application data directory".  The actual location depends on your
| Windows version and system configuration; typical values are
| `C:\Documents and Settings\USERNAME\Application Data' on Windows 2K/XP
| and later, and either `C:\WINDOWS\Application Data' or
| `C:\WINDOWS\Profiles\USERNAME\Application Data' on the older Windows
| 9X/ME systems.
| 
|    The home directory is where your init file `.emacs' is stored.  When
| Emacs starts, it first checks whether the environment variable `HOME'
| is set.  If it is, it looks for the init file in the directory pointed
| by `HOME'.  If `HOME' is not defined, Emacs checks for an existing
| `.emacs' file in `C:\', the root directory of drive `C:'(1).  If
| there's no such file in `C:\', Emacs next uses the Windows system calls
| to find out the exact location of your application data directory.  If
| that fails as well, Emacs falls back to `C:\'.
`----

So many dirs are scanned for .emacs (or .emacs.el or _emacs or
./emacs.d/init.el etc). 

My logics is for a dont-know-nothing-about-emacs user, he may have a
fresh installation of Emacs, and is it possile that there is some .emacs
file miraculously showing in any OPTIONAL PLACE GOOD FOR Emacs INIT
FILE? I dont think so. He still need edit a .emacs and put somewhere. He
may be happy if he finds he can place it anywhere (as allowed). Maybe he
is confused. Who knows.

For a user who knows what .emacs is and how to set it, giving several
places for init file may be handy, but makes things complicated, and is
not in conformity with what Emacs does in other OSes. Is it desirable?

BTW, Emacs manual has this part:
,----
| C.5.3 The MS-Windows System Registry
| ------------------------------------
| 
| Under MS-Windows, the installation program `addpm.exe' adds values for
| `emacs_dir', `EMACSLOADPATH', `EMACSDATA', `EMACSPATH', `EMACSDOC',
| `SHELL' and `TERM' to the `HKEY_LOCAL_MACHINE' section of the system
| registry, under `/Software/GNU/Emacs'.  It does this because there is
| no standard place to set environment variables across different
| versions of Windows.  Running `addpm.exe' is no longer strictly
| necessary in recent versions of Emacs, but if you are upgrading from an
| older version, running `addpm.exe' ensures that you do not have older
| registry entries from a previous installation, which may not be
| compatible with the latest version of Emacs.
`----

Seems it's not true any more. As I mentioned above, addpm updates
existed registry values if they exist, otherwise, do nothing.

I found this while I try to install Mew (I use selfbuilt emacs-unicode-2
branch from latest cvs source). Mew installation under Windoze depends
on Windoze registry, and it failed since there is not any Emacs-related
registry. I have to run
addpm c:\emacs
to add these registry items, and installation works then.

  reply	other threads:[~2006-09-22 14:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-19 23:09 single init file/directory for windows and linux using version control svn or cvs Patrick Drechsler
2006-09-20  3:24 ` Eli Zaretskii
2006-09-21 10:21   ` Patrick Drechsler
2006-09-20  7:49 ` Stefan Monnier
2006-09-21 10:23   ` Patrick Drechsler
2006-09-21  1:58 ` Richard Stallman
2006-09-21 10:25   ` Patrick Drechsler
2006-09-21 11:53   ` CHENG Gao
2006-09-21 12:15     ` Jason Rumney
2006-09-21 20:15       ` Richard Stallman
2006-09-22 12:39         ` Eli Zaretskii
2006-09-23  3:34           ` Richard Stallman
2006-09-23 10:26             ` Eli Zaretskii
2006-09-22  2:41       ` CHENG Gao
2006-09-22 12:46         ` Eli Zaretskii
2006-09-22 14:31           ` CHENG Gao [this message]
2006-09-23  9:57             ` Eli Zaretskii
2006-09-23 10:17         ` Jason Rumney
2006-09-21  2:51 ` Eric Hanchrow
2006-09-21 10:25   ` Patrick Drechsler

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m264fg2crk.fsf@eqiao.com \
    --to=chenggao@gmail.com \
    /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 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).