* bug#7872: Possible fix for relative pathnames given through the command line
@ 2011-01-20 2:48 Roy Liu
2011-01-26 18:06 ` Jan Djärv
0 siblings, 1 reply; 2+ messages in thread
From: Roy Liu @ 2011-01-20 2:48 UTC (permalink / raw)
To: 7872
[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]
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!
[-- Attachment #2: Type: text/html, Size: 1440 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#7872: Possible fix for relative pathnames given through the command line
2011-01-20 2:48 bug#7872: Possible fix for relative pathnames given through the command line Roy Liu
@ 2011-01-26 18:06 ` Jan Djärv
0 siblings, 0 replies; 2+ messages in thread
From: Jan Djärv @ 2011-01-26 18:06 UTC (permalink / raw)
To: Roy Liu; +Cc: 7872-done
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!
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-26 18:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20 2:48 bug#7872: Possible fix for relative pathnames given through the command line Roy Liu
2011-01-26 18:06 ` Jan Djärv
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).