all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dave Abrahams <dave@boostpro.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Jim Porter <jporterbugs@gmail.com>, 67540@debbugs.gnu.org
Subject: bug#67540: 29.1; Emacs on Windows incorrectly capitalizes some environment variables
Date: Thu, 30 Nov 2023 16:13:03 -0800	[thread overview]
Message-ID: <E5E0D47A-9F09-43F5-8DCC-7D9AFFDA90D5@boostpro.com> (raw)
In-Reply-To: <83cyvr66z9.fsf@gnu.org>

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



> On Nov 29, 2023, at 11:22 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> Date: Wed, 29 Nov 2023 19:42:46 -0800
>> From: Jim Porter <jporterbugs@gmail.com>
>> 
>> On 11/29/2023 6:29 PM, Dave Abrahams wrote:
>>> Now issue the "set" command from a CMD shell. Notice that the "Path"
>>> environment variable has been renamed to "PATH" in Emacs.  This renaming
>>> interferes with some tools operating correctly e.g. the swift compiler
>>> (see https://swift.org).
>> 
>> This sounds like there's a bug in the Swift compiler. Environment 
>> variables on MS-Windows are case-insensitive: 
>> <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/getenv-wgetenv?view=msvc-170>. 
>> That documentation just covers 'getenv' (and 'wgetenv'), but I'm 
>> reasonably certain the same applies to the Win32 APIs as well.
> 
> Right.
> 
>> It might be nice for Emacs to preserve the case of any existing 
>> environment variables on MS-Windows to be on the safe side though...
> 
> That's impossible in practice: we'd need to "fix" every single Lisp
> program and every place in the Emacs C code that compare against
> "PATH" case-sensitively.  And what about user confusion, for those of
> us who mostly work on Unix, but sometimes need to work on Windows?

I don't think this is that hard to fix without breaking anybody.  Simply maintain a mapping of in-Emacs upcased environment variable names to the lowercased counterparts from which they came, and map back when setting up a process environment.

> We decided long ago to make these letter-case changes in the Windows
> build of Emacs, and the decision held well since then.  I see no
> reason to change that decision now, just because some program
> misbehaves on Windows.

“My” Windows expert told me that “Path is the correct spelling,” or I wouldn't have reported this as a bug.  Still, I think you could make the workaround described above, if you wanted to accomodate my "misbehaving" tools.


[-- Attachment #2: Type: text/html, Size: 10493 bytes --]

  reply	other threads:[~2023-12-01  0:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30  2:29 bug#67540: 29.1; Emacs on Windows incorrectly capitalizes some environment variables Dave Abrahams
2023-11-30  3:42 ` Jim Porter
2023-11-30  7:22   ` Eli Zaretskii
2023-12-01  0:13     ` Dave Abrahams [this message]
2023-12-01  7:14       ` Eli Zaretskii
2023-12-01 20:34         ` Dave Abrahams
2023-12-02  7:04           ` Eli Zaretskii
2023-12-02 16:22             ` Dave Abrahams
2023-11-30  7:10 ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=E5E0D47A-9F09-43F5-8DCC-7D9AFFDA90D5@boostpro.com \
    --to=dave@boostpro.com \
    --cc=67540@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jporterbugs@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 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.