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: enami tsugutomo
Subject: bug#6649: 24.0.50; C-g doesn't work since emacs 23.1 on BSD
Date: Fri, 16 Jul 2010 16:08:11 +0900 (JST)

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:

address@hidden 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> 
address@hidden 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> 
address@hidden 

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)))
     {
       tty.main.c_cc[VINTR] = quit_char;        /* C-g (usually) gives SIGINT */
       /* Set up C-g for both SIGQUIT and SIGINT.




In GNU Emacs 24.0.50.4 (x86_64--netbsd)
 of 2010-07-16 on rplaca.sm.sony.co.jp
configured using `configure  'x86_64--netbsd' '--with-x=no' 
'build_alias=x86_64--netbsd' 'host_alias=x86_64--netbsd' 
'target_alias=x86_64--netbsd''

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: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC x r e p o r - C-b C-k t - TAB RET

Recent messages:
("src/emacs")
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr message sendmail regexp-opt rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils
gmm-utils mailheader emacsbug ediff-hook vc-hooks lisp-float-type
lisp-mode register page menu-bar rfn-eshadow timer jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process multi-tty emacs)






reply via email to

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