all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Roy Liu <carsomyr@gmail.com>
To: 7872@debbugs.gnu.org
Subject: bug#7872: Possible fix for relative pathnames given through the command line
Date: Wed, 19 Jan 2011 21:48:56 -0500	[thread overview]
Message-ID: <AANLkTinm9tvShyL1cw1QkDaRGW1QDT0Pf9sSdxOUdMHB@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2011-01-20  2:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20  2:48 Roy Liu [this message]
2011-01-26 18:06 ` bug#7872: Possible fix for relative pathnames given through the command line Jan Djärv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinm9tvShyL1cw1QkDaRGW1QDT0Pf9sSdxOUdMHB@mail.gmail.com \
    --to=carsomyr@gmail.com \
    --cc=7872@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.