emacs/elisp/hn.el
1	;;;; Extremely lightweight hackernews integration
2 ;;;; Building to learn emacs lisp, not because this
3 ;;;; is a well thoughtout or coherent offering compared to
4 ;;;; other packages that provide HN integration
5
6
7 ;;;; These functions depend on haxor-news:
8 ;;;; https://github.com/donnemartin/haxor-news
9 ;;;; This mode is a wrapper around haxor-news
10 ;;;; This mode is read-only, and best used in scratch/empty buffer
11
12 ;;;; The main supported functionality is to display in a buffer a list of
13 ;;;; HN top stories (in a buffer), and to then open articles in the web browser,
14 ;;;; or display comments in a buffer
15
16 (if (executable-find "hn")
17 (progn
18 (with-temp-buffer-window "hn"
19 'temp-buffer-show-function
20 'inhibit-quit
21 (concat "\n" (shell-command-to-string "hn top 20")))))