aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-05-13 09:51:32 -0700
committerPaul Eggert2016-05-13 09:52:43 -0700
commitedae7d93ed509aa8a7db3952c70550cf3353d169 (patch)
tree73bc3d8aa30b657f7ca201c99bae92209967f86c
parent9c2a1a264cf418fcf187b95b49fe986b32ceabef (diff)
downloademacs-edae7d93ed509aa8a7db3952c70550cf3353d169.tar.gz
emacs-edae7d93ed509aa8a7db3952c70550cf3353d169.zip
Remove buggy non-native image scrolling
This never worked, and could cause infinite recursion. Problem reported by Glenn Morris (Bug#22465). * lisp/xwidget.el (xwidget-webkit-scroll-behavior): Remove. All uses removed.
-rw-r--r--lisp/xwidget.el43
1 files changed, 9 insertions, 34 deletions
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index 19f631f17f3..7a0ca8bd551 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -34,13 +34,6 @@
34(require 'cl-lib) 34(require 'cl-lib)
35(require 'bookmark) 35(require 'bookmark)
36 36
37(defcustom xwidget-webkit-scroll-behavior 'native
38 "Scrolling behavior of the webkit instance.
39The possible values are: `native' or `image'."
40 :version "25.1"
41 :group 'frames ; TODO add xwidgets group if more options are added
42 :type '(choice (const native) (const image)))
43
44(declare-function make-xwidget "xwidget.c" 37(declare-function make-xwidget "xwidget.c"
45 (type title width height arguments &optional buffer)) 38 (type title width height arguments &optional buffer))
46(declare-function xwidget-set-adjustment "xwidget.c" 39(declare-function xwidget-set-adjustment "xwidget.c"
@@ -141,40 +134,24 @@ Interactively, URL defaults to the string looking like a url around point."
141 "Keymap for `xwidget-webkit-mode'.") 134 "Keymap for `xwidget-webkit-mode'.")
142 135
143(defun xwidget-webkit-scroll-up () 136(defun xwidget-webkit-scroll-up ()
144 "Scroll webkit up. 137 "Scroll webkit up."
145Depending on the value of `xwidget-webkit-scroll-behavior',
146this scrolls in `native' fashion, or like `image-mode' would."
147 (interactive) 138 (interactive)
148 (if (eq xwidget-webkit-scroll-behavior 'native) 139 (xwidget-set-adjustment (xwidget-webkit-last-session) 'vertical t 50))
149 (xwidget-set-adjustment (xwidget-webkit-last-session) 'vertical t 50)
150 (image-scroll-up)))
151 140
152(defun xwidget-webkit-scroll-down () 141(defun xwidget-webkit-scroll-down ()
153 "Scroll webkit down. 142 "Scroll webkit down."
154Depending on the value of `xwidget-webkit-scroll-behavior',
155this scrolls in `native' fashion, or like `image-mode' would."
156 (interactive) 143 (interactive)
157 (if (eq xwidget-webkit-scroll-behavior 'native) 144 (xwidget-set-adjustment (xwidget-webkit-last-session) 'vertical t -50))
158 (xwidget-set-adjustment (xwidget-webkit-last-session) 'vertical t -50)
159 (image-scroll-down)))
160 145
161(defun xwidget-webkit-scroll-forward () 146(defun xwidget-webkit-scroll-forward ()
162 "Scroll webkit forwards. 147 "Scroll webkit forwards."
163Depending on the value of `xwidget-webkit-scroll-behavior',
164this scrolls in `native' fashion, or like `image-mode' would."
165 (interactive) 148 (interactive)
166 (if (eq xwidget-webkit-scroll-behavior 'native) 149 (xwidget-set-adjustment (xwidget-webkit-last-session) 'horizontal t 50))
167 (xwidget-set-adjustment (xwidget-webkit-last-session) 'horizontal t 50)
168 (xwidget-webkit-scroll-forward))) ; FIXME infloop!
169 150
170(defun xwidget-webkit-scroll-backward () 151(defun xwidget-webkit-scroll-backward ()
171 "Scroll webkit backwards. 152 "Scroll webkit backwards."
172Depending on the value of `xwidget-webkit-scroll-behavior',
173this scrolls in `native' fashion, or like `image-mode' would."
174 (interactive) 153 (interactive)
175 (if (eq xwidget-webkit-scroll-behavior 'native) 154 (xwidget-set-adjustment (xwidget-webkit-last-session) 'horizontal t -50))
176 (xwidget-set-adjustment (xwidget-webkit-last-session) 'horizontal t -50)
177 (xwidget-webkit-scroll-backward))) ; FIXME infloop!
178 155
179 156
180;; The xwidget event needs to go into a higher level handler 157;; The xwidget event needs to go into a higher level handler
@@ -417,9 +394,7 @@ For example, use this to display an anchor."
417(defun xwidget-webkit-adjust-size-dispatch () 394(defun xwidget-webkit-adjust-size-dispatch ()
418 "Adjust size according to mode." 395 "Adjust size according to mode."
419 (interactive) 396 (interactive)
420 (if (eq xwidget-webkit-scroll-behavior 'native) 397 (xwidget-webkit-adjust-size-to-window)
421 (xwidget-webkit-adjust-size-to-window)
422 (xwidget-webkit-adjust-size-to-content))
423 ;; The recenter is intended to correct a visual glitch. 398 ;; The recenter is intended to correct a visual glitch.
424 ;; It errors out if the buffer isn't visible, but then we don't get 399 ;; It errors out if the buffer isn't visible, but then we don't get
425 ;; the glitch, so silence errors. 400 ;; the glitch, so silence errors.