[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to make browse-url-default-browser use emacs-w3m?
- From: Katsumi Yamaoka <yamaoka@xxxxxxx>
- Date: Tue, 24 Dec 2013 08:49:15 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 12264
- References: <87lhzbeo1x.fsf@xxxxxxxxxxx>
In [emacs-w3m : No.12263] jidanni@xxxxxxxxxxx wrote:
> How do I make
> (define-key dired-mode-map "b" 'browse-url-of-dired-file)
> use emacs-w3m and not Firefox.
> Should I do
> (... browse-url-default-browser ... w3m-browse-url) ?
If you want the dired command "b" to run `w3m-browse-url' regardless
of any default or customized browse-url-* variables setting, try:
(define-key dired-mode-map "b"
(lambda ()
(interactive)
(let ((browse-url-browser-function #'w3m-browse-url))
(call-interactively #'browse-url-of-dired-file))))
Otherwise:
(defun my-browse-url-of-dired-file ()
"Run `browse-url-of-dired-file' using emacs-w3m."
(interactive)
(let ((browse-url-browser-function #'w3m-browse-url))
(call-interactively #'browse-url-of-dired-file)))
(define-key dired-mode-map "b" #'my-browse-url-of-dired-file)