help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to setup w3m-el as a default browser on GNU system?


From: Tim X
Subject: Re: How to setup w3m-el as a default browser on GNU system?
Date: Wed, 08 Dec 2010 15:14:46 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Paul Chany <csanyipal@gmail.com> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>> Paul Chany <csanyipal@gmail.com> writes:
>>> I need this setup because when in org-mode and want follow a link to a
>>> file://path/some.html then an xterm being started and on it w3m as a
>>> default browser. I try to setup Emacs and org-mode to open this file in
>>> Emacs buffer in w3m-el but without any success. What am I missing here?
>
>> See related things to w3m in files .emacs.el and w3m-config.el here:
>> http://mercurial.intuxication.org/hg/emacs-utils
>> Hope that help.
>
> Unfortunately I can't find there the solution for my problem, sorry.

What I have is 

 '(browse-url-browser-function (quote w3m-browse-url))

in my custom section. i.e. M-x customize-variable
browse-util-browser-function

This will make the browse-url package use w3m to browse urls. 

Another post showed how to set org mode to use w3m for browsing org mode
file links that are html files

I also have the following additional customizations 

(defun w3m-browse-url-other-window (url &optional arg)
  "Browse URL with w3m, use other window."
  (interactive
   (browse-url-interactive-arg "w3m URL: "))
  (when (stringp url)
    (let ((buffer (get-buffer "*w3m*")))
      (switch-to-buffer-other-window (if buffer buffer (current-buffer)))
      (w3m-goto-url url))))

(global-set-key "\C-c\C-z." 'browse-url-at-point)
(global-set-key "\C-c\C-zb" 'browse-url-of-buffer)
(global-set-key "\C-c\C-zr" 'browse-url-of-region)
(global-set-key "\C-c\C-zu" 'browse-url)
(global-set-key "\C-c\C-zv" 'browse-url-of-file)

(add-hook 'dired-mode-hook
                  (lambda ()
                        (local-set-key "\C-c\C-zf" 'browse-url-of-dired-file)))

Note that if your using emacs23 and your on debian, you need the
w3m-el-snapshot package rather than just the w3m-el package as the last
'released' version of w3m-el does nto work with emacw23.

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

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