Search code examples
elisp

Opening browser from emacs script?


I have the following emacs lisp snippet that will launch my browser from within emacs and open the specified pages. However when I run it as a script from a shell nothing happens. What more do I need to do? I tried dropping (interactive).


#!/usr/bin/emacs --script

(defun surf-news ()
  (interactive)
  (progn
    (browse-url "http://news.ycombinator.com")
    (browse-url "http://stackoverflow.com")
      ))

(surf-news)


Solution

  • A neat function I discovered yesterday is M-x webjump which has recently been added to emacs.