'mailto:' link in an EWW buffer can now be customized. For more
information, see the related entry about 'shr-browse-url' above.
+---
+*** Support for bookmark.el.
+The command `bookmark-set' (bound to `C-x r m') is now supported, and
+will create a bookmark that opens the current URL in EWW.
+
** SHR
---
(setq-local thing-at-point-provider-alist
(append thing-at-point-provider-alist
'((url . eww--url-at-point))))
+ (setq-local bookmark-make-record-function #'eww-bookmark-make-record)
(buffer-disable-undo)
(setq buffer-read-only t))
(eww-previous-url))))
(current-buffer))
+;;; bookmark.el support
+
+(declare-function bookmark-make-record-default
+ "bookmark" (&optional no-file no-context posn))
+(declare-function bookmark-prop-get "bookmark" (bookmark prop))
+
+(defun eww-bookmark-name ()
+ "Create a default bookmark name for the current EWW buffer."
+ (plist-get eww-data :title))
+
+(defun eww-bookmark-make-record ()
+ "Create a bookmark for the current EWW buffer."
+ `(,(eww-bookmark-name)
+ ,@(bookmark-make-record-default t)
+ (location . ,(plist-get eww-data :url))
+ (handler . eww-bookmark-jump)))
+
+;;;###autoload
+(defun eww-bookmark-jump (bookmark)
+ "Default bookmark handler for EWW buffers."
+ (eww (bookmark-prop-get bookmark 'location)))
+
(provide 'eww)
;;; eww.el ends here