From 187a6b1509bf280ce73979aefc9af26babeca6d5 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Fri, 28 Nov 2014 02:13:32 -0500 Subject: [PATCH] Deprecate w3m in preference for eww in emacs - setup a default external browser add a function for accessing the last - url before point (this is useful all over the place but namely in rcirc) Signed-off-by: Collin J. Doering --- .emacs.d/config/w3m.el | 27 --------------------------- .emacs.d/config/web.el | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 27 deletions(-) delete mode 100644 .emacs.d/config/w3m.el diff --git a/.emacs.d/config/w3m.el b/.emacs.d/config/w3m.el deleted file mode 100644 index c504a44..0000000 --- a/.emacs.d/config/w3m.el +++ /dev/null @@ -1,27 +0,0 @@ -;; (C) Copyright Collin J. Doering 2014 -;; -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;; File: w3m.el -;; Author: Collin J. Doering -;; Date: Oct 22, 2014 - -;; This is going to be retired/replaced upon the release of emacs 24.4 (due to the introduction of eww) - -;; setup html renderer w3m and external browser conkeror -(require 'w3m-load) ;; AUR: emacs-w3m-cvs -(setq browse-url-browser-function 'w3m-browse-url - browse-url-generic-program "conkeror" - w3m-use-cookies t) -(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t) diff --git a/.emacs.d/config/web.el b/.emacs.d/config/web.el index 60de7e2..374fe63 100644 --- a/.emacs.d/config/web.el +++ b/.emacs.d/config/web.el @@ -17,6 +17,20 @@ ;; Author: Collin J. Doering ;; Date: Oct 22, 2014 +;; Setup web browsing +(setq browse-url-browser-function 'browse-url-generic + browse-url-generic-program "conkeror") + +(defun browse-url-before-point () + "Find the first url before point and open it in a browser using browse-url" + (interactive) + (save-excursion + (search-backward-regexp "\(file\|ftp\\|http\\|https\)://.*\.") + (browse-url-at-point))) + +(global-set-key (kbd "C-c g") 'browse-url-at-point) +(global-set-key (kbd "C-c G") 'browse-url-before-point) + ;; setup php-mode (autoload 'php-mode "php-mode.el" "Php mode." t) ;; ELPA (setq auto-mode-alist (append '(("/*.\.php[345]?$" . php-mode)) auto-mode-alist))