diff options
author | Po Lu <luangruo@yahoo.com> | 2021-12-26 18:13:53 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2021-12-26 18:18:39 +0800 |
commit | 501e2096d65559645d305f5b22d80f9773d8cabf (patch) | |
tree | 32915e7c8bd4efcdfee0c7ccc4ee23e90f060458 /lisp/face-remap.el | |
parent | 97218c311b506614db84233de120a012cc9b0493 (diff) | |
download | emacs-501e2096d65559645d305f5b22d80f9773d8cabf.tar.gz |
Fix some issues with a recent change
* doc/lispref/commands.texi (Misc Events): Improve documentation
on pinch events.
* etc/NEWS: Update documentation status for some recent changes
and describe pinch events in more detail.
* lisp/face-remap.el (text-scale-pinch): Prevent pinch events
from being received in too quick succession.
Diffstat (limited to 'lisp/face-remap.el')
-rw-r--r-- | lisp/face-remap.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 8507f7e8e36..67123ac7f82 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -396,8 +396,19 @@ a top-level keymap, `text-scale-increase' or ;;;###autoload (define-key global-map [pinch] 'text-scale-pinch) ;;;###autoload (defun text-scale-pinch (event) - "Adjust the height of the default face by the scale in EVENT." + "Adjust the height of the default face by the scale in the pinch event EVENT." (interactive "e") + (when (not (eq (event-basic-type event) 'pinch)) + (error "`text-scale-pinch' bound to bad event type")) + (let ((evt)) + (catch 'done + (while t + (unless (and (setq evt (read-event nil nil 0.01)) + (eq (car evt) 'pinch)) + (throw 'done nil)))) + (when (and (consp evt) + (eq (car evt) 'pinch)) + (setq event evt))) (let ((window (posn-window (nth 1 event))) (scale (nth 4 event)) (dx (nth 2 event)) |