unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 16243@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <83mwjo6d8s.fsf@gnu.org> (raw)
In-Reply-To: <87zjnpl4vx.fsf@building.gnus.org>

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 16243@debbugs.gnu.org
> Date: Wed, 25 Dec 2013 09:19:14 +0100
> 
> Eli Zaretskii <eliz@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.





  reply	other threads:[~2013-12-25 17:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-24 17:30 bug#16243: 24.3.50; shr-visit-file doesn't set the buffer's default-directory Eli Zaretskii
2013-12-24 20:14 ` Lars Ingebrigtsen
2013-12-24 20:56   ` Eli Zaretskii
2013-12-24 21:02     ` Lars Ingebrigtsen
2013-12-25  3:48       ` Eli Zaretskii
2013-12-25  8:19         ` Lars Ingebrigtsen
2013-12-25 17:40           ` Eli Zaretskii [this message]
2013-12-25 17:42             ` Lars Ingebrigtsen
2013-12-25 19:39               ` Eli Zaretskii
2013-12-25 19:38                 ` Lars Ingebrigtsen
2013-12-25 17:45             ` Lars Ingebrigtsen
2013-12-25 19:40               ` Eli Zaretskii

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=83mwjo6d8s.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=16243@debbugs.gnu.org \
    --cc=larsi@gnus.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 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).