From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83mwjo6d8s.fsf@gnu.org> References: <83bo066ts6.fsf@gnu.org> <8761qeroot.fsf@building.gnus.org> <83wqiu55pa.fsf@gnu.org> <87lhzaq7wp.fsf@building.gnus.org> <83txdx616f.fsf@gnu.org> <87zjnpl4vx.fsf@building.gnus.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1387993824 8178 80.91.229.3 (25 Dec 2013 17:50:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Dec 2013 17:50:24 +0000 (UTC) Cc: 16243@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 25 18:50:30 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VvsTJ-0006dx-4e for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Dec 2013 18:42:17 +0100 Original-Received: from localhost ([::1]:43088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvsTI-0004PB-QB for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Dec 2013 12:42:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvsTA-0004P1-06 for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 12:42:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvsT4-00077h-7g for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 12:42:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvsT4-00077E-3k for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 12:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VvsT3-00064Z-OF for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 12:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Dec 2013 17:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16243 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16243-submit@debbugs.gnu.org id=B16243.138799328623268 (code B ref 16243); Wed, 25 Dec 2013 17:42:01 +0000 Original-Received: (at 16243) by debbugs.gnu.org; 25 Dec 2013 17:41:26 +0000 Original-Received: from localhost ([127.0.0.1]:41621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvsSP-00063A-VA for submit@debbugs.gnu.org; Wed, 25 Dec 2013 12:41:25 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:61606) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvsSJ-00062s-S0 for 16243@debbugs.gnu.org; Wed, 25 Dec 2013 12:41:19 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MYD00H00IA7Y500@a-mtaout23.012.net.il> for 16243@debbugs.gnu.org; Wed, 25 Dec 2013 19:40:03 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MYD00HDOIERW250@a-mtaout23.012.net.il>; Wed, 25 Dec 2013 19:40:03 +0200 (IST) In-reply-to: <87zjnpl4vx.fsf@building.gnus.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82590 Archived-At: > From: Lars Ingebrigtsen > Cc: 16243@debbugs.gnu.org > Date: Wed, 25 Dec 2013 09:19:14 +0100 > > Eli Zaretskii 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.