all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: joaotavora@gmail.com (João Távora)
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18310@debbugs.gnu.org
Subject: bug#18310: 24.3.93; relative links don't work in eww and Windows 7
Date: Thu, 21 Aug 2014 16:43:48 +0100	[thread overview]
Message-ID: <jjby4uhvoej.fsf@gmail.com> (raw)
In-Reply-To: <jjboaverv2b.fsf@gmail.com>

Eli Zaretskii <eliz@gnu.org> writes:

> I'm pretty sure it did happen on XP.

I wasn't aware of the bug until the switch to Windows 7. Maybe I
didn't use eww with relative links at all, or maybe other factors
influencing `expand-file-name' weren't acting.

> I don't think it's because of HOME, since there was no "~" in the file
> name.  I'm guessing that the default-directory of the buffer where you
> used that code was on the z: drive, so Emacs used that to complete the
> missing drive letter.

Something other than `default-directory' seems to be influencing it. I
did some tests:

   (let ((default-directory "/"))
     (expand-file-name "../" "/something/bla"))

   (let ((default-directory "\\"))
     (expand-file-name "../" "/something/bla"))
    
   (let ((default-directory nil))
     (expand-file-name "../" "/something/bla"))

   (let ((default-directory ""))
     (expand-file-name "../" "/something/bla"))

All produce "z:/something". However

   (let ((default-directory "c:"))
     (expand-file-name "../" "/something/bla"))

   (let ((default-directory "\\\\mymachine"))
     (expand-file-name "../" "/something/bla"))

Do produce "c:/something/" and "//mymachine/something/",
respectively. Finally

   (let ((default-directory "\\\\"))
     (expand-file-name "../" "/something/bla"))

Crashed the Emacs process on my machine. Can you reproduce? I don't have
debuggers handy on Windows, so can't even get a backtrace.

> There's nothing wrong with expand-file-name, please don't waste your
> time looking there.

Well, there's the fact that it crashed... but anyway I didn't say there
was.  I just didn't understand what it did. Now that you have explained,
I do, more than before at least.

But from its docstring it's not clear. I didn't understand that
"canonicalize" means different for different platforms. Maybe because
Emacs use of "/" on Windows is an exception I'm used to.

The docstring should explain its relationship with the
`default-directory' variable, which in the current version sounds like
it's shadowed completely by the DEFAULT-DIRECTORY parameter. Perhaps a
sentence could be added.

   If DEFAULT-DIRECTORY is nil or missing, the current buffer's value of
   `default-directory' is used. Even if DEFAULT-DIRECTORY is non-nil,
   `default-directory' may still be used to help canonicalize the
   resulting name for the current platform.

If it's being influenced by anything else, it should also explain it.

> Please use url-expand-file-name instead, it does exactly what you
> want, and does that portably.

That sounds perfectly right, but I don't have time to setup my Emacs
development environment, sorry, so maybe someone else can perform the
change. I think it's a bug to fix for 24.4.

João

PS: Had a look at `url-expand-file-name': isn't it doing to much for
`shr-expand-url''s purposes?  There seems to be an overlap between the
two. Anyway for 24.4 any fix will do I guess.







  reply	other threads:[~2014-08-21 15:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 10:33 bug#18310: 24.3.93; relative links don't work in eww and Windows 7 João Távora
2014-08-21 14:04 ` Eli Zaretskii
2014-08-21 15:43   ` João Távora [this message]
2014-08-21 16:17     ` Eli Zaretskii
2014-08-21 16:54       ` João Távora
2014-08-21 19:17         ` Eli Zaretskii
2014-08-22 10:26           ` João Távora
2014-08-22 10:48             ` Eli Zaretskii
2014-08-22 14:39             ` Stefan Monnier
2014-08-22 15:25               ` Eli Zaretskii
2014-08-25 17:23       ` João Távora
2014-08-26 18:11         ` Glenn Morris
2014-08-26 20:37           ` João Távora
2014-08-27  5:05             ` Glenn Morris
2014-09-18 17:56             ` Lars Magne Ingebrigtsen

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=jjby4uhvoej.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=18310@debbugs.gnu.org \
    --cc=eliz@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.