From: Joakim Verona Date: Wed, 28 Jan 2015 00:02:43 +0000 (+0100) Subject: First attempt at bookmark support X-Git-Tag: emacs-25.0.90~2575 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ac94737e8d0d4ae737ce15b62c8aab23d759ba72;p=emacs.git First attempt at bookmark support --- diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 4ea21396103..4471b122177 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -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 ()