From: Glenn Morris Date: Fri, 4 Mar 2011 08:21:56 +0000 (-0800) Subject: browse-url fix for bug#6077. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~674^2~44 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9d9827395a41ab7b87755447ca8a9bf4a163e697;p=emacs.git browse-url fix for bug#6077. * lisp/net/browse-url.el (browse-url): Handle deleted default-directory. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e506705e6e4..c550cd4e852 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-03-04 Glenn Morris + * net/browse-url.el (browse-url): + Handle deleted default-directory. (Bug#6077) + * recentf.el (recentf-include-p): In case of a buggy predicate, err on the side of including, not excluding. (Bug#5843) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 660eb3b968e..24dbfc0c30a 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -798,7 +798,12 @@ first, if that exists." (let ((process-environment (copy-sequence process-environment)) (function (or (and (string-match "\\`mailto:" url) browse-url-mailto-function) - browse-url-browser-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 ;; the currently selected frame, rather than the original start display, ;; which may not even exist any more.