GNU bug report logs - #16243
24.3.50; shr-visit-file doesn't set the buffer's default-directory

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Tue, 24 Dec 2013 17:33:02 UTC

Severity: normal

Tags: fixed

Found in version 24.3.50

Fixed in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16243 <at> debbugs.gnu.org
Subject: Re: bug#16243: 24.3.50;
 shr-visit-file doesn't set the buffer's default-directory
Date: Wed, 25 Dec 2013 19:40:03 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: 16243 <at> debbugs.gnu.org
> Date: Wed, 25 Dec 2013 09:19:14 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> To make relative URLs expand correctly, file://directory/file/is/in
> >> should be passed in as the base directory.
> >
> > I'm not sure such a directory value will do what we want.  The value
> > should be a local file name.  E.g., on Windows typing RET on a link
> > will eventually call a function that needs to be able to produce an
> > absolute file name by calling expand-file-name.
> 
> file:// specifies a local file.

But expand-file-name doesn't support it.  On MS-Windows:

  (expand-file-name "file:///d:/usr/lib")
    => "d:/gnu/bzr/emacs/trunk/file:/d:/usr/lib"

On GNU/Linux:

  (expand-file-name "file:///home/e/eliz/bzr")
    => "/home/e/eliz/bzr/emacs/trunk/file:/home/e/eliz/bzr"

> >> `shr-visit-file' doesn't really visit a file.  It just does a rendering
> >> based on it.  If `buffer-file-name' is set to the file, and you save
> >> what you see, you destroy the .html file you see a rendering of.
> >
> > Then don't allow to save.
> 
> That's why `buffer-file-name' isn't set.

There are other methods to prevent accidental saving, which don't mess
up with buffer-file-name or default-directory.  After all, the user
can always specify the file to save explicitly, so you cannot make
this 100% idiot-proof anyway.  The way things are now, we punish the
innocent majority on behalf of a crazy minority.  That doesn't sound
right to me.




This bug report was last modified 11 years and 209 days ago.

Previous Next


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