diff options
-rw-r--r-- | TODOs.org | 4 | ||||
-rw-r--r-- | hnreader.el | 14 |
2 files changed, 15 insertions, 3 deletions
@@ -57,7 +57,7 @@ just a private flag on running * DONE comment page show main link and intro text * DONE display page takes page number -* TODO reload page +* DONE reload page * DONE frontpage has next page link * DONE remove * in text find and replace raw htlm '>*' with '>-' @@ -107,3 +107,5 @@ class fatitem is 4 long when ask it's 6 items long just take from 1 to the peniculate item with seq-take and seq-drop * DONE add back (history) button a variable to hold history +* DONE option to open comment in same window +use pop-to-buffer diff --git a/hnreader.el b/hnreader.el index ac89419..21c4671 100644 --- a/hnreader.el +++ b/hnreader.el @@ -39,6 +39,8 @@ ;;; Customization ;; hnreader-history-max: max number history items to remember. +;; hnreader-view-comments-in-same-window: if nil then will not create new window +;; when viewing comments ;;; Code: (require 'promise) @@ -58,7 +60,12 @@ (defcustom hnreader-history-max 100 "Max history to remember." - :type 'number + :type 'integer + :group 'hnreader) + +(defcustom hnreader-view-comments-in-same-window t + "Max history to remember." + :type 'boolean :group 'hnreader) ;; internal stuff @@ -118,7 +125,10 @@ third one is 80.") (defun hnreader--prepare-buffer (buf &optional msg) "Print MSG message and prepare window for BUF buffer." (when (not (equal (window-buffer) buf)) - (switch-to-buffer-other-window buf)) + (if hnreader-view-comments-in-same-window + ;; (switch-to-buffer buf) + (pop-to-buffer buf) + (switch-to-buffer-other-window buf))) ;; (display-buffer buf '(display-buffer-use-some-window (inhibit-same-window . t)))) (with-current-buffer buf (read-only-mode -1) |