From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs lib-src/ChangeLog lib-src/emacsclient.c l... Date: Tue, 10 Mar 2009 11:58:11 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1236731861 4317 80.91.229.12 (11 Mar 2009 00:37:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Mar 2009 00:37:41 +0000 (UTC) Cc: Emacs developers To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 11 01:38:58 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LhCT8-00058p-Kp for ged-emacs-devel@m.gmane.org; Wed, 11 Mar 2009 01:38:46 +0100 Original-Received: from localhost ([127.0.0.1]:51761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhCRm-0002fl-QI for ged-emacs-devel@m.gmane.org; Tue, 10 Mar 2009 20:37:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhCQu-00022Z-ME for emacs-devel@gnu.org; Tue, 10 Mar 2009 20:36:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhCQt-00021P-A6 for emacs-devel@gnu.org; Tue, 10 Mar 2009 20:36:28 -0400 Original-Received: from [199.232.76.173] (port=33590 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhCQs-000219-Vr for emacs-devel@gnu.org; Tue, 10 Mar 2009 20:36:27 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:57170 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhCQs-0000SI-MI for emacs-devel@gnu.org; Tue, 10 Mar 2009 20:36:26 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhIFAMektklFxL+1/2dsb2JhbACBTsEgCI9DglUIgTAGYYNE X-IronPort-AV: E=Sophos;i="4.38,338,1233550800"; d="scan'208";a="35013182" Original-Received: from 69-196-191-181.dsl.teksavvy.com (HELO ceviche.home) ([69.196.191.181]) by ironport2-out.teksavvy.com with ESMTP; 10 Mar 2009 20:36:24 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 2F122B4266; Tue, 10 Mar 2009 11:58:11 -0400 (EDT) In-Reply-To: (Juanma Barranquero's message of "Tue, 10 Mar 2009 16:13:57 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109548 Archived-At: >> =A0 =A0 =A0 =A0* emacsclient.c (main): Always pass cwd via "-dir". =A0Pa= ss the file >> =A0 =A0 =A0 =A0names without prepending cwd to them, so Emacs uses its c= ustomary >> =A0 =A0 =A0 =A0rules to determine how to interpret the file name. > This change breaks useful Windows behavior. > Previously: > C:\> g: > G:\> cd test > G:\test> c: > C:\> emacsclient g:myfile.txt > opened g:\test\myfile.txt. Now it tries to open g:/myfile.txt. > The problem is that the "Emacs [...] customary rules to determine how > to interpret the file name" do not help, because the interpretation of > g:myfile.txt depends on the shell where you do run emacsclient (you > can perfectly have two different default directories in g: in > different shell invocations). Hmmm.... does the patch below help? If so, please install it, Stefan --- emacsclient.c.~1.155.~ 2009-03-10 11:49:18.000000000 -0400 +++ emacsclient.c 2009-03-10 11:56:38.000000000 -0400 @@ -1635,6 +1635,26 @@ continue; } } +#ifdef WINDOWSNT + else if (! file_name_absolute_p (argv[i]) + && (isalpha (argv[i][0]) && argv[i][1] =3D=3D ':')) + /* Windows can have a different default directory for each + drive, so the cwd passed via "-dir" is not sufficient + to account for that. + If the user uses :, we hence need to be + careful to expand with the default directory + corresponding to . */ + { + char *filename =3D (char *) xmalloc (MAX_PATH); + DWORD size; + + size =3D GetFullPathName (argv[i], MAX_PATH, filename, NULL); + if (size > 0 && size < MAX_PATH) + argv[i] =3D filename; + else + free (filename); + } +#endif =20 send_to_emacs (emacs_socket, "-file "); quote_argument (emacs_socket, argv[i]);