emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eww and bookmarks


From: Karl Fogel
Subject: Re: eww and bookmarks
Date: Sun, 24 May 2020 14:06:40 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On 24 May 2020, Alfred M. Szmidt wrote:
>I haven't followed the discussion closely, so might have missed things
>-- the addition of bookmarks for URLs would be very nice.
>
>Isn't this very easily done though, both so that it works for the case
>of eww, but also (which I think is important, in the generic case),
>simple untested hackery, in .emacs.bmk we have:
>
>("The GNU Operating System and the Free Software Movement"
> (url . "http://www.gnu.org/";)
> (handler . browse-url-bookmark-jump))
>
>Then browse-url-bookmark-jump is simply:
>
>(defun browse-url-bookmark-jump (bmk)
>  (let* ((url (bookmark-prop-get bmk 'url))
>         (buf (save-window-excursion (browse-url url) (current-buffer))))
>    (bookmark-default-handler
>     `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bmk)))))
>
>Those that like EWW would already be doing:
>
>  (setq browse-url-browser-function 'eww-browse-url)
>
>And then the equivalent browse-url-bookmark-make-record (e.g,
>Info-Info-bookmark-make-record) function for setting, which is left as
>a excersie for the reader -- or I can make a patch.  This might not
>work of course if you are outside of the context of Emacs.
>
>It would be strange if eww implemented its own bookmarking
>functionality, when all of this is already simple to add.

I've been watching this thread, trying to determine if any new functionality 
would need to be added to bookmark.el in order to support EWW bookmarks.

So far, it looks like it can all be implemented using existing functionality in 
bookmark.el, using `bookmark-make-record-function' and a handler function, as 
per above.

If it turns out that anything new is needed, please say so.  bookmark.el should 
be able to supply generic bookmarking functionality to other packages, and I'm 
happy to help with that if further extension is needed.

Best regards,
-Karl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]