From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 19 21:42:59 2011 Received: (at submit) by debbugs.gnu.org; 20 Jan 2011 02:42:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PfkUE-0001uF-M4 for submit@debbugs.gnu.org; Wed, 19 Jan 2011 21:42:59 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PfkSV-0001rn-Qd for submit@debbugs.gnu.org; Wed, 19 Jan 2011 21:41:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pfka5-0008Ex-9a for submit@debbugs.gnu.org; Wed, 19 Jan 2011 21:49:02 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:57148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pfka5-0008Et-7K for submit@debbugs.gnu.org; Wed, 19 Jan 2011 21:49:01 -0500 Received: from [140.186.70.92] (port=38196 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pfka3-00089n-JI for bug-gnu-emacs@gnu.org; Wed, 19 Jan 2011 21:49:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pfka2-0008EL-E9 for bug-gnu-emacs@gnu.org; Wed, 19 Jan 2011 21:48:59 -0500 Received: from mail-pw0-f41.google.com ([209.85.160.41]:61869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pfka2-0008EA-9O for bug-gnu-emacs@gnu.org; Wed, 19 Jan 2011 21:48:58 -0500 Received: by pwj8 with SMTP id 8so40316pwj.0 for ; Wed, 19 Jan 2011 18:48:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=ZSrOuNf/4yBzaGydspS5opRkecTk6A0nK5pfOv2tzSI=; b=PoBpXB+jMP6iWGbJpXqj8+5QsYSIqsA74wGzU/WKoF0UTtUVw0IPP6Xtkm2KWbcQQ3 1w1m9KuWTiqH8ybXsD48ch8fCvTS9V5UChi92gX18YhHH7XzKyepIqgtg6qN+Ia5aR8e tqEAkjX0p3lzahlmOwEqA6VjfwKP6rHdnz9Zg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=sHpYDnguP0SU30DjEOTtSAbA8f79HiIEded5cEzuvvgFcRwKNVI0H8jQEQcn6Fd9Om oQnhDLAOfYjCuxaJ8fgbnTS5SQ9rbNSw/mLMVM+02/lsVoOO/pyd9kZFCe3K5uAiv7UI 19F0Jp49pWqGbg1YgI7Ivl0Gu8W11B89EiTCM= MIME-Version: 1.0 Received: by 10.142.43.12 with SMTP id q12mr1582052wfq.34.1295491736893; Wed, 19 Jan 2011 18:48:56 -0800 (PST) Received: by 10.142.222.13 with HTTP; Wed, 19 Jan 2011 18:48:56 -0800 (PST) Date: Wed, 19 Jan 2011 21:48:56 -0500 Message-ID: Subject: Possible fix for relative pathnames given through the command line From: Roy Liu To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=000e0cd17bbec9794a049a3e2cbb X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 19 Jan 2011 21:42:57 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --000e0cd17bbec9794a049a3e2cbb Content-Type: text/plain; charset=ISO-8859-1 I've noticed that Emacs.app opens up relative pathnames twice -- once for the actual file, and once for the relative pathname appended to the directory of the current buffer. For example, trying to open by "a/b/text.txt" opens "a/b/text.txt" and attempts to open "a/b/a/b/text.txt". I wonder if the following patch corrects the problem: --- lisp/term/ns-win.el.orig 2010-12-12 23:31:04.000000000 -0500 +++ lisp/term/ns-win.el 2010-12-12 23:32:00.000000000 -0500 @@ -785,7 +785,7 @@ "Do a `find-file' with the `ns-input-file' as argument." (interactive) (let ((f) (file) (bufwin1) (bufwin2)) - (setq f (file-truename (car ns-input-file))) + (setq f (file-truename (expand-file-name (car ns-input-file) command-line-default-directory))) (setq ns-input-file (cdr ns-input-file)) (setq file (find-file-noselect f)) (setq bufwin1 (get-buffer-window file 'visible)) Here, the input filename is expanded according to the current working directory when Emacs was invoked. Since I'm no expert, I don't know if this breaks something else. Thanks for your time! --000e0cd17bbec9794a049a3e2cbb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've noticed that Emacs.app opens up relative pathnames twice -- once f= or the actual file, and once for the relative pathname appended to the dire= ctory of the current buffer.
For example, trying to open by "a/b/t= ext.txt" opens=A0"a/b/text.txt" and attempts to open=A0"= ;a/b/a/b/text.txt".

I wonder if t= he following patch corrects the problem:

--- = lisp/term/ns-win.el.orig =A0 =A02010-12-12 23:31:04.000000000 -0500
+++ lisp/term/ns-win.el 2010-12-12 23:32:00.000000000 -0500
@@ -785,7 +785,7 @@
=A0=A0 "Do a `find-file' with t= he `ns-input-file' as argument."
=A0=A0 (interactive)
=A0=A0 (let ((f) (file) (bufwin1) (bufwin2))
- =A0 =A0(se= tq f (file-truename (car ns-input-file)))
+ =A0 =A0(setq f (file-truename (expand-file-name (car ns-input-file) = command-line-default-directory)))
=A0=A0 =A0 (setq ns-input-file = (cdr ns-input-file))
=A0=A0 =A0 (setq file (find-file-noselect f)= )
=A0=A0 =A0 (setq bufwin1 (get-buffer-window file 'visible))
=

Here, the input filename is expanded according to the c= urrent working directory when Emacs was invoked. =A0Since I'm no expert= , I don't know if this breaks something else.

Thanks for your time!

--000e0cd17bbec9794a049a3e2cbb-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 20 00:18:56 2011 Received: (at control) by debbugs.gnu.org; 20 Jan 2011 05:18:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pfmv9-0005FY-Rj for submit@debbugs.gnu.org; Thu, 20 Jan 2011 00:18:56 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pfmv8-0005FN-Od for control@debbugs.gnu.org; Thu, 20 Jan 2011 00:18:55 -0500 Received: from localhost ([127.0.0.1]:59709) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pfn2e-0000K7-Ht; Thu, 20 Jan 2011 00:26:40 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19767.51088.12266.333565@fencepost.gnu.org> Date: Thu, 20 Jan 2011 00:26:40 -0500 From: Glenn Morris To: control Subject: emacs X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: red X-Ran: @>;@g#dasY89v,Ao,G6nX2\8)WdM#\t%[H4o*+t75>_UE&_;W-zW|k&oq4y3{YBuXd}Y~m X-Debbugs-No-Ack: yes X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) merge 6179 7872 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 26 12:58:31 2011 Received: (at 7872-done) by debbugs.gnu.org; 26 Jan 2011 17:58:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pi9dX-0003Qi-1x for submit@debbugs.gnu.org; Wed, 26 Jan 2011 12:58:31 -0500 Received: from smtprelay-h31.telenor.se ([213.150.131.4]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pi9dU-0003QV-HS for 7872-done@debbugs.gnu.org; Wed, 26 Jan 2011 12:58:29 -0500 Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-h31.telenor.se (Postfix) with ESMTP id 75FD1EA0A1 for <7872-done@debbugs.gnu.org>; Wed, 26 Jan 2011 19:06:35 +0100 (CET) X-SENDER-IP: [85.225.45.100] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjU2AFbxP01V4S1kPGdsb2JhbACIW5wcDAEBAQE1L70lhU8Ej28 X-IronPort-AV: E=Sophos;i="4.60,381,1291590000"; d="scan'208";a="169198298" Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb1.telenor.se with ESMTP; 26 Jan 2011 19:06:35 +0100 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 6CB5D7FA05A; Wed, 26 Jan 2011 19:06:34 +0100 (CET) Message-ID: <4D4062AA.6090601@swipnet.se> Date: Wed, 26 Jan 2011 19:06:34 +0100 From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Roy Liu Subject: Re: bug#7872: Possible fix for relative pathnames given through the command line References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 7872-done Cc: 7872-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) It seems the right thing to do. Checked in. In the future, please use M-x report-emacs-bug so we can see the version you are reporting against. The trunk version looks quite different. It is likely there will be a merge conflict here. Jan D. Roy Liu skrev 2011-01-20 03.48: > I've noticed that Emacs.app opens up relative pathnames twice -- once for the > actual file, and once for the relative pathname appended to the directory of > the current buffer. > For example, trying to open by "a/b/text.txt" opens "a/b/text.txt" and > attempts to open "a/b/a/b/text.txt". > > I wonder if the following patch corrects the problem: > > --- lisp/term/ns-win.el.orig 2010-12-12 23:31:04.000000000 -0500 > +++ lisp/term/ns-win.el 2010-12-12 23:32:00.000000000 -0500 > @@ -785,7 +785,7 @@ > "Do a `find-file' with the `ns-input-file' as argument." > (interactive) > (let ((f) (file) (bufwin1) (bufwin2)) > - (setq f (file-truename (car ns-input-file))) > + (setq f (file-truename (expand-file-name (car ns-input-file) > command-line-default-directory))) > (setq ns-input-file (cdr ns-input-file)) > (setq file (find-file-noselect f)) > (setq bufwin1 (get-buffer-window file 'visible)) > > Here, the input filename is expanded according to the current working > directory when Emacs was invoked. Since I'm no expert, I don't know if this > breaks something else. > > Thanks for your time! > From unknown Thu Jun 19 14:27:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 24 Feb 2011 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 18:32:10 2011 Received: (at control) by debbugs.gnu.org; 26 Feb 2011 23:32:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PtTcQ-0002ML-4x for submit@debbugs.gnu.org; Sat, 26 Feb 2011 18:32:10 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PtTcO-0002MA-H8 for control@debbugs.gnu.org; Sat, 26 Feb 2011 18:32:09 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1PtTcJ-0004n4-1D for control@debbugs.gnu.org; Sat, 26 Feb 2011 18:32:03 -0500 Date: Sat, 26 Feb 2011 18:32:03 -0500 Message-Id: Subject: control message for bug 8127 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) unarchive 6179 forcemerge 6179 8127 From unknown Thu Jun 19 14:27:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 27 Mar 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator