1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-14 09:39:42 +00:00

First attempt at bookmark support

This commit is contained in:
Joakim Verona 2015-01-28 01:02:43 +01:00
parent 2a9de01372
commit ac94737e8d

View File

@ -1,4 +1,4 @@
;;; xwidget.el --- api functions for xwidgets
p;;; xwidget.el --- api functions for xwidgets -*- lexical-binding: t -*-
;; see xwidget.c for more api functions
@ -224,12 +224,21 @@ XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget."
(t (xwidget-log "unhandled event:%s" xwidget-event-type)))))
(t (xwidget-log "error: callback called for xwidget with dead buffer")))))
(defvar bookmark-make-record-function)
(define-derived-mode xwidget-webkit-mode
special-mode "xwidget-webkit" "xwidget webkit view mode"
(setq buffer-read-only t)
(setq-local bookmark-make-record-function
#'xwidget-webkit-bookmark-make-record)
;; Keep track of [vh]scroll when switching buffers
(image-mode-setup-winprops))
(defun xwidget-webkit-bookmark-make-record ()
(nconc (bookmark-make-record-default t t)
`((page . ,(xwidget-webkit-current-url))
(handler . (lambda (bmk) (browse-url (bookmark-prop-get bmk 'page)))))))
(defvar xwidget-webkit-last-session-buffer nil)
(defun xwidget-webkit-last-session ()