summary refs log tree commit diff stats
path: root/lisp/acdw-eww.el
diff options
context:
space:
mode:
authorCase Duckworth2021-11-21 23:57:41 -0600
committerCase Duckworth2021-11-21 23:57:41 -0600
commita2657993bad828af6743c68931a0e848bfcdec53 (patch)
tree1e9220389184a0c68bc9f6bfe08edca3f2a362e6 /lisp/acdw-eww.el
parentUn-stupidify org-mode filling (diff)
downloademacs-a2657993bad828af6743c68931a0e848bfcdec53.tar.gz
emacs-a2657993bad828af6743c68931a0e848bfcdec53.zip
I DECLARE BANKRUPTCY ... 8
Didn't think to do this till pretty .. written, so here we are.
Diffstat (limited to 'lisp/acdw-eww.el')
-rw-r--r--lisp/acdw-eww.el38
1 files changed, 0 insertions, 38 deletions
diff --git a/lisp/acdw-eww.el b/lisp/acdw-eww.el deleted file mode 100644 index 8e7f42d..0000000 --- a/lisp/acdw-eww.el +++ /dev/null
@@ -1,38 +0,0 @@
1;;; acdw-eww.el --- EWW customizations -*- lexical-binding: t -*-
2
3(require 'bookmark)
4(require 'eww)
5
6(defun bookmark-eww--make ()
7 "Make eww bookmark record."
8 `((filename . ,(plist-get eww-data :url))
9 (title . ,(plist-get eww-data :title))
10 (time . ,(current-time-string))
11 (handler . ,#'bookmark-eww-handler)
12 (defaults . (,(concat
13 ;; url without the https and path
14 (replace-regexp-in-string
15 "/.*" ""
16 (replace-regexp-in-string
17 "\\`https?://" ""
18 (plist-get eww-data :url)))
19 " - "
20 ;; page title
21 (replace-regexp-in-string
22 "\\` +\\| +\\'" ""
23 (replace-regexp-in-string
24 "[\n\t\r ]+" " "
25 (plist-get eww-data :title))))))))
26
27
28
29(defun bookmark-eww-handler (bm)
30 "Handler for eww bookmarks."
31 (eww-browse-url (alist-get 'filename bm)))
32
33(defun bookmark-eww--setup ()
34 "Setup eww bookmark integration."
35 (setq-local bookmark-make-record-function #'bookmark-eww--make))
36
37(provide 'acdw-eww)
38;;; acdw-eww.el ends here