bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6649: 24.0.50; C-g doesn't work since emacs 23.1 on BSD


From: Dan Nicolaescu
Subject: bug#6649: 24.0.50; C-g doesn't work since emacs 23.1 on BSD
Date: Sat, 24 Jul 2010 01:20:06 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

enami tsugutomo <tsugutomo.enami@jp.sony.com> writes:

> C-g doesn't work for emacs 23.1 or newer on BSD system.  Build recent
> emacs on BSD system (NetBSD in my case), invoke emacs using terminal,
> switch to *scratch*, run (while t) and type C-g.  Emacs continues to
> run.
>
> Since INTERRUPT_INPUT isn't defined for BSD, cbreak mode is used to
> input characters.  When multi-tty is merged, setting of INTR/QUIT
> characters is conditoinalized (if (tty_out->input == stdin) ...) but the
> expression is always false because FILE structure pointed by
> tty_out->input is a one returned from fdopen() and it is never equal to
> stdin.
>
> Followings are terminal mode while running emacs-22.3 and 23.1
> respectively:
>
> enami@memory-leak% stty -f /dev/ttyp4                                   
> speed 9600 baud;
> lflags: -icanon -iexten -echo echoe echoke echoctl
> iflags: -icrnl -ixon ignbrk
> oflags: -onlcr -oxtabs
> cflags: cs8 -parenb
> discard dsusp   erase   intr    lnext   quit    reprint start   stop    
> <undef> <undef> ^H      ^G      <undef> ^G      <undef> <undef> <undef> 
> susp    werase  
> <undef> <undef> 
> enami@memory-leak% stty -f /dev/ttyp4
> speed 9600 baud;
> lflags: -icanon -iexten -echo echoe echoke echoctl
> iflags: -icrnl -ixon ignbrk
> oflags: -onlcr -oxtabs
> cflags: cs8 -parenb
> discard dsusp   erase   intr    lnext   quit    reprint start   stop    
> <undef> <undef> ^H      <undef> <undef> <undef> <undef> <undef> <undef> 
> susp    werase  
> <undef> <undef> 
> enami@memory-leak% 
>
> For now, I'm using following workaround, but not sure if it is an
> appropriate one.
>
> === modified file 'src/sysdep.c'
> --- src/sysdep.c      2010-07-13 10:57:00 +0000
> +++ src/sysdep.c      2010-07-15 00:39:59 +0000
> @@ -989,6 +989,7 @@
>  init_sys_modes (struct tty_display_info *tty_out)
>  {
>    struct emacs_tty tty;
> +  Lisp_Object terminal;
>  
>    Vtty_erase_char = Qnil;
>  
> @@ -1042,7 +1043,8 @@
>        tty.main.c_cflag &= ~PARENB;/* Don't check parity */
>      }
>  #endif
> -  if (tty_out->input == stdin)
> +  XSETTERMINAL(terminal, tty_out->terminal);
> +  if (!NILP (Fcontrolling_tty_p (terminal)))

You are right, it looks like  "if (tty_out->input == stdin)" can never be true.
But your proposed change would make that code active.  
In theory your proposed change sounds like a good idea, but is it?
It would be good to have someone that knows this code say yes/no to the 
change...

It's interesting that other platforms that do not use INTERRUPT_INPUT
like Solaris still work.  It would be interesting to know why.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]