From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: 42 147 Newsgroups: gmane.emacs.help Subject: Re: shell-command in Windows 7 Date: Sat, 15 Apr 2017 19:17:37 +0200 Message-ID: <3c7fb354-4818-a7b9-3129-7ecceaafd804@gmail.com> References: <40b3fe49-18cb-c7bc-5792-98e0a7c7c8e6@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1492276698 16026 195.159.176.226 (15 Apr 2017 17:18:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Apr 2017 17:18:18 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 15 19:18:14 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czRKw-00043f-1A for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Apr 2017 19:18:14 +0200 Original-Received: from localhost ([::1]:57486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czRL1-0003rm-L6 for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Apr 2017 13:18:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czRKW-0003rV-Sl for help-gnu-emacs@gnu.org; Sat, 15 Apr 2017 13:17:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1czRKR-0004d0-Uo for help-gnu-emacs@gnu.org; Sat, 15 Apr 2017 13:17:48 -0400 Original-Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]:33614) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1czRKR-0004cE-Nr for help-gnu-emacs@gnu.org; Sat, 15 Apr 2017 13:17:43 -0400 Original-Received: by mail-wr0-x22e.google.com with SMTP id l28so64289606wre.0 for ; Sat, 15 Apr 2017 10:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=GrY9XZKhrG8ouTJWx+SThWws0dhxf/rejKx4Xz9lvH0=; b=iCjeNP+nAfEvDP1fNltR2mqZcUgRbohHGBLuXvFqvqEcuyT0Twk2fWIFOhNbT7sP3K bhPbKTdMkAhX2xeoAIIgAWp0AOaMVvh2ZLZBjNNlRf4d8/ghHRETQCylhDlTK87Nu4gj L4CGHPY/K4wGJDqHnZhLkGrPf19L/7EhZ+aX8sTedr9vGlQKSoJFgmz3OrjTEF1zEKAZ rf0mcwlaYkhMEfQT01tlyBus7TO6N3K41EBNT8w70KEkMkxtIdQSCTIpPbcnRd/K/U2k Jc5QLBcf8diUtr8U0+eEuJCSK9HINFDmQK1I2mT8HU7LfjybSTOVH3Q7EmVggH8qA1iL EzOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=GrY9XZKhrG8ouTJWx+SThWws0dhxf/rejKx4Xz9lvH0=; b=dVFc9c+9iPMS2EVrCul/Vcmp9wyQlzDWtRXAspMvzxVuP0L91EnWaif4xIDt5/lahx 3Mc0ZAiNvwUguczv2PnCubcAyZ9NbP+EIQHLQudshdDZyeU1NEmTiuq9/YAy5rjMSZxj MGH4klXPJIM6ZVcR7w0oQUZH5Tj4q2o5iAvBov0E8ITz8QbUE6pj9sS8IWNhbcMGz9AB nV7Wenhx7ZhDK1pdB2MGbp/GWS1mhGwwxilf6hgaweJtdqGslSeUiD6U1pJrdOcO+F3T 0x2hEoVI2UmUpx1aFJA2bHraVsGKR+YtKbGL2xUpzY3Xkr1kdV86ZcefW32Ea18CriOK Gh0w== X-Gm-Message-State: AN3rC/47QgAMe0vIc+iZ5Rc+wM1e/KgjEho6UkJiyOfgNXatVkC2ny2D uXOxMleOhCJ+GAAtBR0= X-Received: by 10.223.171.6 with SMTP id q6mr12021581wrc.147.1492276662498; Sat, 15 Apr 2017 10:17:42 -0700 (PDT) Original-Received: from [192.168.2.195] (dslb-092-072-062-032.092.072.pools.vodafone-ip.de. [92.72.62.32]) by smtp.gmail.com with ESMTPSA id w52sm7097058wrc.14.2017.04.15.10.17.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2017 10:17:41 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112774 Archived-At: 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 () (interactive) (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." (interactive) (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).