• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:region +defs:end

46 (defcustom mouse-drag-copy-region t
47 "*If non-nil, mouse drag copies region to kill-ring."
333 (let ((new-height (1+ (cdr (posn-col-row (event-end click)))))
349 (let ((new-width (1+ (car (posn-col-row (event-end click)))))
632 ;; Use event-end in case called from mouse-drag-region.
633 ;; If EVENT is a click, event-end and event-start give same value.
634 (posn-set-point (event-end event)))
636 (defvar mouse-last-region-beg nil)
637 (defvar mouse-last-region-end nil)
638 (defvar mouse-last-region-tick nil)
640 (defun mouse-region-match ()
641 "Return non-nil if there's an active region that was set with the mouse."
643 (eq mouse-last-region-beg (region-beginning))
644 (eq mouse-last-region-end (region-end))
645 (eq mouse-last-region-tick (buffer-modified-tick))))
647 (defun mouse-set-region (click)
648 "Set the region to the text dragged over, and copy to kill ring.
653 (end (event-end click)))
664 (if (numberp (posn-point end))
665 (goto-char (posn-point end)))
666 ;; Don't set this-command to kill-region, so that a following
669 (when mouse-drag-copy-region
671 (copy-region-as-kill (mark) (point))))
672 (mouse-set-region-1)))
674 (defun mouse-set-region-1 ()
678 (setq mouse-last-region-beg (region-beginning))
679 (setq mouse-last-region-end (region-end))
680 (setq mouse-last-region-tick (buffer-modified-tick)))
720 (if (window-end window)
722 (goto-char (window-end window))
723 ;; window-end doesn't reflect the window's new
743 (overlay-put ol 'face 'region)
750 (defun mouse-drag-region (start-event)
751 "Set the region to the text that the mouse is dragged over.
872 (defun mouse-move-drag-overlay (ol start end mode)
873 (unless (= start end)
877 ;; a region if it's on intangible text. This exception was originally
878 ;; only applied on entry to mouse-drag-region, which had the problem
882 (goto-char end)
883 (setq end (point)))
884 (let ((range (mouse-start-end start end mode)))
888 do-mouse-drag-region-post-process)
890 The region will be defined with mark and point, and the overlay
892 should only be used by mouse-drag-region."
930 ;; use the end of that text, and put it in START-POINT.
940 (let (event end end-point last-end-point)
953 (setq end (event-end event)
954 end-point (posn-point end))
955 (if (numberp end-point)
956 (setq last-end-point end-point))
960 ((and (eq (posn-window end) start-window)
961 (integer-or-marker-p end-point))
962 (mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count))
979 (setq end (event-end event)
980 end-point (posn-point end))
981 (eq (posn-window end) start-window)
982 (integer-or-marker-p end-point))
983 (mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count))
992 mouse-set-region))))))
995 (overlay-end mouse-drag-overlay)))
998 (if (numberp (posn-point (event-end event)))
999 (posn-point (event-end event))
1000 last-end-point))
1001 ;; The end that comes from where we ended the drag.
1003 (region-termination
1006 (overlay-end mouse-drag-overlay)))
1007 ;; The end that comes from where we started the drag.
1009 (region-commencement
1010 (- (+ (overlay-end mouse-drag-overlay)
1012 region-termination))
1014 (push-mark region-commencement t t)
1015 (goto-char region-termination)
1016 (if (not do-mouse-drag-region-post-process)
1019 ;; Don't let copy-region-as-kill set deactivate-mark.
1020 (when mouse-drag-copy-region
1022 (copy-region-as-kill (point) (mark t))))
1028 ;; avoid trying to use the region.
1031 (mouse-set-region-1)))))
1048 (or end-point
1052 (or (not end-point) (= end-point start-point))
1061 (t1 (posn-timestamp (event-end event))))
1080 ;; Case where the end-event is not a cons cell (it's just a boring
1117 (defun mouse-start-end (start end mode)
1118 "Return a list of region bounds based on START and END according to MODE.
1121 mark to end of word at (max START END).
1123 (if (> start end)
1125 (setq start end
1126 end temp)))
1129 (list start end))
1131 (= start end)
1140 (= start end)
1149 (= start end)
1164 (error end))))
1171 (error end)))
1179 (goto-char end)
1188 (goto-char end)
1225 (defcustom mouse-region-delete-keys '([delete] [deletechar] [backspace])
1226 "List of keys that should cause the mouse region to be deleted."
1255 (eq (posn-point (event-end event))
1260 (not (member key mouse-region-delete-keys)))))
1263 (eq (posn-point (event-end event))
1273 ;; For certain special keys, delete the region.
1274 (if (member key mouse-region-delete-keys)
1281 (setq this-original-command 'delete-region)
1310 "Kill the region between point and the mouse click.
1311 The text is saved in the kill ring, as with \\[kill-region]."
1318 (kill-region (min (point) click-posn)
1323 Also move point to one end of the text thus inserted (normally the end),
1337 "Copy the region between point and the mouse click in the kill ring.
1338 This does not delete the region; it acts like \\[kill-ring-save]."
1353 (defun mouse-save-then-kill-delete-region (beg end)
1357 (if (or (= beg end) (eq buffer-undo-list t))
1360 (delete-region beg end)
1365 (delete-region beg
1366 (+ beg (if (> end beg) 1 -1))))
1371 ;; Now delete the rest of the specified region,
1374 (if (/= (length (car kill-ring)) (- (max end beg) (min end beg)))
1375 (error "Lossage in mouse-save-then-kill-delete-region"))
1376 (delete-region beg end))
1384 (setcar tail (cons (car kill-ring) (min beg end))))))
1405 ;; prevent setting this-command to kill-region.
1418 (mouse-start-end click-posn click-posn
1420 ;; Move whichever end is closer to the click.
1426 ;; We have already put the old region in the kill ring.
1427 ;; Replace it with the extended region.
1430 (mouse-set-region-1)
1431 ;; Arrange for a repeated mouse-3 to kill this region.
1437 (mouse-save-then-kill-delete-region (mark) (point))
1447 (mouse-save-then-kill-delete-region (point) (mark))
1456 '(mouse-drag-region mouse-set-region))
1459 ;; We have a selection or suitable region, so adjust it.
1465 ;; Move whichever end of the region is closer to the click.
1479 (mouse-set-region-1)
1500 ;; A marker which records the specified first end for a secondary selection.
1505 "Set one end of the secondary selection to the position clicked on.
1506 Use \\[mouse-secondary-save-then-kill] to set the other end
1527 (end (event-end click)))
1531 (move-overlay mouse-secondary-overlay beg (posn-point end))
1535 (overlay-end mouse-secondary-overlay))))))
1560 (let ((range (mouse-start-end start-point start-point click-count)))
1572 (let (event end end-point)
1581 (setq end (event-end event)
1582 end-point (posn-point end))
1585 ((and (eq (posn-window end) start-window)
1586 (integer-or-marker-p end-point))
1587 (let ((range (mouse-start-end start-point end-point
1589 (if (or (/= start-point end-point)
1619 (overlay-end mouse-secondary-overlay)))))))))
1623 Move point to the end of the inserted text.
1650 (kill-region (overlay-start mouse-secondary-overlay)
1651 (overlay-end mouse-secondary-overlay))))
1674 ;; prevent setting this-command to kill-region.
1688 (mouse-start-end click-posn click-posn
1690 ;; Move whichever end is closer to the click.
1693 (abs (- click-posn (overlay-end mouse-secondary-overlay))))
1695 (overlay-end mouse-secondary-overlay))
1699 ;; We have already put the old region in the kill ring.
1700 ;; Replace it with the extended region.
1704 (overlay-end mouse-secondary-overlay)) t)
1705 ;; Arrange for a repeated mouse-3 to kill this region.
1711 (mouse-save-then-kill-delete-region
1713 (overlay-end mouse-secondary-overlay))
1724 (mouse-save-then-kill-delete-region
1726 (overlay-end mouse-secondary-overlay))
1734 ;; Move whichever end of the region is closer to the click.
1737 (abs (- click-posn (overlay-end mouse-secondary-overlay))))
1739 (overlay-end mouse-secondary-overlay))
1747 ;; replace it with the extended region.
1751 (overlay-end mouse-secondary-overlay)) t)
1753 (copy-region-as-kill (overlay-start mouse-secondary-overlay)
1754 (overlay-end mouse-secondary-overlay)))))
1756 ;; All we have is one end of a selection,
1757 ;; so put the other end here.
1767 (overlay-end mouse-secondary-overlay)))))))
2109 ;;;!! ;; (end-of-line)
2112 ;;;!! ;; (- (region-end) (region-beginning))) 1))
2118 ;;;!! ;;(defvar end-delim "[^ \t]")
2132 ;;;!! ;; (end-reg nil)
2133 ;;;!! ;; (end-column nil)
2143 ;;;!! ;; (setq begin-reg (1- (re-search-forward end-delim)))
2145 ;;;!! ;; (end-of-line)
2146 ;;;!! ;; (setq end-reg (1+ (re-search-backward begin-delim)))
2147 ;;;!! ;; (setq end-column (1+ (current-column)))
2148 ;;;!! ;; (message "%s" (buffer-substring begin-reg end-reg))
2152 ;;;!! ;; (- end-column begin-column) 1))))))))))
2300 (let (beg end)
2302 (setq end (point) beg (1+ (point))))
2306 (setq end (or (next-single-property-change end 'mouse-face)
2308 (setq choice (buffer-substring-no-properties beg end)))))
2431 (define-key global-map [down-mouse-1] 'mouse-drag-region)
2433 (global-set-key [drag-mouse-1] 'mouse-set-region)
2435 ;; These are tested for in mouse-drag-region.