2012-01-27 48 views

回答

3

這裏是你如何能做到這:

(defun browse-url-with-w3m (event) 
    (interactive "e") 
    (let ((browse-url-browser-function 'w3m-browse-url)) 
    (browse-url-at-mouse event))) 

(defun browse-url-with-default-browser (event) 
    (interactive "e") 
    (let ((browse-url-browser-function 'browse-url-default-browser)) 
    (browse-url-at-mouse event))) 

(global-set-key (kbd "<mouse-1>") 'browse-url-with-w3m) 
(global-set-key (kbd "<C-down-mouse-1>") 'browse-url-with-default-browser) 

注意,我認爲Chrome是默認瀏覽器,你是 使用emacs-w3m的。當然,您可以自定義變量 browse-url-browser-function

0

Daimrod的解決方案有輕微的修改工作非常好,我有三個不同的瀏覽器:

(defun browse-url-with-default-browser (event) 
    (interactive "e") 
    (let ((browse-url-browser-function 'browse-url-default-browser)) 
     (mouse-set-point event)  
     (org-open-at-point))) 

(defun browse-url-with-generic (event) 
    (interactive "e") 
    (let ((browse-url-browser-function 'browse-url-generic)) 
     (mouse-set-point event)  
    (org-open-at-point))) 

(defun browse-url-with-w3m (event) 
    (interactive "e") 
    (let ((browse-url-browser-function 'w3m-browse-url)) 
    (mouse-set-point event)  
    (org-open-at-point))) 

(global-set-key (kbd "<mouse-1>") 'browse-url-with-default-browser) 
(global-set-key (kbd "<C-mouse-1>") 'browse-url-with-generic) 
(global-set-key (kbd "C-x <mouse-1>") 'browse-url-with-w3m) 

(custom-set-variables 
    '(browse-url-browser-function (quote browse-url-default-browser)) 
    '(browse-url-generic-program "chromium-browser")) 

雖然Firefox是不是我的默認瀏覽器系統的Emacs不知何故將其視爲默認。所以,火狐與推出鼠標1,鉻與C-鼠標1和w3m的與C-X鼠標1

相關問題