[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell-command in Windows 7

From: 42 147
Subject: Re: shell-command in Windows 7
Date: Sat, 15 Apr 2017 19:17:37 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

I narrowed it down to setup-cygwin.el. The only change I made to this file
was to replace every instance of C:/ with E:/ because Windows 7 installed
on the E: drive.

Otherwise, not sure. It might be:

(defcustom cygwin-root-directory (or (setcyg-dir-p "E:/cygwin64/") (setcyg-dir-p "E:/cygwin/"))
  "Root directory of Cygwin installation.
It should have subdirectories `bin' and `usr/info'.
Subdirectory `bin' should have file `bin/bash.exe'."
  :group 'setup-cygwin :type 'directory)

(unless (setcyg-dir-p cygwin-root-directory)
(error "Cannot find Cygwin. Please customize option `cygwin-root-directory'"))

That is causing problems. If I don't load setup-cygwin.el, I am able to use
the double backslash version of the code every time as before:

 (defun firefox ()
(shell-command (concat "explorer " (replace-regexp-in-string "/" "\\\\" "E:\\Program Files\\Mozilla Firefox\\firefox.exe" t t))))

But curiously the forward slash version does not work every time:

  (defun firefox ()
  "Run explorer on the directory of the current buffer."
(shell-command (concat "explorer " (replace-regexp-in-string "/" "\\\\" "E:/Program Files/Mozilla Firefox/firefox.exe" t t))))

Even if I stop loading setup-cygwin.el.

However, if I replace "\\\\" with "\\" as you did, then both versions work
every time (meaning I never have to alternate), though only if I don't load
setup-cygwin.el. That remains the source of the underlying problem, at
least as I have it configured (although again, I changed nothing in this
file but C:/ to E:/. Everything is in there the way Markus Hoenika and Drew
Adams wrote it).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]