Subject: bug#8259: browse-url-of-dired-file fails to browse . and ..

From: Ralph Schleicher <[email-masked]>
Date: Tue, 15 Mar 2011 20:55:43 +0100

Hi,

browse-url-of-dired-file signals an error if the user attempts to
browse one of the special file names '.' or '..'.  I see no reason
why it should not be possible to browse these file names like any
other directory file name.  Below is a patch together with a change
log entry.

2011-03-11  Ralph Schleicher  <[email-masked]>

	* net/browse-url.el (browse-url-of-dired-file): Enable browsing
	of special file names `.' and `..'.

--- emacs-23.3/lisp/net/browse-url.el.orig	2011-01-08 12:45:14 +0100
+++ emacs-23.3/lisp/net/browse-url.el	2011-03-11 11:42:23 +0100
@@ -756,7 +756,10 @@
 (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 (null tem)
+	(error "No file on this line")
+      (browse-url-of-file (expand-file-name tem default-directory)))))
 
 ;;;###autoload
 (defun browse-url-of-region (min max)

-- 
Ralph