unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6649: 24.0.50; C-g doesn't work since emacs 23.1 on BSD
@ 2010-07-16  7:08 enami tsugutomo
  2010-07-24  5:20 ` Dan Nicolaescu
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: enami tsugutomo @ 2010-07-16  7:08 UTC (permalink / raw)
  To: 6649

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






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

end of thread, other threads:[~2011-10-25 16:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-16  7:08 bug#6649: 24.0.50; C-g doesn't work since emacs 23.1 on BSD enami tsugutomo
2010-07-24  5:20 ` Dan Nicolaescu
2010-07-30  0:39   ` enami tsugutomo
2010-07-30  4:55     ` Dan Nicolaescu
2010-07-24  7:18 ` Andreas Schwab
2011-10-25  4:29 ` Chong Yidong
2011-10-25 16:41 ` Paul Eggert

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