emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emulation/cua-base.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/emulation/cua-base.el,v
Date: Thu, 15 Nov 2007 16:36:05 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/11/15 16:36:04

Index: emulation/cua-base.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emulation/cua-base.el,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- emulation/cua-base.el       6 Oct 2007 22:19:49 -0000       1.84
+++ emulation/cua-base.el       15 Nov 2007 16:36:03 -0000      1.85
@@ -1225,22 +1225,26 @@
 
    ;; 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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]