unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30937: In `comment-region', C-g doesn't work.
@ 2018-03-25 14:28 Alan Mackenzie
  2018-03-25 15:32 ` Eli Zaretskii
  2018-03-25 16:07 ` Andreas Schwab
  0 siblings, 2 replies; 17+ messages in thread
From: Alan Mackenzie @ 2018-03-25 14:28 UTC (permalink / raw)
  To: 30937

Hello, Emacs.

emacs-26.0.91 -Q
C-x C-f Any largish file.c
C-x h                 ; mark buffer.
C-c C-c               ; comment-region.

This is the sort of thing that can happen by accident.  Depending on the
size of the file.c and the speed of your machine, you've now got a long,
long wait.  C-g doesn't work.  This is a bug.

(The same applies to `uncomment-region'.)

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 14:28 bug#30937: In `comment-region', C-g doesn't work Alan Mackenzie
@ 2018-03-25 15:32 ` Eli Zaretskii
  2018-03-25 15:39   ` Alan Mackenzie
  2018-03-25 16:07 ` Andreas Schwab
  1 sibling, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2018-03-25 15:32 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 30937

> Date: Sun, 25 Mar 2018 14:28:55 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> emacs-26.0.91 -Q
> C-x C-f Any largish file.c
> C-x h                 ; mark buffer.
> C-c C-c               ; comment-region.
> 
> This is the sort of thing that can happen by accident.  Depending on the
> size of the file.c and the speed of your machine, you've now got a long,
> long wait.  C-g doesn't work.  This is a bug.

C-g does work for me just fine in the above recipe.  Maybe it's
platform dependent, and the problem happens only on X?





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 15:32 ` Eli Zaretskii
@ 2018-03-25 15:39   ` Alan Mackenzie
  2018-03-25 16:48     ` Eli Zaretskii
  2018-03-31 14:21     ` Noam Postavsky
  0 siblings, 2 replies; 17+ messages in thread
From: Alan Mackenzie @ 2018-03-25 15:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 30937

Hello, Eli.

On Sun, Mar 25, 2018 at 18:32:10 +0300, Eli Zaretskii wrote:
> > Date: Sun, 25 Mar 2018 14:28:55 +0000
> > From: Alan Mackenzie <acm@muc.de>

> > emacs-26.0.91 -Q
> > C-x C-f Any largish file.c
> > C-x h                 ; mark buffer.
> > C-c C-c               ; comment-region.

> > This is the sort of thing that can happen by accident.  Depending on the
> > size of the file.c and the speed of your machine, you've now got a long,
> > long wait.  C-g doesn't work.  This is a bug.

> C-g does work for me just fine in the above recipe.  Maybe it's
> platform dependent, and the problem happens only on X?

Yes, I've just tried it on X.  It works there (except it leaves point in
a suboptimal position: the starting point.  It should really leave point
after the last newly commented line when the quit happened).  It works
on emacs -nw, with the same proviso.

It doesn't work at all on a Linux tty.  Sorry I didn't try X before
reporting the bug.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 16:07 ` Andreas Schwab
@ 2018-03-25 16:01   ` Alan Mackenzie
  0 siblings, 0 replies; 17+ messages in thread
From: Alan Mackenzie @ 2018-03-25 16:01 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 30937

Hello, Andreas.

On Sun, Mar 25, 2018 at 18:07:00 +0200, Andreas Schwab wrote:
> On Mär 25 2018, Alan Mackenzie <acm@muc.de> wrote:

> > emacs-26.0.91 -Q
> > C-x C-f Any largish file.c
> > C-x h                 ; mark buffer.
> > C-c C-c               ; comment-region.

> > This is the sort of thing that can happen by accident.  Depending on the
> > size of the file.c and the speed of your machine, you've now got a long,
> > long wait.  C-g doesn't work.  This is a bug.

> Does it help to set select-active-regions to nil or 'only?

Sort of, yes.  But I run with transient-mark-mode disabled, and on a
Linux tty.  What has select-active-regions got to do with my platform?

> Andreas.

> -- 
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 14:28 bug#30937: In `comment-region', C-g doesn't work Alan Mackenzie
  2018-03-25 15:32 ` Eli Zaretskii
@ 2018-03-25 16:07 ` Andreas Schwab
  2018-03-25 16:01   ` Alan Mackenzie
  1 sibling, 1 reply; 17+ messages in thread
From: Andreas Schwab @ 2018-03-25 16:07 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 30937

On Mär 25 2018, Alan Mackenzie <acm@muc.de> wrote:

> emacs-26.0.91 -Q
> C-x C-f Any largish file.c
> C-x h                 ; mark buffer.
> C-c C-c               ; comment-region.
>
> This is the sort of thing that can happen by accident.  Depending on the
> size of the file.c and the speed of your machine, you've now got a long,
> long wait.  C-g doesn't work.  This is a bug.

Does it help to set select-active-regions to nil or 'only?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 15:39   ` Alan Mackenzie
@ 2018-03-25 16:48     ` Eli Zaretskii
  2018-03-25 17:15       ` Alan Mackenzie
  2018-03-25 17:35       ` Ivan Shmakov
  2018-03-31 14:21     ` Noam Postavsky
  1 sibling, 2 replies; 17+ messages in thread
From: Eli Zaretskii @ 2018-03-25 16:48 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 30937

> Date: Sun, 25 Mar 2018 15:39:59 +0000
> Cc: 30937@debbugs.gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> Yes, I've just tried it on X.  It works there (except it leaves point in
> a suboptimal position: the starting point.  It should really leave point
> after the last newly commented line when the quit happened).  It works
> on emacs -nw, with the same proviso.
> 
> It doesn't work at all on a Linux tty.

??? How come it works in "emacs -nw" but not on a "Linux tty" (which
is what, btw? the raw Linux console?).  In both cases, C-g should
trigger a SIGINT, so Emacs should be even more responsive to C-g than
on X.  What am I missing?





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 16:48     ` Eli Zaretskii
@ 2018-03-25 17:15       ` Alan Mackenzie
  2018-03-25 18:08         ` Eli Zaretskii
  2018-03-25 17:35       ` Ivan Shmakov
  1 sibling, 1 reply; 17+ messages in thread
From: Alan Mackenzie @ 2018-03-25 17:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 30937

Hello, Eli.

On Sun, Mar 25, 2018 at 19:48:00 +0300, Eli Zaretskii wrote:
> > Date: Sun, 25 Mar 2018 15:39:59 +0000
> > Cc: 30937@debbugs.gnu.org
> > From: Alan Mackenzie <acm@muc.de>

> > Yes, I've just tried it on X.  It works there (except it leaves point in
> > a suboptimal position: the starting point.  It should really leave point
> > after the last newly commented line when the quit happened).  It works
> > on emacs -nw, with the same proviso.

> > It doesn't work at all on a Linux tty.

> ??? How come it works in "emacs -nw" but not on a "Linux tty" (which
> is what, btw? the raw Linux console?).

Yes, the raw Linux console.  I don't know why it doesn't work, here.

> In both cases, C-g should trigger a SIGINT, so Emacs should be even
> more responsive to C-g than on X.

For what it's worth, quit-flag is getting set on a C-g (I hacked up my
own quit mechanism to test this).  It would appear that nothing is
testing quit-flag during the comment-region.

> What am I missing?

I honestly don't know.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#30937: In `comment-region', C-g doesn't work
  2018-03-25 16:48     ` Eli Zaretskii
  2018-03-25 17:15       ` Alan Mackenzie
@ 2018-03-25 17:35       ` Ivan Shmakov
  2018-03-25 18:11         ` Eli Zaretskii
  1 sibling, 1 reply; 17+ messages in thread
From: Ivan Shmakov @ 2018-03-25 17:35 UTC (permalink / raw)
  To: 30937

>>>>> Eli Zaretskii <eliz@gnu.org> writes:
>>>>> From: Alan Mackenzie <acm@muc.de>

 >> Yes, I've just tried it on X.  It works there (except it leaves
 >> point in a suboptimal position: the starting point.  It should
 >> really leave point after the last newly commented line when the quit
 >> happened).  It works on emacs -nw, with the same proviso.

 >> It doesn't work at all on a Linux tty.

 > ???  How come it works in "emacs -nw" but not on a "Linux tty" (which
 > is what, btw? the raw Linux console?).  In both cases, C-g should
 > trigger a SIGINT, so Emacs should be even more responsive to C-g than
 > on X.  What am I missing?

	I’d think that it means “works with -nw under xterm [or some
	such] but not on a virtual terminal [like /dev/tty2]”.

	Personally, I’d look at (and compare) the stty(1) settings for
	the respective tty devices first; like:

$ stty -a -F /dev/tty2 

$ stty -a -F /dev/pts/5 

-- 
FSF associate member #7257  http://am-1.org/~ivan/





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 17:15       ` Alan Mackenzie
@ 2018-03-25 18:08         ` Eli Zaretskii
  2018-03-25 18:43           ` Andreas Schwab
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2018-03-25 18:08 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 30937

> Date: Sun, 25 Mar 2018 17:15:10 +0000
> Cc: 30937@debbugs.gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> > In both cases, C-g should trigger a SIGINT, so Emacs should be even
> > more responsive to C-g than on X.
> 
> For what it's worth, quit-flag is getting set on a C-g (I hacked up my
> own quit mechanism to test this).  It would appear that nothing is
> testing quit-flag during the comment-region.

comment-region doesn't need to test that explicitly, it is tested in
many underlying primitives.  Moreover, on a TTY, C-g triggers a
SIGINT, which should cause a throw to top-level even if quit-flag is
not tested, just because it's a signal.

Can you see if SIGINT is delivered to Emacs when you type C-g on that
console?





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

* bug#30937: In `comment-region', C-g doesn't work
  2018-03-25 17:35       ` Ivan Shmakov
@ 2018-03-25 18:11         ` Eli Zaretskii
  0 siblings, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2018-03-25 18:11 UTC (permalink / raw)
  To: Ivan Shmakov; +Cc: 30937

> From: Ivan Shmakov <ivan@siamics.net>
> Date: Sun, 25 Mar 2018 17:35:45 +0000
> 
>  > ???  How come it works in "emacs -nw" but not on a "Linux tty" (which
>  > is what, btw? the raw Linux console?).  In both cases, C-g should
>  > trigger a SIGINT, so Emacs should be even more responsive to C-g than
>  > on X.  What am I missing?
> 
> 	I’d think that it means “works with -nw under xterm [or some
> 	such] but not on a virtual terminal [like /dev/tty2]”.
> 
> 	Personally, I’d look at (and compare) the stty(1) settings for
> 	the respective tty devices first; like:
> 
> $ stty -a -F /dev/tty2 
> 
> $ stty -a -F /dev/pts/5 

If a SIGINT is disabled, then I'd expect Emacs on a TTY to become
completely broken wrt to C-g, because AFAIK there's no other mechanism
on a TTY for Emacs to treat C-g differently from any other key.

But it doesn't do any harm to check the stty settings.





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 18:08         ` Eli Zaretskii
@ 2018-03-25 18:43           ` Andreas Schwab
  2018-03-25 19:14             ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Andreas Schwab @ 2018-03-25 18:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Alan Mackenzie, 30937

On Mär 25 2018, Eli Zaretskii <eliz@gnu.org> wrote:

> comment-region doesn't need to test that explicitly, it is tested in
> many underlying primitives.  Moreover, on a TTY, C-g triggers a
> SIGINT, which should cause a throw to top-level even if quit-flag is
> not tested, just because it's a signal.

SIGINT only sets quit-flag.  If you want it to take effect you need to
call maybe_quit.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 18:43           ` Andreas Schwab
@ 2018-03-25 19:14             ` Eli Zaretskii
  2018-03-25 21:08               ` Andreas Schwab
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2018-03-25 19:14 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: acm, 30937

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Alan Mackenzie <acm@muc.de>,  30937@debbugs.gnu.org
> Date: Sun, 25 Mar 2018 20:43:15 +0200
> 
> SIGINT only sets quit-flag.

No, sometimes it also calls quit_throw_to_read_char.





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 19:14             ` Eli Zaretskii
@ 2018-03-25 21:08               ` Andreas Schwab
  0 siblings, 0 replies; 17+ messages in thread
From: Andreas Schwab @ 2018-03-25 21:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: acm, 30937

On Mär 25 2018, Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Andreas Schwab <schwab@linux-m68k.org>
>> Cc: Alan Mackenzie <acm@muc.de>,  30937@debbugs.gnu.org
>> Date: Sun, 25 Mar 2018 20:43:15 +0200
>> 
>> SIGINT only sets quit-flag.
>
> No, sometimes it also calls quit_throw_to_read_char.

Only while waiting for input, thus it cannot arbitrarily interrupt the
Lisp interpreter.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-25 15:39   ` Alan Mackenzie
  2018-03-25 16:48     ` Eli Zaretskii
@ 2018-03-31 14:21     ` Noam Postavsky
  2019-01-09  1:06       ` Glenn Morris
  1 sibling, 1 reply; 17+ messages in thread
From: Noam Postavsky @ 2018-03-31 14:21 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 30937

Alan Mackenzie <acm@muc.de> writes:

> Hello, Eli.
>
> On Sun, Mar 25, 2018 at 18:32:10 +0300, Eli Zaretskii wrote:
>> > Date: Sun, 25 Mar 2018 14:28:55 +0000
>> > From: Alan Mackenzie <acm@muc.de>
>
>> > emacs-26.0.91 -Q
>> > C-x C-f Any largish file.c
>> > C-x h                 ; mark buffer.
>> > C-c C-c               ; comment-region.
>
>> > This is the sort of thing that can happen by accident.  Depending on the
>> > size of the file.c and the speed of your machine, you've now got a long,
>> > long wait.  C-g doesn't work.  This is a bug.
>
>> C-g does work for me just fine in the above recipe.  Maybe it's
>> platform dependent, and the problem happens only on X?
>
> Yes, I've just tried it on X.  It works there (except it leaves point in
> a suboptimal position: the starting point.  It should really leave point
> after the last newly commented line when the quit happened).  It works
> on emacs -nw, with the same proviso.
>
> It doesn't work at all on a Linux tty.  Sorry I didn't try X before
> reporting the bug.

I'm not able to reproduce this on a Linux tty (I assume that means the
virtual terminal you get when pressing Ctrl+Alt+F1).






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

* bug#30937: In `comment-region', C-g doesn't work.
  2018-03-31 14:21     ` Noam Postavsky
@ 2019-01-09  1:06       ` Glenn Morris
  2019-01-10 11:21         ` Alan Mackenzie
  0 siblings, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2019-01-09  1:06 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Alan Mackenzie, 30937

Noam Postavsky wrote:

> I'm not able to reproduce this on a Linux tty (I assume that means the
> virtual terminal you get when pressing Ctrl+Alt+F1).

Me neither. I tried on two different systems.

My suggestion is to close this report, since it has been months and
it doesn't seem to be leading anywhere.





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

* bug#30937: In `comment-region', C-g doesn't work.
  2019-01-09  1:06       ` Glenn Morris
@ 2019-01-10 11:21         ` Alan Mackenzie
  2019-11-02  0:53           ` Stefan Kangas
  0 siblings, 1 reply; 17+ messages in thread
From: Alan Mackenzie @ 2019-01-10 11:21 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Noam Postavsky, 30937

Hello, Glenn.

On Tue, Jan 08, 2019 at 20:06:59 -0500, Glenn Morris wrote:
> Noam Postavsky wrote:

> > I'm not able to reproduce this on a Linux tty (I assume that means the
> > virtual terminal you get when pressing Ctrl+Alt+F1).

> Me neither. I tried on two different systems.

> My suggestion is to close this report, since it has been months and
> it doesn't seem to be leading anywhere.

OK, I won't object to closing this bug report, since the bug doesn't
seem to be happening (on Emacs 26.1 and master) at the moment.  I would
object to labelling the closure "not a bug" or "won't fix".

I do, however, raise an eyebrow at the "doesn't seem to be leading
anywhere" justification.  Bugs, particularly difficult bugs (as this one
is) tend "not to be leading anywhere" for a lot of their life times.  It
would be bad just to close such bugs for such reasons, rather than deal
with them.

On a Linux tty, this problem of C-g being non-functional happens to me
relatively often (several times a year), resulting in me having to kill
Emacs and start it again.  Unfortunately I haven't logged these
occurrences at all.  I strongly believe there is a problem in the
keyboard handling area of Emacs, though pinning it down is difficult.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#30937: In `comment-region', C-g doesn't work.
  2019-01-10 11:21         ` Alan Mackenzie
@ 2019-11-02  0:53           ` Stefan Kangas
  0 siblings, 0 replies; 17+ messages in thread
From: Stefan Kangas @ 2019-11-02  0:53 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Noam Postavsky, 30937-done

Alan Mackenzie <acm@muc.de> writes:

> Hello, Glenn.
>
> On Tue, Jan 08, 2019 at 20:06:59 -0500, Glenn Morris wrote:
>> Noam Postavsky wrote:
>
>> > I'm not able to reproduce this on a Linux tty (I assume that means the
>> > virtual terminal you get when pressing Ctrl+Alt+F1).
>
>> Me neither. I tried on two different systems.
>
>> My suggestion is to close this report, since it has been months and
>> it doesn't seem to be leading anywhere.
>
> OK, I won't object to closing this bug report, since the bug doesn't
> seem to be happening (on Emacs 26.1 and master) at the moment.  I would
> object to labelling the closure "not a bug" or "won't fix".

Thanks, I'm consequently closing this bug report.

Best regards,
Stefan Kangas





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

end of thread, other threads:[~2019-11-02  0:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-25 14:28 bug#30937: In `comment-region', C-g doesn't work Alan Mackenzie
2018-03-25 15:32 ` Eli Zaretskii
2018-03-25 15:39   ` Alan Mackenzie
2018-03-25 16:48     ` Eli Zaretskii
2018-03-25 17:15       ` Alan Mackenzie
2018-03-25 18:08         ` Eli Zaretskii
2018-03-25 18:43           ` Andreas Schwab
2018-03-25 19:14             ` Eli Zaretskii
2018-03-25 21:08               ` Andreas Schwab
2018-03-25 17:35       ` Ivan Shmakov
2018-03-25 18:11         ` Eli Zaretskii
2018-03-31 14:21     ` Noam Postavsky
2019-01-09  1:06       ` Glenn Morris
2019-01-10 11:21         ` Alan Mackenzie
2019-11-02  0:53           ` Stefan Kangas
2018-03-25 16:07 ` Andreas Schwab
2018-03-25 16:01   ` Alan Mackenzie

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