Commit 06ee88e4 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/emulation/cua-base.el (cua--select-keymaps): Use region-active-p.

(cua-set-mark, cua--pre-command-handler-1,cua--post-command-handler-1):
* lisp/emulation/cua-gmrk.el (cua-cancel-global-mark): Same.

Fixes: debbugs:18952
parent 2a1f6afd
2014-11-07 Stefan Monnier <monnier@iro.umontreal.ca>
* emulation/cua-base.el (cua--select-keymaps): Use region-active-p
(bug#18952).
(cua-set-mark, cua--pre-command-handler-1,cua--post-command-handler-1):
* emulation/cua-gmrk.el (cua-cancel-global-mark): Same.
2014-11-07 Michael Albinus <michael.albinus@gmx.de> 2014-11-07 Michael Albinus <michael.albinus@gmx.de>
   
* files.el (file-name-non-special): Wrap the call of * files.el (file-name-non-special): Wrap the call of
......
...@@ -1015,7 +1015,7 @@ With a double \\[universal-argument] prefix argument, unconditionally set mark." ...@@ -1015,7 +1015,7 @@ With a double \\[universal-argument] prefix argument, unconditionally set mark."
(or (and cua-auto-mark-last-change (or (and cua-auto-mark-last-change
(cua-pop-to-last-change)) (cua-pop-to-last-change))
(pop-to-mark-command))) (pop-to-mark-command)))
((and cua-toggle-set-mark mark-active) ((and cua-toggle-set-mark (region-active-p))
(cua--deactivate) (cua--deactivate)
(message "Mark cleared")) (message "Mark cleared"))
(t (t
...@@ -1114,7 +1114,7 @@ If ARG is the atom `-', scroll upward by nearly full screen." ...@@ -1114,7 +1114,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
;; Set mark if user explicitly said to do so ;; Set mark if user explicitly said to do so
(cua--rectangle ;FIXME: ?? (cua--rectangle ;FIXME: ??
(unless mark-active (unless (region-active-p)
(push-mark-command nil nil)))) (push-mark-command nil nil))))
;; Detect extension of rectangles by mouse or other movement ;; Detect extension of rectangles by mouse or other movement
...@@ -1140,7 +1140,7 @@ If ARG is the atom `-', scroll upward by nearly full screen." ...@@ -1140,7 +1140,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(if cua--debug (if cua--debug
(cond (cond
(cua--rectangle (cua--rectangle-assert)) (cua--rectangle (cua--rectangle-assert))
(mark-active (message "Mark=%d Point=%d" (mark t) (point))))) ((region-active-p) (message "Mark=%d Point=%d" (mark t) (point)))))
(if cua-enable-cursor-indications (if cua-enable-cursor-indications
(cua--update-indications)) (cua--update-indications))
...@@ -1199,7 +1199,7 @@ If ARG is the atom `-', scroll upward by nearly full screen." ...@@ -1199,7 +1199,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(defun cua--select-keymaps () (defun cua--select-keymaps ()
;; Setup conditions for selecting the proper keymaps in cua--keymap-alist. ;; Setup conditions for selecting the proper keymaps in cua--keymap-alist.
(setq cua--ena-region-keymap (setq cua--ena-region-keymap
(and mark-active (not deactivate-mark))) (and (region-active-p) (not deactivate-mark)))
(setq cua--ena-prefix-override-keymap (setq cua--ena-prefix-override-keymap
(and cua--ena-region-keymap (and cua--ena-region-keymap
cua-enable-cua-keys cua-enable-cua-keys
......
...@@ -321,7 +321,7 @@ With prefix argument, don't jump to global mark when canceling it." ...@@ -321,7 +321,7 @@ With prefix argument, don't jump to global mark when canceling it."
(defun cua-cancel-global-mark () (defun cua-cancel-global-mark ()
"Cancel the global mark." "Cancel the global mark."
(interactive) (interactive)
(if mark-active (if (region-active-p)
(cua-cancel) (cua-cancel)
(if (cua--global-mark-active) (if (cua--global-mark-active)
(cua--deactivate-global-mark t))) (cua--deactivate-global-mark 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