From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to *properly* set up Emacs on Windows?
Date: Wed, 09 Feb 2022 16:04:08 +0200 [thread overview]
Message-ID: <83r18cuofb.fsf@gnu.org> (raw)
In-Reply-To: <54769654-deda-4087-b569-57e3143c0f02@www.fastmail.com> (message from Joost on Wed, 09 Feb 2022 09:14:20 +0100)
> Date: Wed, 09 Feb 2022 09:14:20 +0100
> From: Joost <joostkremers@fastmail.fm>
>
> > . The above policy will not work with Git, because it _must_ be able
> > to call the MSYS2 Bash and other MSYS2 programs. If you want to
> > invoke Git from Emacs, have a git.cmd batch file on your Path
> > which will use SETLOCAL to add Git's bin directory to Path
> > temporarily, for the duration of the Git command, and invoke
> > git.exe. This will work for most simple Git commands; for more
> > complex Git commands that don't work from Emacs, use Git Bash
> > window to invoke them, and set up emacsclient to be the EDITOR for
> > Git commands instead.
>
> I use magit on Linux, and have so far continued to do so on Windows, even though it's extremely slow (apparently a known problem.) Git itself is installed from <https://gitforwindows.org/>, which adds to my confusion, because it is apparently a separate (and minimal) MSYS2 installation, which one is advised to keep separate from a "normal" MSYS2 installation. In order to use it inside Emacs, I add "C:/Program Files/Git/usr/bin" to `exec-path` (it's not in my system path). Does that make sense?
Yes: don't do that! Git/usr/bin is a directory where MSYS2 programs
used by Git are kept; you do NOT want them on your exec-path. That's
exactly why I wrote the above exception for Git. Óscar mentioned 2
other possible arrangements:
> MSYS2 does not provide git as a MinGW package, so [...] install "Git for
> Windows", which provide an almost native port. [...] the
> installer will ask if you want its executables added to PATH, either all
> or just git.exe. My advice is to not modify PATH or to add just git.exe.
> You can set vc-git-program to where git.exe is and VC will work without
> git.exe on PATH.
Any of these alternatives will save you from introducing MSYS2
programs into your exec-path, and will avoid the kind of problems you
encountered.
next prev parent reply other threads:[~2022-02-09 14:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 17:06 How to *properly* set up Emacs on Windows? Joost
2022-02-08 18:52 ` Eli Zaretskii
2022-02-09 8:14 ` Joost
2022-02-09 14:04 ` Eli Zaretskii [this message]
2022-02-10 21:05 ` Joost Kremers
2022-02-08 20:02 ` Óscar Fuentes
2022-02-09 8:48 ` Joost
2022-02-09 11:22 ` H. Dieter Wilhelm
2022-02-09 13:19 ` Óscar Fuentes
2022-02-10 21:58 ` Joost Kremers
2022-02-10 22:37 ` Óscar Fuentes
2022-02-11 9:30 ` Joost
2022-02-11 7:00 ` Eli Zaretskii
2022-02-09 12:28 ` Arash Esbati
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=83r18cuofb.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/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.
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).