aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGia Thanh Vuong <thanhvg@gmail.com>2019-08-19 17:35:06 -0600
committerGia Thanh Vuong <thanhvg@gmail.com>2019-08-19 17:35:06 -0600
commit4754062b2c8bb9a985bf4154b66840010dc9b8c5 (patch)
tree4a5f6c4bf257b81acdfbea7dc7b2963860ea46dc
parent7b5007ccb919927037259fcce334451b4620837c (diff)
wip
-rw-r--r--hnreader.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/hnreader.el b/hnreader.el
index 293744b..bb7dbdf 100644
--- a/hnreader.el
+++ b/hnreader.el
@@ -74,7 +74,7 @@ third one is 80.")
(with-current-buffer buf
(read-only-mode -1)
(erase-buffer)
- (insert "#+STARTUP: overview indent\n#")
+ (insert "#+STARTUP: overview indent\n")
(cl-mapcar #'hnreader--print-frontpage-item things subtexts)
(org-mode))))
@@ -84,13 +84,16 @@ third one is 80.")
(with-current-buffer (hnreader--get-hn-comment-buffer)
(read-only-mode -1)
(erase-buffer)
+ (insert "#+STARTUP: overview indent\n")
(dolist (comment comments)
;; (setq thanh comment)
(insert (format "%s %s\n"
(hnreader--get-indent
(hnreader--get-img-tag-width comment))
(hnreader--get-comment-owner comment)))
- (shr-insert-document (hnreader--get-comment comment))))))
+ (let ((shr-width 80))
+ (shr-insert-document (hnreader--get-comment comment))))
+ (org-mode))))
(defun hnreader--get-img-tag-width (comment-dom)
"Get width attribute of img tag in COMMENT-DOM."
@@ -113,6 +116,7 @@ third one is 80.")
(defun hnreader-frontpage ()
"Testing."
+ (interactive)
(hnreader--prepare-buffer (hnreader--get-hn-buffer))
(promise-chain (hnreader--promise-dom "https://news.ycombinator.com/news")
(then (lambda (result)
@@ -122,6 +126,7 @@ third one is 80.")
(defun hnreader-comment (comment-id)
"Print hn COMMENT-ID page to buffer."
+ (interactive "sQuery: ")
(hnreader--prepare-buffer (hnreader--get-hn-comment-buffer))
(promise-chain (hnreader--promise-dom (format "https://news.ycombinator.com/item?id=%s" comment-id))
(then #'hnreader--print-comments)