unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* weird region behavior
@ 2004-06-14 19:47 Sam Steingold
  2004-06-14 20:04 ` David Kastrup
  0 siblings, 1 reply; 5+ messages in thread
From: Sam Steingold @ 2004-06-14 19:47 UTC (permalink / raw)


GNU Emacs 21.3.50.1 (i386-msvc-nt5.0.2195)
 of 2004-06-14 on WINSTEINGOLDLAP
--with-msvc (12.00)

The region behavior has recently changed (I seem to recall this being
discussed before):

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 is called "Transient Mark mode", but I did not touch
`transient-mark-mode', so I should not be getting it, right?

C-g appears to remove each instance of this "active region" (?), but I
would rather avoid having to hit C-g after each selection operation.

So, how do I restore the original behavior?

Thanks!

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
A poet who reads his verse in public may have other nasty habits.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: weird region behavior
  2004-06-14 19:47 weird region behavior Sam Steingold
@ 2004-06-14 20:04 ` David Kastrup
  2004-06-15 14:50   ` Sam Steingold
  2004-06-16 16:58   ` Richard Stallman
  0 siblings, 2 replies; 5+ messages in thread
From: David Kastrup @ 2004-06-14 20:04 UTC (permalink / raw)


Sam Steingold <sds@gnu.org> writes:

> GNU Emacs 21.3.50.1 (i386-msvc-nt5.0.2195)
>  of 2004-06-14 on WINSTEINGOLDLAP
> --with-msvc (12.00)
> 
> The region behavior has recently changed (I seem to recall this being
> discussed before):
> 
> 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 is called "Transient Mark mode", but I did not touch
> `transient-mark-mode', so I should not be getting it, right?
> 
> C-g appears to remove each instance of this "active region" (?), but I
> would rather avoid having to hit C-g after each selection operation.

Maybe we need a "more" transient mark mode for mouse-marked regions
that disappears at cursor movements.  I have to admit that this
behavior was a bit surprising to me as well, but I have not yet
decided whether I find it disturbing.

> So, how do I restore the original behavior?

It was just some one-liner in mouse.el IIRC, where
transient-mark-mode is set to lambda.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: weird region behavior
  2004-06-14 20:04 ` David Kastrup
@ 2004-06-15 14:50   ` Sam Steingold
  2004-06-16 16:58   ` Richard Stallman
  1 sibling, 0 replies; 5+ messages in thread
From: Sam Steingold @ 2004-06-15 14:50 UTC (permalink / raw)


> * David Kastrup <qnx@tah.bet> [2004-06-14 22:04:22 +0200]:
>
> Maybe we need a "more" transient mark mode for mouse-marked regions
> that disappears at cursor movements.

no, not just cursor movements.
any non-region-operation keyboard input.

> I have to admit that this behavior was a bit surprising to me as well,
> but I have not yet decided whether I find it disturbing.

I do.

>> So, how do I restore the original behavior?
>
> It was just some one-liner in mouse.el IIRC, where
> transient-mark-mode is set to lambda.

yes, I commented out the offending line and it works fine now!
Thanks!

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Computers are like air conditioners: they don't work with open windows!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: weird region behavior
  2004-06-14 20:04 ` David Kastrup
  2004-06-15 14:50   ` Sam Steingold
@ 2004-06-16 16:58   ` Richard Stallman
  2004-06-16 22:13     ` Sam Steingold
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2004-06-16 16:58 UTC (permalink / raw)
  Cc: emacs-devel

    > 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;
+ \f
  /* 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:

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: weird region behavior
  2004-06-16 16:58   ` Richard Stallman
@ 2004-06-16 22:13     ` Sam Steingold
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Steingold @ 2004-06-16 22:13 UTC (permalink / raw)


> * Richard Stallman <ezf@tah.bet> [2004-06-16 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?

yes, this patch restores the original behavior.

I suspect that you wanted the first command after selection to operate
on the region, right?  this does not happen (at least search is not
limited to the region).

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Do not worry about which side your bread is buttered on: you eat BOTH sides.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-06-16 22:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-14 19:47 weird region behavior Sam Steingold
2004-06-14 20:04 ` David Kastrup
2004-06-15 14:50   ` Sam Steingold
2004-06-16 16:58   ` Richard Stallman
2004-06-16 22:13     ` Sam Steingold

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).