From 96f6cace6bd088c8a49892502354272eb9d1a702 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 19 Jan 2016 19:09:45 -0500 Subject: [PATCH] Don't hard-code 1 as point-min. * lisp/image-mode.el (image-display-size): * lisp/xwidget.el (xwidget-webkit-last-session) (xwidget-webkit-current-session): Don't hard-code 1 as point-min. --- lisp/image-mode.el | 2 +- lisp/xwidget.el | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 38a25d2b7a6..e549b49001e 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -169,7 +169,7 @@ return the display size taking the slice property into account. If the list contains `image' but not `slice', return the `image-size' of the specified image." (cond ((eq (car spec) 'xwidget) - (let ((xwi (xwidget-info (xwidget-at 1)))) ; FIXME point-min? + (let ((xwi (xwidget-info (xwidget-at (point-min))))) (cons (aref xwi 2) (aref xwi 3)))) ((eq (car spec) 'image) (image-size spec pixels frame)) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 223f4f290b2..0fb90c4573c 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -245,15 +245,13 @@ XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget." "Last active webkit, or nil." (if (buffer-live-p xwidget-webkit-last-session-buffer) (with-current-buffer xwidget-webkit-last-session-buffer - (xwidget-at 1)) + (xwidget-at (point-min))) nil)) (defun xwidget-webkit-current-session () "Either the webkit in the current buffer, or the last one used. The latter might be nil." - (if (xwidget-at 1) - (xwidget-at 1) - (xwidget-webkit-last-session))) + (or (xwidget-at (point-min)) (xwidget-webkit-last-session))) (defun xwidget-adjust-size-to-content (xw) "Resize XW to content." -- 2.39.5