(cua--pre-command-handler-1):
Use input-decode-map instead of function-key-map. Use event-modifiers now that it works reliably.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2007-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* emulation/cua-base.el (cua--pre-command-handler-1):
|
||||
Use input-decode-map instead of function-key-map.
|
||||
Use event-modifiers now that it works reliably.
|
||||
|
||||
* vc.el (vc-diff-internal): Pop-to-buffer later.
|
||||
|
||||
* subr.el (event-modifiers): Use internal-event-symbol-parse-modifiers.
|
||||
|
||||
@@ -1225,22 +1225,26 @@ If ARG is the atom `-', scroll upward by nearly full screen."
|
||||
|
||||
;; Handle shifted cursor keys and other movement commands.
|
||||
;; If region is not active, region is activated if key is shifted.
|
||||
;; If region is active, region is cancelled if key is unshifted (and region not started with C-SPC).
|
||||
;; If rectangle is active, expand rectangle in specified direction and ignore the movement.
|
||||
;; If region is active, region is cancelled if key is unshifted
|
||||
;; (and region not started with C-SPC).
|
||||
;; If rectangle is active, expand rectangle in specified direction and
|
||||
;; ignore the movement.
|
||||
((if window-system
|
||||
;; Shortcut for window-system, assuming that input-decode-map is empty.
|
||||
(memq 'shift (event-modifiers
|
||||
(aref (this-single-command-raw-keys) 0)))
|
||||
(or
|
||||
;; Check if the final key-sequence was shifted.
|
||||
(memq 'shift (event-modifiers
|
||||
(aref (this-single-command-keys) 0)))
|
||||
;; See if raw escape sequence maps to a shifted event, e.g. S-up or C-S-home.
|
||||
(and (boundp 'local-function-key-map)
|
||||
local-function-key-map
|
||||
(let ((ev (lookup-key local-function-key-map
|
||||
(this-single-command-raw-keys))))
|
||||
(and (vector ev)
|
||||
(symbolp (setq ev (aref ev 0)))
|
||||
(string-match "S-" (symbol-name ev)))))))
|
||||
;; If not, maybe the raw key-sequence was mapped by input-decode-map
|
||||
;; to a shifted key (and then mapped down to its unshifted form).
|
||||
(let* ((keys (this-single-command-raw-keys))
|
||||
(ev (lookup-key input-decode-map keys)))
|
||||
(or (and (vector ev) (memq 'shift (event-modifiers (aref ev 0))))
|
||||
;; Or maybe, the raw key-sequence was not an escape sequence
|
||||
;; and was shifted (and then mapped down to its unshifted form).
|
||||
(memq 'shift (event-modifiers (aref keys 0)))))))
|
||||
(unless mark-active
|
||||
(push-mark-command nil t))
|
||||
(setq cua--last-region-shifted t)
|
||||
|
||||
Reference in New Issue
Block a user