hn.el 789 B

123456789101112131415161718192021
  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. ;;;; These functions depend on haxor-news:
  6. ;;;; https://github.com/donnemartin/haxor-news
  7. ;;;; This mode is a wrapper around haxor-news
  8. ;;;; This mode is read-only, and best used in scratch/empty buffer
  9. ;;;; The main supported functionality is to display in a buffer a list of
  10. ;;;; HN top stories (in a buffer), and to then open articles in the web browser,
  11. ;;;; or display comments in a buffer
  12. (if (executable-find "hn")
  13. (progn
  14. (with-temp-buffer-window "hn"
  15. 'temp-buffer-show-function
  16. 'inhibit-quit
  17. (concat "\n" (shell-command-to-string "hn top 20")))))