[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: find-grep-dired vs. browse-url-of-dired-file
From: |
Kevin Rodgers |
Subject: |
Re: find-grep-dired vs. browse-url-of-dired-file |
Date: |
Fri, 10 Dec 2004 10:43:08 -0700 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041105) |
Dan Jacobson wrote:
> browse-url-of-dired-file doesn't work in find-grep-dired result buffers.
Could you possibly be more vague?
The only problem I see is when the find-grep-dired result buffer lists
matches relative to my home directory. Then dired-get-filename returns
a string like "~/MB3STAGE/com/ihs/metabase/XHTML.html", which
browse-url-of-dired-file passes to browse-url-of-file; which in turn
calls browse-url-file-url to map the file name to a URL before calling
browse-url. browse-url-file-url depends on browse-url-filename-alist to
prepend "file:" to an absolute file name, but in this case the file name
doesn't begin with a slash. All that's needed to fix that is for
browse-url-of-file to call expand-file-name first:
*** emacs-21.3/lisp/net/browse-url.el~ Wed Dec 4 05:38:27 2002
--- emacs-21.3/lisp/net/browse-url.el Fri Dec 10 10:38:04 2004
***************
*** 535,541 ****
`browse-url-file-url'. Pass the URL to a browser using the
`browse-url' function then run `browse-url-of-file-hook'."
(interactive)
! (or file
(setq file (buffer-file-name))
(error "Current buffer has no file"))
(let ((buf (get-file-buffer file)))
--- 535,542 ----
`browse-url-file-url'. Pass the URL to a browser using the
`browse-url' function then run `browse-url-of-file-hook'."
(interactive)
! (or (and file
! (setq file (expand-file-name file)))
(setq file (buffer-file-name))
(error "Current buffer has no file"))
(let ((buf (get-file-buffer file)))
--
Kevin Rodgers