aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-07-06 00:32:54 +1000
committerYuchen Pei <id@ypei.org>2023-07-06 00:32:54 +1000
commit801ef503d710f559011c11d3f70e4061e587a808 (patch)
treee9e1df0e0cb6aeddcc9a8f6694f41838fb1c3b7c /emacs
parent4d9ddb8269bbae9ee52d17b5d2ca30745220fe25 (diff)
fix hnreader title
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/lisp/my/my-algo.el1
-rw-r--r--emacs/.emacs.d/lisp/my/my-hnreader.el6
2 files changed, 6 insertions, 1 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-algo.el b/emacs/.emacs.d/lisp/my/my-algo.el
index f3e8bc8..bd58476 100644
--- a/emacs/.emacs.d/lisp/my/my-algo.el
+++ b/emacs/.emacs.d/lisp/my/my-algo.el
@@ -69,4 +69,3 @@
(provide 'my-algo)
;;; my-algo.el ends here
-
diff --git a/emacs/.emacs.d/lisp/my/my-hnreader.el b/emacs/.emacs.d/lisp/my/my-hnreader.el
index 6106d29..325ab9d 100644
--- a/emacs/.emacs.d/lisp/my/my-hnreader.el
+++ b/emacs/.emacs.d/lisp/my/my-hnreader.el
@@ -68,6 +68,12 @@
(goto-char (point-min))
(forward-line 2))))
+;; To override `'hnreader--get-title'
+(defun my-hnreader--get-title (dom)
+ "Get title and link from DOM comment page."
+ (let ((a-link (dom-by-tag (dom-by-class dom "^titleline$") 'a)))
+ (cons (dom-text a-link) (dom-attr a-link 'href))))
+
;; To override `hnreader--print-comments'
(defun my-hnreader--print-comments (dom url)
"Print DOM comment and URL to buffer."