emacs-humanities
[Top][All Lists]
Advanced

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

Re: [emacs-humanities] Extending Emacs Bookmarks to Work with EWW


From: Joe Corneli
Subject: Re: [emacs-humanities] Extending Emacs Bookmarks to Work with EWW
Date: Wed, 03 Feb 2021 15:27:00 +0000

(Here’s a slight change that makes this useful suggestion more useful
and robust!)

You said:

  "EWW seems to only update the title data when creating a new EWW
  buffer and not after you've followed one of the links in that buffer."

But...

M-x eww
https://www.olivertaylor.net/notes/emacs-extending-bookmarks.html RET
TAB TAB 
M-: (plist-get eww-data :title)

...produces "It's Magit! A Git Porcelain inside Emacs".

So, the problem isn’t that the title data isn’t updated; upon
investigation, the way the bookmarks.el logic works requires you to set
"defaults" as part of the record.  This adjustment works for me:

(defun oht-eww-bookmark-make-record ()
  "Make a bookmark record for the current eww buffer"
  `(,(plist-get eww-data :title)
    ((location . ,(eww-current-url))
     (handler . oht-eww-bookmark-handler)
     (defaults . (,(plist-get eww-data :title))))))

^^^^Note the further level of nesting here as well.

>From bookmark-make-record-function docs:

... The returned record should be a cons cell of the form (NAME . ALIST)

(All told, this motivates further investigation and use of Emacs
bookmarks.)

Attachment: EmacsP28Zc0.svg
Description: image/svg



-- 
Dr Joseph A. Corneli (https://github.com/holtzermann17)

HYPERREAL ENTERPRISES LTD is a private company limited by shares, incorporated
25th, June 2019 as Company Number 634284 on the Register of Companies for
Scotland (https://beta.companieshouse.gov.uk/company/SC634284).

reply via email to

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