;;;; Extremely lightweight hackernews integration
;;;; Building to learn emacs lisp, not because this
;;;; is a well thoughtout or coherent offering compared to
;;;; other packages that provide HN integration


;;;; These functions depend on haxor-news:
;;;; https://github.com/donnemartin/haxor-news
;;;; This mode is a wrapper around haxor-news
;;;; This mode is read-only, and best used in scratch/empty buffer

;;;; The main supported functionality is to display in a buffer a list of
;;;; HN top stories (in a buffer), and to then open articles in the web browser,
;;;; or display comments in a buffer

(if (executable-find "hn")
(progn
(with-temp-buffer-window "hn"
'temp-buffer-show-function
'inhibit-quit
(concat "\n" (shell-command-to-string "hn top 20")))))