[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: EWW func add url under point as bookmark
From: |
Alex |
Subject: |
Re: EWW func add url under point as bookmark |
Date: |
Fri, 15 Apr 2022 15:40:22 +0200 |
Yay! I get it!
#+begin_src elisp
;; Copyright 2022 Alex
;; Under GPLv3-or-later License
(defun eww-bookmark-add (url title)
"Bookmark url with a title."
(unless (stringp url)
(user-error "invalid url string required"))
(unless (stringp title)
(user-error "invalid title string required"))
(eww-read-bookmarks)
(dolist (bookmark eww-bookmarks)
(when (equal url (plist-get bookmark :url))
(user-error "Already bookmarked")))
(push (list :url url
:title title
:time (current-time-string))
eww-bookmarks)
(eww-write-bookmarks)
(message "Bookmarked %s (%s)" url title))
(defun eww-bookmark-url-under-point (title)
"Bookmark url under point"
(interactive (list (read-string "Bookmark title: ")))
(let ((str-url (thing-at-point 'url)))
(eww-bookmark-add str-url title)))
;; test here:
;; cursor on url and M-x eww-bookmark-url-under-point RET
;; http://www.gnuhacker.org
#+end_src
--
Alex
Emacs Lover.
FSF Member.
Free/Libre Software supporter.
stallmansupport.org - Disinformation succeeds because so many people
care deeply about injustice but do not take the time to check the facts.
- EWW func add url under point as bookmark, Alex, 2022/04/14
- RE: [External] : EWW func add url under point as bookmark, Drew Adams, 2022/04/14
- Re: EWW func add url under point as bookmark,
Alex <=
- Re: EWW func add url under point as bookmark, Emanuel Berg, 2022/04/15
- Re: EWW func add url under point as bookmark, Alex, 2022/04/16
- Re: EWW func add url under point as bookmark, Emanuel Berg, 2022/04/17
- Re: EWW func add url under point as bookmark, Alex, 2022/04/18
- Re: EWW func add url under point as bookmark, Emanuel Berg, 2022/04/18
- Re: EWW func add url under point as bookmark, Alex, 2022/04/18
- Re: EWW func add url under point as bookmark, Emanuel Berg, 2022/04/20
- Re: EWW func add url under point as bookmark, Emanuel Berg, 2022/04/17
Re: EWW func add url under point as bookmark, Emanuel Berg, 2022/04/15