summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Schleicher <rs@ralph-schleicher.de>2011-05-08 14:34:51 -0400
committerChong Yidong <cyd@stupidchicken.com>2011-05-08 14:34:51 -0400
commit2a86a00c4fbd998fedf778c65764f607f7da1855 (patch)
tree4784c4d08ef5fac810220fd24a8295b30c4c2a08
parent085f5d7dcae1d423054ea0dd0c87382ee01cc6fa (diff)
downloademacs-2a86a00c4fbd998fedf778c65764f607f7da1855.tar.gz
Expand file names during browse-url-of-dired-file (Bug#8259).
* lisp/net/browse-url.el (browse-url-of-dired-file): Allow browsing of special file names `.' and `..'.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/net/browse-url.el5
2 files changed, 7 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3d2cb34730d..488bd07a632 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,9 @@
* progmodes/perl-mode.el (perl-imenu-generic-expression): Only
match variables declared via `my' or `our' (Bug#8261).
+ * net/browse-url.el (browse-url-of-dired-file): Allow browsing of
+ special file names `.' and `..' (Bug#8259).
+
2011-05-08 Chong Yidong <cyd@stupidchicken.com>
* progmodes/grep.el (grep-mode-font-lock-keywords): Remove
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 8f91fbb26b1..c1ec3f0ed13 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -769,7 +769,10 @@ narrowed."
(defun browse-url-of-dired-file ()
"In Dired, ask a WWW browser to display the file named on this line."
(interactive)
- (browse-url-of-file (dired-get-filename)))
+ (let ((tem (dired-get-filename t t)))
+ (if tem
+ (browse-url-of-file (expand-file-name tem))
+ (error "No file on this line"))))
;;;###autoload
(defun browse-url-of-region (min max)