From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#17425: 24.4.50; tramp-cleanup-this-connection on push-button Date: Mon, 12 May 2014 20:50:51 +0200 Message-ID: <87oaz24yr8.fsf@gmx.de> References: <70vbti31d4.fsf@fencepost.gnu.org> <87y4ye1105.fsf@gmx.de> <87oaz87lta.fsf@gmx.de> <874n0vz2cc.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1399920745 18967 80.91.229.3 (12 May 2014 18:52:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 May 2014 18:52:25 +0000 (UTC) Cc: sds@gnu.org, 17425@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 12 20:52:17 2014 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 1WjvKj-00068y-E2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 May 2014 20:52:17 +0200 Original-Received: from localhost ([::1]:39371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjvKi-0006T9-Vx for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 May 2014 14:52:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjvKa-0006Qo-LS for bug-gnu-emacs@gnu.org; Mon, 12 May 2014 14:52:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjvKU-0000ex-P4 for bug-gnu-emacs@gnu.org; Mon, 12 May 2014 14:52:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjvKU-0000eo-Md for bug-gnu-emacs@gnu.org; Mon, 12 May 2014 14:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WjvKT-0005vS-Sj for bug-gnu-emacs@gnu.org; Mon, 12 May 2014 14:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 May 2014 18:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17425 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17425-submit@debbugs.gnu.org id=B17425.139992067422688 (code B ref 17425); Mon, 12 May 2014 18:52:01 +0000 Original-Received: (at 17425) by debbugs.gnu.org; 12 May 2014 18:51:14 +0000 Original-Received: from localhost ([127.0.0.1]:32831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjvJg-0005tq-Rq for submit@debbugs.gnu.org; Mon, 12 May 2014 14:51:13 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:52531) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjvJa-0005t7-5n for 17425@debbugs.gnu.org; Mon, 12 May 2014 14:51:10 -0400 Original-Received: from detlef.gmx.de ([93.202.61.168]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MGnPx-1WWT3m1n1t-00DTxE; Mon, 12 May 2014 20:50:55 +0200 In-Reply-To: (Stefan Monnier's message of "Mon, 12 May 2014 14:15:44 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-Provags-ID: V03:K0:mdd+mnNPnyYR7BgPY7SpCrGQ84/s4NWO7DF5Gc68TBJOBUUUb1M 6pgi8/bzhPKNdG52oVzeUR+UWVaVibnTWT3fxmvKiq10+2REFpJ8tbfeLF4vbghMdLdQUXl cxXbutuNgGRWMxPa7sBidb2LQYyW94NSkawIjP/0BWCQTFei7v5SD+AtNXTgrMJjXM+l+8i XVBnJqESRqQPUkhOa5oeg== 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:88986 Archived-At: Stefan Monnier writes: >> Maybe it is time to extend the semantics of >> `file-accessible-directory-p'. > > Not sure what you mean: file-accessible-directory-p should test whether > that directory can be used as "cwd". Nothing more nothing less. > >> When FILENAME is remote, Tramp's (or any other) respective handler >> would return nil if there isn't an established connection. IOW, Tramp >> wouldn't open a non-existing connection. > > Why? The scenario of the OP is as follows: - There's a buffer with an existing remote default-directory, connection established. - No problem to run browse-url in that buffer (the example was an rcirc buffer). It doesn't hurt, that default-directory is remote. - After a while, the remote host wasn't available any more, for whatever reason. - Now browse-url fails, because it checks file-directory-p and file-readable-p. Both operations try to access the remote default-directory. If the check would be replaced file-accessible-directory-p, and this operation doesn't try to reopen a stalled connection, it would be sufficient for that use case. Glenn has proposed a similar change, but with also checking (not (file-remote-p default-directory)). I became a little bit nervous, because file-remote-p isn't reserved not only for Tramp, but for any file name handler (like url-handlers.el). >> By this, we could just test `(file-accessible-directory-p default-directory)' > > Sorry, I lost you: Where would you use this test, instead of what? --8<---------------cut here---------------start------------->8--- *** /home/albinus/src/emacs/lisp/net/browse-url.el.~117091~ 2014-05-12 20:47:03.821360420 +0200 --- /home/albinus/src/emacs/lisp/net/browse-url.el 2014-05-12 20:46:53.969311566 +0200 *************** *** 812,819 **** browse-url-mailto-function) browse-url-browser-function)) ;; Ensure that `default-directory' exists and is readable (b#6077). ! (default-directory (if (and (file-directory-p default-directory) ! (file-readable-p default-directory)) default-directory (expand-file-name "~/")))) ;; When connected to various displays, be careful to use the display of --- 812,818 ---- browse-url-mailto-function) browse-url-browser-function)) ;; Ensure that `default-directory' exists and is readable (b#6077). ! (default-directory (if (file-accessible-directory-p default-directory) default-directory (expand-file-name "~/")))) ;; When connected to various displays, be careful to use the display of --8<---------------cut here---------------end--------------->8--- >> without the threat to damage other packages like url-handlers.el. > > And I have no idea what damage you're referring to. That's the whole thread about, I've discussed with Glenn. > Stefan Best regards, Michael.