Generally, the list should not include the (usually overly large)
:dom, :source and :text properties."
(let ((history (mapcar #'eww-desktop-data-1
- (cons eww-data eww-history))))
- (list :history (if eww-desktop-remove-duplicates
- (cl-remove-duplicates
- history :test #'eww-desktop-history-duplicate)
- history))))
+ (cons eww-data eww-history)))
+ (posn eww-history-position) rval)
+ (list :history
+ (if eww-desktop-remove-duplicates
+ (prog1
+ (setq
+ rval (cl-remove-duplicates
+ history :test #'eww-desktop-history-duplicate))
+ (setq posn
+ (cl-position
+ (elt history eww-history-position)
+ rval :test #'eq)))
+ history)
+ :history-position posn)))
(defun eww-restore-desktop (file-name buffer-name misc-data)
"Restore an eww buffer from its desktop file record.
(setq eww-history (cdr (plist-get misc-data :history))
eww-data (or (car (plist-get misc-data :history))
;; backwards compatibility
- (list :url (plist-get misc-data :uri))))
+ (list :url (plist-get misc-data :uri)))
+ eww-history-position (plist-get misc-data :history-position))
(unless file-name
(when (plist-get eww-data :url)
(cl-case eww-restore-desktop
;; .
(current-buffer)))
-(add-to-list 'desktop-locals-to-save
- 'eww-history-position)
(add-to-list 'desktop-buffer-mode-handlers
'(eww-mode . eww-restore-desktop))