diff options
author | Thanh Vuong <thanhvg@gmail.com> | 2019-08-29 23:34:10 -0600 |
---|---|---|
committer | Thanh Vuong <thanhvg@gmail.com> | 2019-08-29 23:34:10 -0600 |
commit | 6df795e121ef7dd2cc062890dae1e8962a11b46d (patch) | |
tree | 11d78c8dcae7e8dcdbda154fab4e5ec42756df80 | |
parent | 1006f0191fe6482b368e6267d04b59e3cda014ae (diff) |
a bit smart on picking window to display buffer
-rw-r--r-- | TODOs.org | 5 | ||||
-rw-r--r-- | hnreader.el | 2 |
2 files changed, 5 insertions, 2 deletions
@@ -108,4 +108,7 @@ 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 +use pop-to-buffer isn't what we want, pop-to-buffer-same-window looks the same +as switch-to-buffer display-buffer returns windows most of the time, so use it +instead with select-window + (select-window (display-buffer buf '(display-buffer-use-some-window))) diff --git a/hnreader.el b/hnreader.el index 21c4671..92e67ed 100644 --- a/hnreader.el +++ b/hnreader.el @@ -127,7 +127,7 @@ third one is 80.") (when (not (equal (window-buffer) buf)) (if hnreader-view-comments-in-same-window ;; (switch-to-buffer buf) - (pop-to-buffer buf) + (select-window (display-buffer buf '(display-buffer-use-some-window))) (switch-to-buffer-other-window buf))) ;; (display-buffer buf '(display-buffer-use-some-window (inhibit-same-window . t)))) (with-current-buffer buf |