From e95b937a425af518f97837c5d9b41a8b2e8c0e58 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 13 May 2014 10:54:08 +0200 Subject: [PATCH] * net/browse-url.el (browse-url): Use `unhandled-file-name-directory' when setting `default-directory', in order to circumvent stalled remote connections. Fixes: debbugs:17425 --- lisp/ChangeLog | 8 +++++++- lisp/net/browse-url.el | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3cfb50cafd..803ef1f60b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-05-13 Michael Albinus + + * net/browse-url.el (browse-url): + Use `unhandled-file-name-directory' when setting `default-directory', + in order to circumvent stalled remote connections. (Bug#17425) + 2014-05-12 Stefan Monnier * emacs-lisp/nadvice.el (advice--interactive-form): Don't get fooled @@ -97,7 +103,7 @@ Remove HISTFILE and HISTSIZE; it's too late to set them here. Add :version entry. (tramp-open-shell): Do not let-bind `tramp-end-of-output'. - Add "HISTSIZE=/dev/null" to the shell's env arguments. Do not send + Add "HISTFILE=/dev/null" to the shell's env arguments. Do not send extra "PSx=..." commands. (tramp-maybe-open-connection): Setenv HISTFILE to /dev/null. (Bug#17295) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 33f4eda960..9644a509b2 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -807,15 +807,15 @@ first, if that exists." (interactive (browse-url-interactive-arg "URL: ")) (unless (called-interactively-p 'interactive) (setq args (or args (list browse-url-new-window-flag)))) + (when (and url-handler-mode (not (file-name-absolute-p url))) + (setq url (expand-file-name url))) (let ((process-environment (copy-sequence process-environment)) (function (or (and (string-match "\\`mailto:" url) 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 "~/")))) + (default-directory (or (unhandled-file-name-directory default-directory) + (expand-file-name "~/")))) ;; When connected to various displays, be careful to use the display of ;; the currently selected frame, rather than the original start display, ;; which may not even exist any more. -- 2.20.1