all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: sds@gnu.org, 17425@debbugs.gnu.org
Subject: bug#17425: 24.4.50; tramp-cleanup-this-connection on push-button
Date: Mon, 12 May 2014 20:50:51 +0200	[thread overview]
Message-ID: <87oaz24yr8.fsf@gmx.de> (raw)
In-Reply-To: <jwv4n0un9uk.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Mon, 12 May 2014 14:15:44 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> 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.





  reply	other threads:[~2014-05-12 18:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06 21:29 bug#17425: 24.4.50; tramp-cleanup-this-connection on push-button Sam Steingold
2014-05-06 23:59 ` Glenn Morris
2014-05-07  0:43   ` Sam Steingold
2014-05-07  0:55     ` Glenn Morris
2014-05-07  7:50     ` Michael Albinus
2014-05-07 21:22       ` Sam Steingold
2014-05-08  7:04         ` Glenn Morris
2014-05-08  7:48           ` Michael Albinus
2014-05-08 16:10             ` Glenn Morris
2014-05-08 16:44               ` Sam Steingold
2014-05-08 16:52                 ` Michael Albinus
2014-05-08 17:03                 ` Glenn Morris
2014-05-08 17:08                   ` Michael Albinus
2014-05-08 17:04               ` Michael Albinus
2014-05-08 17:09                 ` Glenn Morris
2014-05-08 19:37                   ` Michael Albinus
2014-05-09 12:50                   ` Michael Albinus
2014-05-09 14:01               ` Stefan Monnier
2014-05-12 11:02                 ` Michael Albinus
2014-05-12 18:15                   ` Stefan Monnier
2014-05-12 18:50                     ` Michael Albinus [this message]
2014-05-12 19:30                       ` Stefan Monnier
2014-05-12 20:32                         ` Michael Albinus
2014-05-12 20:48                           ` Michael Albinus
2014-05-12 21:33                           ` Stefan Monnier
2014-05-13  9:09                             ` Michael Albinus
2014-05-13 13:13                               ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=87oaz24yr8.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=17425@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=sds@gnu.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.