Loading ...
Sorry, an error occurred while loading the content.

Re: [vimdev] {patch} determining home directory on NT

Expand Messages
  • Dr. Charles E. Campbell
    ... Aw, shucks, that s like bait before a hungry bear... So, here re my shots: Every Vim user uses Vim!!! Every REAL Vim user avoids that E-(s)macks-edder like
    Message 1 of 10 , Sep 7, 2000
    • 0 Attachment
      Thus saith Ron Aaron:
      > FWIW, I'd be wary of saying anything containing "every Vim user", period!

      Aw, shucks, that's like bait before a hungry bear...

      So, here're my shots:

      Every Vim user uses Vim!!!
      Every REAL Vim user avoids that E-(s)macks-edder like the plague!
      Real Vimmers don't eat quiche!
      Every Vim user does it modally!

      Regards,
      C Campbell
      --
      Charles E Campbell, Jr, PhD _ __ __
      Goddard Space Flight Center / /_/\_\_/ /
      cec@... /_/ \/_//_/
      PGP public key: http://www.erols.com/astronaut/pgp.html/
    • Craig Barkhouse
      ... If your Vim doesn t use HOME, then your Vim doesn t use HOME. This change will not affect you. The change just applies HOMEDRIVE/HOMEPATH as a value for
      Message 2 of 10 , Sep 7, 2000
      • 0 Attachment
        > I have HOME set for tcsh and for mail. But I also set VIM so that it's stuff
        > doesn't go in HOME. I agree. Lets _not_ use the HOMEDRIVE / HOMEPATH
        > thingys.

        If your Vim doesn't use HOME, then your Vim doesn't use HOME. This change will not affect you. The change just applies HOMEDRIVE/HOMEPATH as a value for HOME before using the hardcoded "C:/". BTW, you don't think HOME is defined in your Vim installation? Launch Vim, then enter ":echo $HOME". It's defined. If you're not having problems now, you won't have any problems after this patch.

        If you examine the init_homedir() function a little bit, you'll be able to consider the changes in proper context. They don't force anything upon "unsuspecting" users; in fact, they don't affect those users at all. They do give added functionality to users who have bonafide home directories on NT. I can't see a downside.
      • Craig Barkhouse
        ... Finally, someone who shares my view. :)
        Message 3 of 10 , Sep 7, 2000
        • 0 Attachment
          Ron Aaron said:
          > I am also very unhappy whenever programs demand I have some environment
          > variable set before they work properly! I don't mind setting an env-var to
          > get some special behaviour, but it seems very rude to have to set one just to
          > get the program running correctly.

          Finally, someone who shares my view. :)
        • Paul Moore
          From: Craig Barkhouse [mailto:craig@wanware.com] ... My point relates to normal users. Root is special on Unix. (On the other hand, general practice on NT
          Message 4 of 10 , Sep 7, 2000
          • 0 Attachment
            From: Craig Barkhouse [mailto:craig@...]
            > And on a default setup in Unix, the root account's home directory
            > is usually /. Your point?

            My point relates to "normal" users. Root is special on Unix. (On the other
            hand, general practice on NT means that Administrator is far *less*
            special - on standalone PCs, many Windows users routinely use the
            Administrator account for general use).

            > If you want it to be elsewhere, you
            > have to change it using the administrative tools.

            But all the "create user" tools I have seen on Unix make creating a home
            directory mandatory. On Windows, it is an optional action, and is not even
            on the "main" page of the user creation dialog.

            > This applies to both each OS. When you create
            > a new user account, you do assign that user a
            > home directory, don't you?

            No. Precisely because almost nothing on Windows actually honours the user's
            home directory. For example, if I start a new command prompt, it does NOT
            start in my home directory (unless the shortcut is set up to do that - not
            all are...) If I run an application, it does not start with its current
            directory as my home directory, etc, etc.

            I agree that it is possible to set Windows (and more relevantly, all of the
            applications which come on a Windows PC) up to honour the user's home
            directory - but by default this doesn't happen, and it is a lot of work to
            implement it.

            On top of this, is the fact that under Unix, both "user files" and "settings
            files" are put in the user's home directory. The use of an initial dot hides
            the "settings" files from normal view, but not so thoroughly as the Windows
            "hidden" attribute.

            A secondary part of my point is that there are two classes of file: user
            settings and user data. The fact that Unix puts these in the same directory
            is not a good enough reason for forcing that merge on other operating
            systems. In Windows, the natural place for user settings is in the
            registry - but we aren't likely to read the registry for vimrc
            information...

            > Personally, I put them under C:\Home. So I have C:\Home\Administrator,
            > C:\Home\Craig, etc. on this machine I'm using now. You don't
            > have to create a home directory when you create a new Unix
            > account either, but typically the default is to create one. The
            > concept of a home directory is built into each OS; if you choose
            > not to use it, that's up to you.

            Both OSes support the setting of a home directory, but the "user culture" of
            the two OSes, and the common programming practices, differ radically.

            > > But the long & short of it is that "the user's home directory"
            > > just isn't a natural concept on Windows.
            >
            > Oh? You specify a user's home directory when you're editing the
            > user's settings in the User Manager; it's not a tacked-on
            > concept.

            I wasn't clear enough - I meant "to the average Windows user" (for which,
            read a Windows user with no exposure to Unix, if you like...)

            > The only difference vs. a Unix system is that there is
            > no special home directory by default. Why? One reason is that a
            > lot of people will use Windows NT (a multi-user OS) as a
            > single-user OS. That is, they don't bother to create a user
            > account for themselves, they just log in as Administrator, and it
            > doesn't matter because nobody else uses their machine. Another
            > reason is that it is not absolutely crucial to have a home
            > directory for saving user settings, because NT has a place
            > designed explicitly for saving user and system settings -- the
            > registry. Unix has no choice but to rely on the file system.
            > (Not bashing Unix, just stating. I love both platforms.)

            This is a fairly relevant point - the two are different: neither is better
            or worse (I'd better put on my asbestos suit after that!) but concepts don't
            *necessarily* carry over.

            In fact, I think that with this statement, you are ending up arguing my
            point somewhat - namely that you can't carry over the Unix concept to
            Windows unmodified.

            > Well it's not that you're setting HOMEDRIVE/HOMEPATH to something
            > other than the default, it's that you're specifying a home
            > directory for a particular user. As soon as you do that,
            > HOMEDRIVE/HOMEPATH automatically reflect that home directory. If
            > the system administrator did bother to define a user's home
            > directory, then why would we ever choose to ignore it?

            Because the administrator (thinking in Windows terms) expects the home
            directory to be used only for data, and not for preferences. (I'm not
            suggesting that this must be true, just that it may be).

            > And if
            > he/she didn't define a home directory, then HOMEDRIVE/HOMEPATH
            > will be C:\, identical to current behaviour. Well, slightly
            > better actually, as HOMEDRIVE/HOMEPATH technically default to
            > %SystemDrive%\. So, in an installation that did not have a C:,
            > or uses C: for a different OS, the HOMEDRIVE still points to an
            > appropriate spot. Using a hardcoded C:\ breaks in these scenarios.

            As I said, your patch doesn't actually make anything worse, in practice (it
            improves the case where the installation doesn't have a C:\). I therefore
            can't object to the effect. What I really was querying was the *thinking*
            behind it (which is really the same as the thinking behind Vim's current
            behaviour) - namely, that user settings should be placed in $HOME (or
            rather, the user's home directory) in Windows.

            > Heh. Take that statement in context. An ending was implied:
            > "Every Vim user needs to define HOME *if* he wants to have a
            > personalized _vimrc different from the default one in the Vim
            > runtime directory." I think that's true?

            No. That's what $VIM is for. See :help $VIM. The only difficulty is that if
            you set $VIM, $VIMRUNTIME defaults based on its value, so you end up needing
            to set $VIMRUNTIME, too. This could be construed as a bug, given the
            documentation of what $VIM is for....

            But this has all got a long way from the original point. To summarise, I
            don't object to your patch (it's up to Bram whether it gets included, of
            course). However, I would advise caution in the thinking behind it (and
            behind the existing Vim behaviour) - no matter how hard you try to make it,
            Windows doesn't have a sensible (or rather, a universally accepted) place to
            store user preferences, other than the registry (and that has other
            problems). Ignoring that fact can cause problems - especially when you try
            to implement a "generic" approach (ie, something not tied to the individual
            application, like $HOME).

            I'll avoid posting anything more on this thread to the list (I'm happy to
            continue privately, if you want), as it'll get way off-topic very soon...

            Paul.
          • Paul Moore
            From: Craig Barkhouse [mailto:craig@wanware.com] ... This is a good point. I went off half-cocked here. There is no practical problem with the patch, as far as
            Message 5 of 10 , Sep 7, 2000
            • 0 Attachment
              From: Craig Barkhouse [mailto:craig@...]
              > If you examine the init_homedir() function a little bit, you'll
              > be able to consider the changes in proper context. They don't
              > force anything upon "unsuspecting" users; in fact, they don't
              > affect those users at all. They do give added functionality to
              > users who have bonafide home directories on NT. I can't see a downside.

              This is a good point. I went off half-cocked here. There is no practical
              problem with the patch, as far as I can see. (I've bored everyone with the
              philosophical issues enough, already...)

              Paul.
            Your message has been successfully submitted and would be delivered to recipients shortly.