Lines Matching refs:region
1 ;;; s-region.el --- set region using shift key
29 ;; Having loaded this code you can set the region by holding down the
30 ;; shift key and move the cursor to the other end of the region. The
34 ;; Currently, s-region-move may be bound only to events that are vectors
40 ;; C-insert is bound to copy-region-as-kill
41 ;; S-delete is bound to kill-region
46 (defvar s-region-overlay (make-overlay 1 1))
47 (overlay-put s-region-overlay 'face 'region)
48 (overlay-put s-region-overlay 'priority 1000000) ; for hilit19
50 (defun s-region-unshift (key)
66 (defun s-region-move-p1 (&rest arg)
69 (apply (function s-region-move) arg))
71 (defun s-region-move-p2 (&rest arg)
74 (apply (function s-region-move) arg))
76 (defun s-region-move (&rest arg)
77 (if (if mark-active (not (equal last-command 's-region-move)) t)
80 (setq this-command 's-region-move)
81 (apply (key-binding (s-region-unshift (this-command-keys))) arg)
82 (move-overlay s-region-overlay (mark) (point) (current-buffer))
84 (delete-overlay s-region-overlay))
86 (defun s-region-bind (keylist &optional map)
87 "Bind shifted keys in KEYLIST to `s-region-move-p1' or `s-region-move-p2'.
88 Each key in KEYLIST is shifted and bound to one of the `s-region-move'
103 's-region-move-p2)
104 (t 's-region-move-p1)))))
108 (s-region-bind
117 (global-set-key [C-insert] 'copy-region-as-kill))
119 (global-set-key [S-delete] 'kill-region))
123 (provide 's-region)
126 ;;; s-region.el ends here