aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2002-05-27 12:14:52 +0000
committerKim F. Storm2002-05-27 12:14:52 +0000
commitfc803e8d1abddbc32fd1e5112649327c8f3075fd (patch)
tree9b0154d1e17970021e1eb62b0579c7703ade1581
parentd00ffe213e842d85380d1ba2e6d9e96d11bdc104 (diff)
downloademacs-fc803e8d1abddbc32fd1e5112649327c8f3075fd.tar.gz
emacs-fc803e8d1abddbc32fd1e5112649327c8f3075fd.zip
(cua-set-mark): Align pop to marko
behaviour with standard set-mark-command. (cua--pre-command-handler): Use push-mark-command. (cua-repeat-replace-region): Improve functionality when repeated after moving point or changing buffer.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/emulation/cua-base.el31
2 files changed, 27 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bed3498fe02..caa07a60c9d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12002-05-27 Kim F. Storm <storm@cua.dk>
2
3 * simple.el (push-mark-command): Added optional NOMSG arg.
4
5 * emulation/cua-base.el (cua-set-mark): Align pop to mark
6 behaviour with standard set-mark-command.
7 (cua--pre-command-handler): Use push-mark-command.
8 (cua-repeat-replace-region): Improve functionality when
9 repeated after moving point or changing buffer.
10
12002-05-26 Colin Walters <walters@verbum.org> 112002-05-26 Colin Walters <walters@verbum.org>
2 12
3 * startup.el (command-line): Use `when', `unless'. 13 * startup.el (command-line): Use `when', `unless'.
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index b8de83fd3db..a90ed837012 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -814,10 +814,14 @@ Activates the mark if a prefix argument is given."
814 "Repeat replacing text of highlighted region with typed text. 814 "Repeat replacing text of highlighted region with typed text.
815Searches for the next streach of text identical to the region last 815Searches for the next streach of text identical to the region last
816replaced by typing text over it and replaces it with the same streach 816replaced by typing text over it and replaces it with the same streach
817of text. Note: Works reliable only when repeated immediately after 817of text.
818typing the last character." 818Note: Works only when used immediately after typing the last character.
819After that, it can be repeated (fairly) reliable until a buffer is
820modified in any other way than repeating this command."
819 (interactive "P") 821 (interactive "P")
820 (unless (eq this-command last-command) 822 (unless (or (eq this-command last-command)
823 (not cua--repeat-replace-text)
824 (not (eq last-command 'self-insert-command)))
821 (setq cua--repeat-replace-text 825 (setq cua--repeat-replace-text
822 (and (mark t) 826 (and (mark t)
823 (/= (point) (mark t)) 827 (/= (point) (mark t))
@@ -846,21 +850,20 @@ With argument, jump to mark, and pop a new position for mark off the ring;
846then it jumps to the next mark off the ring if repeated with no argument, or 850then it jumps to the next mark off the ring if repeated with no argument, or
847sets the mark at the new position if repeated with argument." 851sets the mark at the new position if repeated with argument."
848 (interactive "P") 852 (interactive "P")
849 (if (and (eq this-command last-command)
850 last-prefix-arg)
851 (setq arg (if arg nil last-prefix-arg)
852 current-prefix-arg arg))
853 (cond 853 (cond
854 ((eq last-command 'pop-to-mark-command)
855 (if (and (consp arg) (> (prefix-numeric-value arg) 4))
856 (push-mark-command nil)
857 (setq this-command 'pop-to-mark-command)
858 (pop-to-mark-command)))
854 (arg 859 (arg
855 (if (null (mark t)) 860 (setq this-command 'pop-to-mark-command)
856 (error "No mark set in this buffer") 861 (pop-to-mark-command))
857 (goto-char (mark t))
858 (pop-mark)))
859 (mark-active 862 (mark-active
860 (cua--deactivate) 863 (cua--deactivate)
861 (message "Mark Cleared")) 864 (message "Mark Cleared"))
862 (t 865 (t
863 (push-mark nil nil t) 866 (push-mark-command nil nil)
864 (setq cua--explicit-region-start t) 867 (setq cua--explicit-region-start t)
865 (setq cua--last-region-shifted nil) 868 (setq cua--last-region-shifted nil)
866 (if cua-enable-region-auto-help 869 (if cua-enable-region-auto-help
@@ -923,12 +926,12 @@ Extra commands should be added to `cua-user-movement-commands'")
923 (cond 926 (cond
924 ((memq 'shift (event-modifiers (aref (this-single-command-raw-keys) 0))) 927 ((memq 'shift (event-modifiers (aref (this-single-command-raw-keys) 0)))
925 (unless mark-active 928 (unless mark-active
926 (push-mark nil t t)) 929 (push-mark-command nil t))
927 (setq cua--last-region-shifted t) 930 (setq cua--last-region-shifted t)
928 (setq cua--explicit-region-start nil)) 931 (setq cua--explicit-region-start nil))
929 ((or cua--explicit-region-start cua--rectangle) 932 ((or cua--explicit-region-start cua--rectangle)
930 (unless mark-active 933 (unless mark-active
931 (push-mark nil nil t))) 934 (push-mark-command nil nil)))
932 (t 935 (t
933 ;; If we set mark-active to nil here, the region highlight will not be 936 ;; If we set mark-active to nil here, the region highlight will not be
934 ;; removed by the direct_output_ commands. 937 ;; removed by the direct_output_ commands.