Function: text-scale-pinch

text-scale-pinch is an autoloaded, interactive and byte-compiled function defined in face-remap.el.gz.

Signature

(text-scale-pinch EVENT)

Documentation

Adjust the height of the default face by the scale in the pinch event EVENT.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/face-remap.el.gz
;;;###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 the pinch event EVENT."
  (interactive "e")
  (when (not (eq (event-basic-type event) 'pinch))
    (error "`text-scale-pinch' bound to bad event type"))
  (let ((window (posn-window (nth 1 event)))
        (scale (nth 4 event))
        (dx (nth 2 event))
        (dy (nth 3 event))
        (angle (nth 5 event)))
    (with-selected-window window
      (when (and (zerop dx)
                 (zerop dy)
                 (zerop angle))
        (setq text-scale--pinch-start-scale
              (if text-scale-mode text-scale-mode-amount 0)))
      (text-scale-set
       (+ text-scale--pinch-start-scale
          (round (log scale text-scale-mode-step)))))))