unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: shell-command in Windows 7
Date: Sat, 15 Apr 2017 11:30:48 +0300	[thread overview]
Message-ID: <8360i6gjif.fsf@gnu.org> (raw)
In-Reply-To: <125e7442-9006-2a09-f313-f2a30d69d67d@gmail.com> (message from 42 147 on Sat, 15 Apr 2017 09:40:24 +0200)

> From: 42 147 <aeuster@gmail.com>
> Date: Sat, 15 Apr 2017 09:40:24 +0200
> 
> Two problems before:
> 
> (1) I got the error message
> 
> (Shell command failed with code 1 and no output)

That's because you are using shell-command to invoke Explorer, which
is a GUI program that continues to run in parallel with Emacs.  You
can ignore the exit status in this case.

> Even when the files / programs / directories would open as desired. This 
> was still undesirable buggy behavior.
> 
> (2) Each time I launched Emacs I had to switch to the other directory 
> string format to get back (1). This made no sense at all. To be specific:
> 
> (a) "E:\\Program Files\\Mozilla Firefox\\firefox.exe"
> 
> had to be switched to:
> 
> (b) "E:/Program Files/Mozilla Firefox/firefox.exe"
> 
> in the body of the code I cited in the first e-mail, if (a) was what I 
> had the previous Emacs launch. And (b) had to be switched back to (a) if 
> (b) was what I had the previous Emacs launch.

That doesn't happen to me in "emacs -Q", so it's most probable some of
your customizations that caused this.  In particular, there's no
"memory" in Emacs of the file names it used in invoking programs.

Btw, please note that what you write above is somewhat inconsistent:

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

First, I needed to use "\\", not "\\\\" in my testing, otherwise I get
an error.

Second, I'm not sure what you are saying, exactly.  Are you saying
that in one session you needed to use this:

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

and in the next you needed to use this:

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

?  That most probably means either some customization which records
the file name somewhere, or some weird shell tricks you have on your
system.  I cannot reproduce this here.



  reply	other threads:[~2017-04-15  8:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14  8:53 shell-command in Windows 7 42 147
2017-04-14 17:11 ` John Mastro
2017-04-14 17:13   ` John Mastro
2017-04-14 17:49     ` 42 147
2017-04-14 19:48     ` 42 147
2017-04-14 20:04       ` John Mastro
2017-04-15  7:40         ` 42 147
2017-04-15  8:30           ` Eli Zaretskii [this message]
2017-04-15 10:06         ` 42 147
2017-04-15 10:19           ` Eli Zaretskii
2017-04-15 17:17         ` 42 147
2017-04-15 18:02           ` Drew Adams
2017-04-15 18:33             ` 42 147
2017-04-15 19:54               ` John Mastro
2017-04-15 20:08                 ` John Mastro
2017-04-15 21:33                   ` 42 147
2017-04-20 23:43                   ` white line appears irregularly on left side of Emacs frame in GNU / Linux virtual machine 42 147
2017-04-15  7:04       ` shell-command in Windows 7 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

  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=8360i6gjif.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).