aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-11-15 16:36:03 +0000
committerStefan Monnier2007-11-15 16:36:03 +0000
commitf2c232a244ce2633c532f3b045fb0b200c3a506d (patch)
treef5c8d0c86e124423ebaac9f8cc52569992bcd48e
parent4befebc175da7d623ed2cde234b548c6188bc950 (diff)
downloademacs-f2c232a244ce2633c532f3b045fb0b200c3a506d.tar.gz
emacs-f2c232a244ce2633c532f3b045fb0b200c3a506d.zip
(cua--pre-command-handler-1):
Use input-decode-map instead of function-key-map. Use event-modifiers now that it works reliably.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/emulation/cua-base.el24
2 files changed, 18 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a88e4fecca1..82c3b38191b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12007-11-15 Stefan Monnier <monnier@iro.umontreal.ca> 12007-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * emulation/cua-base.el (cua--pre-command-handler-1):
4 Use input-decode-map instead of function-key-map.
5 Use event-modifiers now that it works reliably.
6
3 * vc.el (vc-diff-internal): Pop-to-buffer later. 7 * vc.el (vc-diff-internal): Pop-to-buffer later.
4 8
5 * subr.el (event-modifiers): Use internal-event-symbol-parse-modifiers. 9 * subr.el (event-modifiers): Use internal-event-symbol-parse-modifiers.
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index fbb39ee66d3..c720a78d650 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -1225,22 +1225,26 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1225 1225
1226 ;; Handle shifted cursor keys and other movement commands. 1226 ;; Handle shifted cursor keys and other movement commands.
1227 ;; If region is not active, region is activated if key is shifted. 1227 ;; If region is not active, region is activated if key is shifted.
1228 ;; If region is active, region is cancelled if key is unshifted (and region not started with C-SPC). 1228 ;; If region is active, region is cancelled if key is unshifted
1229 ;; If rectangle is active, expand rectangle in specified direction and ignore the movement. 1229 ;; (and region not started with C-SPC).
1230 ;; If rectangle is active, expand rectangle in specified direction and
1231 ;; ignore the movement.
1230 ((if window-system 1232 ((if window-system
1233 ;; Shortcut for window-system, assuming that input-decode-map is empty.
1231 (memq 'shift (event-modifiers 1234 (memq 'shift (event-modifiers
1232 (aref (this-single-command-raw-keys) 0))) 1235 (aref (this-single-command-raw-keys) 0)))
1233 (or 1236 (or
1237 ;; Check if the final key-sequence was shifted.
1234 (memq 'shift (event-modifiers 1238 (memq 'shift (event-modifiers
1235 (aref (this-single-command-keys) 0))) 1239 (aref (this-single-command-keys) 0)))
1236 ;; See if raw escape sequence maps to a shifted event, e.g. S-up or C-S-home. 1240 ;; If not, maybe the raw key-sequence was mapped by input-decode-map
1237 (and (boundp 'local-function-key-map) 1241 ;; to a shifted key (and then mapped down to its unshifted form).
1238 local-function-key-map 1242 (let* ((keys (this-single-command-raw-keys))
1239 (let ((ev (lookup-key local-function-key-map 1243 (ev (lookup-key input-decode-map keys)))
1240 (this-single-command-raw-keys)))) 1244 (or (and (vector ev) (memq 'shift (event-modifiers (aref ev 0))))
1241 (and (vector ev) 1245 ;; Or maybe, the raw key-sequence was not an escape sequence
1242 (symbolp (setq ev (aref ev 0))) 1246 ;; and was shifted (and then mapped down to its unshifted form).
1243 (string-match "S-" (symbol-name ev))))))) 1247 (memq 'shift (event-modifiers (aref keys 0)))))))
1244 (unless mark-active 1248 (unless mark-active
1245 (push-mark-command nil t)) 1249 (push-mark-command nil t))
1246 (setq cua--last-region-shifted t) 1250 (setq cua--last-region-shifted t)