Commit f2c232a2 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(cua--pre-command-handler-1):

Use input-decode-map instead of function-key-map.
Use event-modifiers now that it works reliably.
parent 4befebc1
2007-11-15 Stefan Monnier <monnier@iro.umontreal.ca> 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. * vc.el (vc-diff-internal): Pop-to-buffer later.
* subr.el (event-modifiers): Use internal-event-symbol-parse-modifiers. * 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." ...@@ -1225,22 +1225,26 @@ If ARG is the atom `-', scroll upward by nearly full screen."
;; Handle shifted cursor keys and other movement commands. ;; Handle shifted cursor keys and other movement commands.
;; If region is not active, region is activated if key is shifted. ;; 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 region is active, region is cancelled if key is unshifted
;; If rectangle is active, expand rectangle in specified direction and ignore the movement. ;; (and region not started with C-SPC).
;; If rectangle is active, expand rectangle in specified direction and
;; ignore the movement.
((if window-system ((if window-system
;; Shortcut for window-system, assuming that input-decode-map is empty.
(memq 'shift (event-modifiers (memq 'shift (event-modifiers
(aref (this-single-command-raw-keys) 0))) (aref (this-single-command-raw-keys) 0)))
(or (or
;; Check if the final key-sequence was shifted.
(memq 'shift (event-modifiers (memq 'shift (event-modifiers
(aref (this-single-command-keys) 0))) (aref (this-single-command-keys) 0)))
;; See if raw escape sequence maps to a shifted event, e.g. S-up or C-S-home. ;; If not, maybe the raw key-sequence was mapped by input-decode-map
(and (boundp 'local-function-key-map) ;; to a shifted key (and then mapped down to its unshifted form).
local-function-key-map (let* ((keys (this-single-command-raw-keys))
(let ((ev (lookup-key local-function-key-map (ev (lookup-key input-decode-map keys)))
(this-single-command-raw-keys)))) (or (and (vector ev) (memq 'shift (event-modifiers (aref ev 0))))
(and (vector ev) ;; Or maybe, the raw key-sequence was not an escape sequence
(symbolp (setq ev (aref ev 0))) ;; and was shifted (and then mapped down to its unshifted form).
(string-match "S-" (symbol-name ev))))))) (memq 'shift (event-modifiers (aref keys 0)))))))
(unless mark-active (unless mark-active
(push-mark-command nil t)) (push-mark-command nil t))
(setq cua--last-region-shifted t) (setq cua--last-region-shifted t)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment