Function: touch-screen-restart-drag

touch-screen-restart-drag is an interactive and byte-compiled function defined in touch-screen.el.gz.

Signature

(touch-screen-restart-drag EVENT)

Documentation

Restart dragging to select text.

Set point to the location of EVENT within its window while keeping the bounds of the region intact, and set up state for touch-screen-drag.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/touch-screen.el.gz
(defun touch-screen-restart-drag (event)
  "Restart dragging to select text.
Set point to the location of EVENT within its window while
keeping the bounds of the region intact, and set up state for
`touch-screen-drag'."
  (interactive "e")
  (let* ((posn (event-start event))
         (window (posn-window posn))
         (point (posn-point posn)))
    (with-selected-window window
      (let ((current-point (point))
            (current-mark (mark)))
        ;; Ensure that mark and point haven't changed since EVENT was
        ;; generated, and the region is still active.
        (when (or (eq point current-point)
                  (eq point current-mark)
                  (region-active-p))
          (when (eq point current-mark)
            ;; Exchange point and mark.
            (exchange-point-and-mark))
          ;; Clear the state necessary to set up dragging.  Don't try
          ;; to select entire words immediately after dragging starts,
          ;; to allow for fine grained selection inside a word.
          (setq touch-screen-word-select-bounds nil
                touch-screen-word-select-initial-word nil))))))