;;; setup-browse-url.el ;;; ;;; Copyright (C) 2003, 2004, 2007, 2008 Thien-Thi Nguyen ;;; ;;; This file is part of ttn's personal elisp library, released under ;;; the terms of the GNU General Public License as published by the ;;; Free Software Foundation; either version 3, or (at your option) any ;;; later version. There is NO WARRANTY. See file COPYING for details. ;;; ;;; Description: Customize `browse-url'. ;;;###autoload (defun setup-browse-url () "Set up `browse-url' to use w3m in rxvt (if window system). Create a \"fake\" ~/bin/lynx program that execs w3m if necessary." (interactive) (when window-system (setq browse-url-xterm-program "rxvt" browse-url-browser-function 'browse-url-lynx-xterm) (let ((fake-lynx (concat (getenv "HOME") "/bin/lynx"))) (unless (file-exists-p fake-lynx) (with-temp-buffer (insert "#!/bin/sh\n") (insert "exec w3m \"$@\"\n") (write-file fake-lynx)) (shell-command (concat "chmod +x " fake-lynx)))))) (provide 'setup-browse-url) ;;; setup-browse-url.el ends here