comparison lisp/emulation/cua-base.el @ 58963:e1b2a6ac991b

(cua--preserve-mark-commands): Remove. (cua--undo-push-mark): Remove. (cua--pre-command-handler, cua--post-command-handler): Don't fiddle with inhibit-mark-movement.
author Kim F. Storm <storm@cua.dk>
date Tue, 14 Dec 2004 12:18:30 +0000
parents 0b3a265b0a9c
children 97e808b19272 eac554634bfa
comparison
equal deleted inserted replaced
58962:eb752b1a84b1 58963:e1b2a6ac991b
1001 Extra commands should be added to `cua-movement-commands'") 1001 Extra commands should be added to `cua-movement-commands'")
1002 1002
1003 (defvar cua-movement-commands nil 1003 (defvar cua-movement-commands nil
1004 "User may add additional movement commands to this list.") 1004 "User may add additional movement commands to this list.")
1005 1005
1006 (defvar cua--preserve-mark-commands
1007 '(end-of-buffer beginning-of-buffer)
1008 "List of movement commands that move the mark.
1009 CUA will preserve the previous mark position if a mark is already
1010 active before one of these commands is executed.")
1011
1012 (defvar cua--undo-push-mark nil)
1013
1014 ;;; Scrolling commands which does not signal errors at top/bottom 1006 ;;; Scrolling commands which does not signal errors at top/bottom
1015 ;;; of buffer at first key-press (instead moves to top/bottom 1007 ;;; of buffer at first key-press (instead moves to top/bottom
1016 ;;; of buffer). 1008 ;;; of buffer).
1017 1009
1018 (defun cua-scroll-up (&optional arg) 1010 (defun cua-scroll-up (&optional arg)
1098 (cond 1090 (cond
1099 ((memq 'shift (event-modifiers 1091 ((memq 'shift (event-modifiers
1100 (aref (if window-system 1092 (aref (if window-system
1101 (this-single-command-raw-keys) 1093 (this-single-command-raw-keys)
1102 (this-single-command-keys)) 0))) 1094 (this-single-command-keys)) 0)))
1103 (if mark-active 1095 (unless mark-active
1104 (if (and (memq this-command cua--preserve-mark-commands)
1105 (not inhibit-mark-movement))
1106 (setq cua--undo-push-mark t
1107 inhibit-mark-movement t))
1108 (push-mark-command nil t)) 1096 (push-mark-command nil t))
1109 (setq cua--last-region-shifted t) 1097 (setq cua--last-region-shifted t)
1110 (setq cua--explicit-region-start nil)) 1098 (setq cua--explicit-region-start nil))
1111 ((or cua--explicit-region-start cua--rectangle) 1099 ((or cua--explicit-region-start cua--rectangle)
1112 (unless mark-active 1100 (unless mark-active
1149 ;;; Post-command hook 1137 ;;; Post-command hook
1150 1138
1151 (defun cua--post-command-handler () 1139 (defun cua--post-command-handler ()
1152 (condition-case nil 1140 (condition-case nil
1153 (progn 1141 (progn
1154 (when cua--undo-push-mark
1155 (setq cua--undo-push-mark nil
1156 inhibit-mark-movement nil))
1157 (when cua--global-mark-active 1142 (when cua--global-mark-active
1158 (cua--global-mark-post-command)) 1143 (cua--global-mark-post-command))
1159 (when (fboundp 'cua--rectangle-post-command) 1144 (when (fboundp 'cua--rectangle-post-command)
1160 (cua--rectangle-post-command)) 1145 (cua--rectangle-post-command))
1161 (setq cua--buffer-and-point-before-command nil) 1146 (setq cua--buffer-and-point-before-command nil)