unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: joaotavora@gmail.com (João Távora)
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 22:17:38 +0300	[thread overview]
Message-ID: <83k361bqjx.fsf@gnu.org> (raw)
In-Reply-To: <jjbegw9vl58.fsf@gmail.com>

> From: joaotavora@gmail.com (João Távora)
> Cc: 18310@debbugs.gnu.org
> Date: Thu, 21 Aug 2014 17:54:11 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: joaotavora@gmail.com (João Távora)
> >> Cc: 18310@debbugs.gnu.org
> >> Date: Thu, 21 Aug 2014 16:43:48 +0100
> >> 
> >> Something other than `default-directory' seems to be influencing it. I
> >> did some tests:
> >
> > Like I said: Emacs uses the current drive to complete the missing
> > drive letter.  That is what you see.
> 
> OK. How is the "current drive" calculated when `default-directory' is
> nil?

There's a system call to get the "current drive", where Emacs runs.

> >> Finally
> >> 
> >>    (let ((default-directory "\\\\"))
> >>      (expand-file-name "../" "/something/bla"))
> >> 
> >> Crashed the Emacs process on my machine.
> >
> > It's not a crash, it's a deliberate abort.  "\\\\" (i.e., 2
> > backslashes in a row without anything after that) is an invalid file
> > name on Windows.
> 
> Would signalling an error be very wrong, does the process really need to
> be aborted?

Yes.  This is a deliberate trap for code either in Emacs itself or in
Lisp applications that uses such invalid default-directory values.

> I mean unprotected code may easily lead to that invalid case.

Not "easily", no.  Usually, default-directory comes from some file or
buffer.  But if some code does use that, we want to catch it
red-handed, because there's no way to know what other damage it can do
down the road.

> BTW "Semi-invalid" uses, or even downright absurd use cases, are what
> development/testing/experimentation is all about. IMO aborting the
> process and not at least warning elisp users about invalid cases in the
> documentation is not good practice in my opinion.

Emacs is not mission-critical software.  If it were, then I'd agree
with you (I happen to develop mission-critical software for a living).





  reply	other threads:[~2014-08-21 19:17 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
2014-08-21 16:17     ` Eli Zaretskii
2014-08-21 16:54       ` João Távora
2014-08-21 19:17         ` Eli Zaretskii [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83k361bqjx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=18310@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    /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 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).