GNU bug report logs - #7872
Possible fix for relative pathnames given through the command line

Previous Next

Packages: emacs, ns;

Reported by: Roy Liu <carsomyr <at> gmail.com>

Date: Thu, 20 Jan 2011 02:43:01 UTC

Severity: normal

Merged with 6179, 8127

Found in version 23.2

Done: Jan Djärv <jan.h.d <at> swipnet.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7872 in the body.
You can then email your comments to 7872 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7872; Package emacs. (Thu, 20 Jan 2011 02:43:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roy Liu <carsomyr <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 20 Jan 2011 02:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Roy Liu <carsomyr <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Possible fix for relative pathnames given through the command line
Date: Wed, 19 Jan 2011 21:48:56 -0500
[Message part 1 (text/plain, inline)]
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!
[Message part 2 (text/html, inline)]

Merged 6179 7872. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 20 Jan 2011 05:19:01 GMT) Full text and rfc822 format available.

Reply sent to Jan Djärv <jan.h.d <at> swipnet.se>:
You have taken responsibility. (Wed, 26 Jan 2011 17:59:02 GMT) Full text and rfc822 format available.

Notification sent to Roy Liu <carsomyr <at> gmail.com>:
bug acknowledged by developer. (Wed, 26 Jan 2011 17:59:02 GMT) Full text and rfc822 format available.

Message #12 received at 7872-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Roy Liu <carsomyr <at> gmail.com>
Cc: 7872-done <at> debbugs.gnu.org
Subject: Re: bug#7872: Possible fix for relative pathnames given through the
	command line
Date: Wed, 26 Jan 2011 19:06:34 +0100
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!
>




Reply sent to Jan Djärv <jan.h.d <at> swipnet.se>:
You have taken responsibility. (Wed, 26 Jan 2011 17:59:02 GMT) Full text and rfc822 format available.

Notification sent to Roy Liu <royliu <at> cs.ucsd.edu>:
bug acknowledged by developer. (Wed, 26 Jan 2011 17:59:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 24 Feb 2011 12:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 26 Feb 2011 23:33:02 GMT) Full text and rfc822 format available.

Forcibly Merged 6179 7872 8127. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 26 Feb 2011 23:33:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Mar 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 85 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.