From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Newsgroups: gmane.emacs.bugs Subject: bug#7872: Possible fix for relative pathnames given through the command line Date: Wed, 26 Jan 2011 19:06:34 +0100 Message-ID: <4D4062AA.6090601@swipnet.se> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1296066838 5201 80.91.229.12 (26 Jan 2011 18:33:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 26 Jan 2011 18:33:58 +0000 (UTC) Cc: 7872-done@debbugs.gnu.org To: Roy Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 26 19:33:54 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PiABl-0000NA-2G for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Jan 2011 19:33:53 +0100 Original-Received: from localhost ([127.0.0.1]:46388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiA3a-0006zY-C5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Jan 2011 13:25:26 -0500 Original-Received: from [140.186.70.92] (port=45155 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiA3V-0006zS-49 for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 13:25:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiA3Q-0008Ol-7X for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 13:25:21 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiA3Q-0008OX-56 for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 13:25:16 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Pi9e2-0003RW-IV for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 12:59:02 -0500 Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jan 2011 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 7872 X-GNU-PR-Package: emacs,ns X-GNU-PR-Keywords: Mail-Followup-To: 7872@debbugs.gnu.org, jan.h.d@swipnet.se Original-Received: via spool by 7872-done@debbugs.gnu.org id=D7872.129606471113192 (code D ref 7872); Wed, 26 Jan 2011 17:59:02 +0000 Original-Received: (at 7872-done) by debbugs.gnu.org; 26 Jan 2011 17:58:31 +0000 Original-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 Original-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 Original-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" Original-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 Original-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) 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 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 26 Jan 2011 12:59:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:43660 Archived-At: 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! >