[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Ralph Schleicher
Subject: bug#8259: browse-url-of-dired-file fails to browse . and ..
Date: Tue, 15 Mar 2011 20:55:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)


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  <address@hidden>

        * 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."
-  (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)))))
 (defun browse-url-of-region (min max)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]