[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: weird region behavior
From: |
Richard Stallman |
Subject: |
Re: weird region behavior |
Date: |
Wed, 16 Jun 2004 12:58:22 -0400 |
> When I select a region with my mouse, it becomes yellow (as expected)
> and the content is saved in the kill-ring (again, as expected).
> If I now move the cursor with an arrow key, the yellow region does not
> disappear (as it did before) but is instead extended as I move the
> point (luckily, the content is not copied into the kill-ring), and some
> commands appear to be limited to the yellow region.
I think this result was not intended. Do these changes fix it?
*** mouse.el 29 May 2004 05:36:28 -0400 1.247
--- mouse.el 15 Jun 2004 22:47:00 -0400
***************
*** 625,631 ****
(defun mouse-set-region-1 ()
;; Set transient-mark-mode for a little while.
! (setq transient-mark-mode (or transient-mark-mode 'lambda))
(setq mouse-last-region-beg (region-beginning))
(setq mouse-last-region-end (region-end))
(setq mouse-last-region-tick (buffer-modified-tick)))
--- 625,631 ----
(defun mouse-set-region-1 ()
;; Set transient-mark-mode for a little while.
! (setq transient-mark-mode (or transient-mark-mode 'only))
(setq mouse-last-region-beg (region-beginning))
(setq mouse-last-region-end (region-end))
(setq mouse-last-region-tick (buffer-modified-tick)))
*** keyboard.c 13 Jun 2004 18:40:52 -0400 1.780
--- keyboard.c 15 Jun 2004 22:47:52 -0400
***************
*** 681,686 ****
--- 681,688 ----
to support it. */
static int cannot_suspend;
+ extern Lisp_Object Qidentity, Qonly;
+
/* Install the string STR as the beginning of the string of echoing,
so that it serves as a prompt for the next character.
Also start echoing. */
***************
*** 1820,1825 ****
--- 1822,1837 ----
}
else if (current_buffer != prev_buffer || MODIFF != prev_modiff)
call1 (Vrun_hooks, intern ("activate-mark-hook"));
+ }
+
+ /* Setting transient-mark-mode to `only' is a way of
+ turning it on for just one command. */
+ if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks))
+ {
+ if (EQ (Vtransient_mark_mode, Qidentity))
+ Vtransient_mark_mode = Qnil;
+ if (EQ (Vtransient_mark_mode, Qonly))
+ Vtransient_mark_mode = Qidentity;
}
finalize: