unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term
@ 2009-02-23 17:01 Matthieu Moy
  0 siblings, 0 replies; 9+ messages in thread
From: Matthieu Moy @ 2009-02-23 17:01 UTC (permalink / raw)
  To: emacs-pretest-bug

Hi,

When one disables transient-mark-mode in an ansi-term (term.el), and
then select a piece of text with the mouse, then the behavior is the
one of transient-mark-mode although it has been disabled.

Steps to reproduce (in emacs -Q for example):

M-x transient-mark-mode RET (to disable it)
M-x ansi-term RET RET
ls (at the shell prompt)
select text in the *ansi-term* buffer with the mouse.
ls

Expected behavior: the selection disapears.

Obtained behavior: the selection follows the cursor, at the prompt.

Emacs22 had this right, this is a regression.

Thanks,




In GNU Emacs 23.0.90.1 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2009-02-23 on bauges
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--prefix=/home/moy/local/usr/''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
M-x t e r m <tab> <return> <return> l s <return> M-x 
C-g C-c M-x t r a n <tab> i <tab> <return> l s <return> 
<down-mouse-1> <mouse-movement> <mouse-movement> <drag-mouse-1> 
l s <return> C-g C-g C-g C-c C-g C-x C-g C-g <return> 
<up> <down> <return> <down-mouse-1> <mouse-1> l s <return> 
l s <return> <down-mouse-1> <mouse-movement> <mouse-movement> 
<drag-mouse-1> C-c C-j M-> l s <return> C-c C-k l s 
<return> <down-mouse-1> <mouse-movement> <mouse-movement> 
<drag-mouse-1> l s <return> C-x b C-c C-b C-x o <help-echo> 
<help-echo> <help-echo> <down-mouse-1> <mouse-2> <help-echo> 
<down-mouse-1> <mouse-movement> <mouse-movement> <drag-mouse-1> 
M-> l s <return> M-x r e p o r t <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Transient-Mark mode disabled
Mark set [2 times]






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

* bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term
@ 2009-03-06  7:00 Xavier Maillard
  0 siblings, 0 replies; 9+ messages in thread
From: Xavier Maillard @ 2009-03-06  7:00 UTC (permalink / raw)
  To: Matthieu Moy, 2449; +Cc: emacs-pretest-bug

Hi,

I could reproduce it here too (accidentaly) and it was confirmed
with emacs -Q.

Regards

	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org






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

* bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term
@ 2009-03-07  4:18 Chong Yidong
  2009-03-07  4:24 ` Dan Nicolaescu
  0 siblings, 1 reply; 9+ messages in thread
From: Chong Yidong @ 2009-03-07  4:18 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 2449, Matthieu Moy

> M-x transient-mark-mode RET (to disable it)
> M-x ansi-term RET RET
> ls (at the shell prompt)
> select text in the *ansi-term* buffer with the mouse.
> ls
>
> Expected behavior: the selection disapears.
>
> Obtained behavior: the selection follows the cursor, at the prompt.

I think term-send-raw should deactivate the mark.  Dan, what do you
think?

*** trunk/lisp/term.el.~1.112.~	2009-02-19 20:32:53.000000000 -0500
--- trunk/lisp/term.el	2009-03-06 23:14:00.000000000 -0500
***************
*** 1182,1187 ****
--- 1182,1188 ----
    "Send the last character typed through the terminal-emulator
  without any interpretation."
    (interactive)
+   (deactivate-mark)
   ;; Convert `return' to C-m, etc.
    (when (and (symbolp last-input-event)
  	     (get last-input-event 'ascii-character))

Diff finished.  Fri Mar  6 23:14:01 2009






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

* bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term
  2009-03-07  4:18 bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term Chong Yidong
@ 2009-03-07  4:24 ` Dan Nicolaescu
  2009-03-08 16:03   ` Chong Yidong
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Nicolaescu @ 2009-03-07  4:24 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 2449, Matthieu Moy

Chong Yidong <cyd@stupidchicken.com> writes:

  > > M-x transient-mark-mode RET (to disable it)
  > > M-x ansi-term RET RET
  > > ls (at the shell prompt)
  > > select text in the *ansi-term* buffer with the mouse.
  > > ls
  > >
  > > Expected behavior: the selection disapears.
  > >
  > > Obtained behavior: the selection follows the cursor, at the prompt.
  > 
  > I think term-send-raw should deactivate the mark.  Dan, what do you
  > think?


deactivate-mark seems to do nothing when transient-mark-mode is not
active (which is the point of this bug report).






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

* bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term
  2009-03-07  4:24 ` Dan Nicolaescu
@ 2009-03-08 16:03   ` Chong Yidong
  2009-03-08 17:29     ` Matthieu Moy
  2009-03-08 18:36     ` Dan Nicolaescu
  0 siblings, 2 replies; 9+ messages in thread
From: Chong Yidong @ 2009-03-08 16:03 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 2449, Matthieu Moy

Dan Nicolaescu <dann@ics.uci.edu> writes:

> deactivate-mark seems to do nothing when transient-mark-mode is not
> active (which is the point of this bug report).

The mark can be activated by dragging the mouse.  If transient-mark-mode
is active, it's normally deactivated automatically in the command loop.
However, ansi-term does not use self-insert-command, so this
deactivation is not performed.  So the right thing to do, I think, is to
deactivate it manually in term-send-raw.






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

* bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term
  2009-03-08 16:03   ` Chong Yidong
@ 2009-03-08 17:29     ` Matthieu Moy
  2009-03-08 18:36     ` Dan Nicolaescu
  1 sibling, 0 replies; 9+ messages in thread
From: Matthieu Moy @ 2009-03-08 17:29 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Dan Nicolaescu, 2449

Chong Yidong <cyd@stupidchicken.com> writes:

> Dan Nicolaescu <dann@ics.uci.edu> writes:
>
>> deactivate-mark seems to do nothing when transient-mark-mode is not
>> active (which is the point of this bug report).
>
> The mark can be activated by dragging the mouse.  If transient-mark-mode
> is active, it's normally deactivated automatically in the command loop.
> However, ansi-term does not use self-insert-command, so this
> deactivation is not performed.  So the right thing to do, I think, is to
> deactivate it manually in term-send-raw.

Confirmed: the fix works for me.

-- 
Matthieu






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

* bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term
  2009-03-08 16:03   ` Chong Yidong
  2009-03-08 17:29     ` Matthieu Moy
@ 2009-03-08 18:36     ` Dan Nicolaescu
  2009-03-08 18:53       ` Chong Yidong
  1 sibling, 1 reply; 9+ messages in thread
From: Dan Nicolaescu @ 2009-03-08 18:36 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 2449, Matthieu Moy

Chong Yidong <cyd@stupidchicken.com> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > deactivate-mark seems to do nothing when transient-mark-mode is not
  > > active (which is the point of this bug report).
  > 
  > The mark can be activated by dragging the mouse.  If transient-mark-mode
  > is active, it's normally deactivated automatically in the command loop.

I think we are miscommunicating here.  The problem in this case happens
when transient-mark-mode is NOT active.

Before installing a fix, I'd like to understand why a fix is needed.
AFAIR nothing has changed in this respect in term.el from emacs-22.
In emacs-22 transient-mark-mode was off by default, and the problem in
this report did not happen.

Has something changed in the way the transient mark is handled even when
transient-mark-mode is inactive?

  > However, ansi-term does not use self-insert-command, so this
  > deactivation is not performed.  So the right thing to do, I think, is to
  > deactivate it manually in term-send-raw.






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

* bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term
  2009-03-08 18:36     ` Dan Nicolaescu
@ 2009-03-08 18:53       ` Chong Yidong
  2009-03-08 19:14         ` Dan Nicolaescu
  0 siblings, 1 reply; 9+ messages in thread
From: Chong Yidong @ 2009-03-08 18:53 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 2449, Matthieu Moy

Dan Nicolaescu <dann@ics.uci.edu> writes:

> I think we are miscommunicating here.  The problem in this case happens
> when transient-mark-mode is NOT active.
>
> Has something changed in the way the transient mark is handled even when
> transient-mark-mode is inactive?

That's what I'm trying to explain.  Mouse selection now uses the
(only. OLDVAL) mechanism implemented part of the shift-selection changes
installed many months ago:

  *** If a command sets `transient-mark-mode' to (only . OLDVAL), that
  means to activate transient-mark-mode temporarily, until the next
  unshifted point motion command or mark deactivation.  Afterwards,
  reset transient-mark-mode to the value OLDVAL.  The values `only' and
  `identity', introduced in Emacs 22, are now deprecated.

Mouse-selection is now a little "stickier", and this behavior is good in
most cases.  But the way ansi-term is set up, the mark never gets
deactivated.  That's why this bug occurs.






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

* bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term
  2009-03-08 18:53       ` Chong Yidong
@ 2009-03-08 19:14         ` Dan Nicolaescu
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Nicolaescu @ 2009-03-08 19:14 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 2449, Matthieu Moy

Chong Yidong <cyd@stupidchicken.com> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > I think we are miscommunicating here.  The problem in this case happens
  > > when transient-mark-mode is NOT active.
  > >
  > > Has something changed in the way the transient mark is handled even when
  > > transient-mark-mode is inactive?
  > 
  > That's what I'm trying to explain.  Mouse selection now uses the
  > (only. OLDVAL) mechanism implemented part of the shift-selection changes
  > installed many months ago:
  > 
  >   *** If a command sets `transient-mark-mode' to (only . OLDVAL), that
  >   means to activate transient-mark-mode temporarily, until the next
  >   unshifted point motion command or mark deactivation.  Afterwards,
  >   reset transient-mark-mode to the value OLDVAL.  The values `only' and
  >   `identity', introduced in Emacs 22, are now deprecated.
  > 
  > Mouse-selection is now a little "stickier", and this behavior is good in
  > most cases.  But the way ansi-term is set up, the mark never gets
  > deactivated.  That's why this bug occurs.

Thanks, please install your change.






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

end of thread, other threads:[~2009-03-08 19:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-07  4:18 bug#2449: 23.0.90; Disabling transient-mark-mode doesn't work well in ansi-term Chong Yidong
2009-03-07  4:24 ` Dan Nicolaescu
2009-03-08 16:03   ` Chong Yidong
2009-03-08 17:29     ` Matthieu Moy
2009-03-08 18:36     ` Dan Nicolaescu
2009-03-08 18:53       ` Chong Yidong
2009-03-08 19:14         ` Dan Nicolaescu
  -- strict thread matches above, loose matches on Subject: below --
2009-03-06  7:00 Xavier Maillard
2009-02-23 17:01 Matthieu Moy

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).