GNU bug report logs - #23453
25.0.93; dired-do-find-regexp does not work on Windows even after installing GNU find and grep

Previous Next

Package: emacs;

Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>

Date: Wed, 4 May 2016 19:42:02 UTC

Severity: normal

Found in version 25.0.93

Done: Kaushal Modi <kaushal.modi <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "23453 <at> debbugs.gnu.org" <23453 <at> debbugs.gnu.org>, dgutov <at> yandex.ru
Subject: bug#23453: 25.0.93; dired-do-find-regexp does not work on Windows even after installing GNU find and grep
Date: Thu, 05 May 2016 16:36:00 +0000
[Message part 1 (text/plain, inline)]
>
> > I do not have admin access (work computer). Wouldn't (setenv "PATH"
> "..") be the same?
>
> No.
>

But the fact that I am able to do so says otherwise. I removed the path
customization from both user and system PATH values (I had got temp admin
rights to update the system PATH in Windows), added the below to my config
and now find/grep work beautifully.

  (let ((ezwinports-path "C:/Users/kmodi/Dropbox/Portable
Software/ezwinports/bin"))
      (setq exec-path (add-to-list 'exec-path ezwinports-path))
      (setenv "PATH" (concat (replace-regexp-in-string
                              "/" "\\\\" ezwinports-path) ";"
                              (getenv "PATH"))))

> If I rename the MS find.exe (which I cannot without admin aceess), will
> it not affect any other program using it?
>
> Nothing uses it.
>

I wasn't aware of that, thanks.

> As I mentioned, I also set the PATH using (setenv "PATH "..."). Isn't
> executable-find returning the correct
> > find.exe and grep.exe a proof that the right executable is being found.
>
> No.  See the source of executable-find.
>

OK, but I am able to reference to the chrome, find, grep binaryies
correctly using only the tweaks to exeec-path and PATH from within emacs. I
do not need to change it in Windows settings.

As executable-find uses exec-path, I think that manipulating just that
suffices for applications like chrome and firefox that are not executed
from shell (unlike find and grep). I am saying this from what I practically
see on my Windows machine.


> > I have had this in my config and it works fine (for a different
> executable chrome.exe):
> >
> > (let ((chrome-path "C:/Program Files (x86)/Google/Chrome/Application/"))
> > (setq exec-path (append exec-path `(,chrome-path)))
> > (setq browse-url-generic-program (executable-find "chrome")))
>
> Bad idea, as I explained in my earlier message.  You need to change
> PATH _outside_ of Emacs.
>

Well, as mentioned earlier, changing the exec-path and doing setenv PATH
from within emacs works just fine.

In summary I have this in my Windows emacs config and it works great
without needing external PATH manipulation.

=====
(let ((firefox-path "C:/Users/kmodi/AppData/Local/Mozilla Firefox/"))
      (setq exec-path (append exec-path `(,firefox-path))))

    (let ((chrome-path "C:/Program Files (x86)/Google/Chrome/Application/"))
      (setq exec-path (append exec-path `(,chrome-path)))
      (setq browse-url-generic-program (executable-find "chrome")))

    (let ((ezwinports-path "C:/Users/kmodi/Dropbox/Portable
Software/ezwinports/bin"))
      (setq exec-path (add-to-list 'exec-path ezwinports-path))
      (setenv "PATH" (concat (replace-regexp-in-string "/" "\\\\"
ezwinports-path)
                             ";" (getenv "PATH"))))
=====
-- 

-- 
Kaushal Modi
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.