From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 7466a4d: Cygwin emacsclient handles w32 file names Date: Sat, 04 Jul 2015 11:20:27 -0400 Message-ID: <5597F9BB.3000809@cornell.edu> References: <5593F5BC.4030602@cornell.edu> <1279932406.858501.1435804110079.JavaMail.yahoo@mail.yahoo.com> <5595958F.1090400@cornell.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1436023259 13311 80.91.229.3 (4 Jul 2015 15:20:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Jul 2015 15:20:59 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: Michael Mauger Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 04 17:20:51 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZBPFI-0003CQ-SL for ged-emacs-devel@m.gmane.org; Sat, 04 Jul 2015 17:20:49 +0200 Original-Received: from localhost ([::1]:44611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBPFI-00032h-3K for ged-emacs-devel@m.gmane.org; Sat, 04 Jul 2015 11:20:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBPFE-00032b-RR for emacs-devel@gnu.org; Sat, 04 Jul 2015 11:20:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBPFB-0008BQ-D5 for emacs-devel@gnu.org; Sat, 04 Jul 2015 11:20:44 -0400 Original-Received: from limerock01.mail.cornell.edu ([128.84.13.241]:33347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBPFB-00086Y-2B for emacs-devel@gnu.org; Sat, 04 Jul 2015 11:20:41 -0400 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock01.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id t64FKZ3v020547; Sat, 4 Jul 2015 11:20:35 -0400 Original-Received: from [192.168.1.4] (cpe-67-249-176-138.twcny.res.rr.com [67.249.176.138]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id t64FKXc2006286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 4 Jul 2015 11:20:35 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <5595958F.1090400@cornell.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.84.13.241 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187721 Archived-At: On 7/2/2015 3:48 PM, Ken Brown wrote: > So I would be much more comfortable with this change if you added a check for a > file name starting with a drive letter. And it might also be good to add a > comment explaining the intended use, in which Windows passes a full file path to > emacsclient. Something like the following is what I had in mind: diff --git a/lisp/server.el b/lisp/server.el index ce19b3c..46687a3 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1167,8 +1167,11 @@ The following commands are accepted by the client: (let ((file (pop args-left))) (if coding-system (setq file (decode-coding-string file coding-system))) + ;; Allow Cygwin's emacsclient to be used as a file + ;; handler on MS-Windows, in which case FILENAME + ;; might start with a drive letter. (when (and (eq system-type 'cygwin) - (fboundp 'cygwin-convert-file-name-from-windows)) + (string-match "^[A-Za-z]:" file)) (setq file (cygwin-convert-file-name-from-windows file))) (setq file (expand-file-name file dir)) (push (cons file filepos) files) Ken