Created
June 3, 2016 09:36
-
-
Save timepp/1327e2d90bc399e5f67da4b7916c6c5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 这个snippet实现在EMACS中左键点击用缺省浏览器打开,右键点击用FIREFOX打开。 | |
; 先要把org mode的右键功能禁用。(注意org mode 的mouse-3跟mouse-1并不一样,看你能否接受) | |
(add-hook 'org-mode-hook | |
(lambda () (org-defkey org-mouse-map [mouse-3] nil))) | |
; 建一个function绑定到mouse-3 | |
(add-to-list 'exec-path "c:/Program Files (x86)/Mozilla Firefox/") | |
(defun browse-url-at-mouse-with-firefox (event) | |
"browse the url with firefox" | |
(interactive "e") | |
(save-excursion | |
(mouse-set-point event) | |
(let ((browse-url-browser-function 'browse-url-firefox)) | |
(org-open-at-point)))) | |
(global-set-key (kbd "<mouse-3>") 'browse-url-at-mouse-with-firefox) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment