aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-26 04:35:44 +0000
committerKaroly Lorentey2005-06-26 04:35:44 +0000
commit1fb8c4adcbf2d3c833b3e6bbb86211109085fa86 (patch)
tree2064f138bebeb121d2bb4ec25abd4ba3ab0ba769
parente7cf0fa0edcc9e39c3b192930b7d128ebc6ad6db (diff)
downloademacs-1fb8c4adcbf2d3c833b3e6bbb86211109085fa86.tar.gz
emacs-1fb8c4adcbf2d3c833b3e6bbb86211109085fa86.zip
Work around mysterious breakage of arrow key recognition under screen (see first TODO in README).
* src/keyboard.c (Fset_input_mode): Call reset_sys_modes and init_sys_modes on the selected device only; do not use the bulk functions reset_all_sys_modes and init_all_sys_modes. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-358
-rw-r--r--README.multi-tty41
-rw-r--r--src/keyboard.c8
-rw-r--r--src/sysdep.c1
3 files changed, 38 insertions, 12 deletions
diff --git a/README.multi-tty b/README.multi-tty
index 4ad9f990a82..f06500f4a73 100644
--- a/README.multi-tty
+++ b/README.multi-tty
@@ -377,6 +377,30 @@ is probably not very interesting for anyone else.)
377THINGS TO DO 377THINGS TO DO
378------------ 378------------
379 379
380** Having {reset,init}_all_sys_modes in set-input-mode breaks arrow
381 keys on non-selected terminals under screen, and sometimes on other
382 terminal types as well. The other function keys continue to work
383 fine. Sometimes faces on these screens become garbled.
384
385 This only seems to affect displays that are of the same terminfo
386 type as the selected one. Interestingly, in screen Emacs normally
387 reports the up arrow key as `M-o A', but after the above SNAFU, it
388 complains about `M-[ a'. UNIX ttys are a complete mystery to me,
389 but it seems the reset-reinitialize cycle somehow leaves the
390 non-selected terminals in a different state than usual. I have no
391 idea how this could happen.
392
393 Currently set-input-mode resets only the currently selected
394 terminal, which seems to somehow work around the problem.
395
396** Fix set-input-mode for multi-tty. It's a truly horrible interface;
397 what if we'd blow it up into several separate functions (with a
398 compatibility definition)?
399
400** BULK RENAME: The `display-' prefix of new Lisp-level functions
401 conflicts with stuff like `display-time-mode'. Use `device-'
402 instead.
403
380** The single-keyboard mode of MULTI_KBOARD is extremely confusing 404** The single-keyboard mode of MULTI_KBOARD is extremely confusing
381 sometimes; Emacs does not respond to stimuli from other keyboards. 405 sometimes; Emacs does not respond to stimuli from other keyboards.
382 At least a beep or a message would be important, if the single-mode 406 At least a beep or a message would be important, if the single-mode
@@ -415,10 +439,6 @@ THINGS TO DO
415** standard-display-table should be display-local. 439** standard-display-table should be display-local.
416 standard-display-european should be display-local. 440 standard-display-european should be display-local.
417 441
418** Fix set-input-mode for multi-tty. It's a truly horrible interface;
419 what if we'd blow it up into several separate functions (with a
420 compatibility definition)?
421
422** Have a look at Vlocale_coding_system. Seems like it would be a 442** Have a look at Vlocale_coding_system. Seems like it would be a
423 tedious job to localize it, although most references use it for 443 tedious job to localize it, although most references use it for
424 interfacing with libc and are therefore OK with the global 444 interfacing with libc and are therefore OK with the global
@@ -445,11 +465,6 @@ THINGS TO DO
445 465
446 (This is likely an error in the CVS trunk.) 466 (This is likely an error in the CVS trunk.)
447 467
448** The terminal customization files in term/*.el tend to change global
449 parameters, which may confuse Emacs with multiple displays. Change
450 them to tweak only frame-local settings, if possible. (They tend
451 to call define-key to set function key sequences a lot.)
452
453** Dan Nicolaescu suggests that -nw should be added as an alias for -t 468** Dan Nicolaescu suggests that -nw should be added as an alias for -t
454 in emacsclient. Good idea. (Alas, implementing this is not 469 in emacsclient. Good idea. (Alas, implementing this is not
455 trivial, getopt_long does not seem to support two-letter ``short'' 470 trivial, getopt_long does not seem to support two-letter ``short''
@@ -1050,4 +1065,12 @@ DIARY OF CHANGES
1050 1065
1051 (Done, by an ugly hack.) 1066 (Done, by an ugly hack.)
1052 1067
1068-- The terminal customization files in term/*.el tend to change global
1069 parameters, which may confuse Emacs with multiple displays. Change
1070 them to tweak only frame-local settings, if possible. (They tend
1071 to call define-key to set function key sequences a lot.)
1072
1073 (Done, by making `function-key-map' terminal-local (i.e., part of
1074 struct kboard). This has probably covered all the remaining problems.)
1075
1053;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d 1076;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d
diff --git a/src/keyboard.c b/src/keyboard.c
index 13bf7131e0e..016582d8d20 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10584,8 +10584,9 @@ See also `current-input-mode'. */)
10584#endif 10584#endif
10585 10585
10586#ifndef DOS_NT 10586#ifndef DOS_NT
10587 /* this causes startup screen to be restored and messes with the mouse */ 10587 if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
10588 reset_all_sys_modes (); 10588 /* this causes startup screen to be restored and messes with the mouse */
10589 reset_sys_modes (CURTTY ());
10589#endif 10590#endif
10590 10591
10591#ifdef SIGIO 10592#ifdef SIGIO
@@ -10628,7 +10629,8 @@ See also `current-input-mode'. */)
10628 quit_char = XINT (quit) & (NILP (meta) ? 0177 : 0377); 10629 quit_char = XINT (quit) & (NILP (meta) ? 0177 : 0377);
10629 10630
10630#ifndef DOS_NT 10631#ifndef DOS_NT
10631 init_all_sys_modes (); 10632 if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
10633 init_sys_modes (CURTTY ());
10632#endif 10634#endif
10633 10635
10634#ifdef POLL_FOR_INPUT 10636#ifdef POLL_FOR_INPUT
diff --git a/src/sysdep.c b/src/sysdep.c
index 4127517b98f..56dae99dc9f 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1725,6 +1725,7 @@ nil means don't delete them until `list-processes' is run. */);
1725 1725
1726 if (tty_out->term_initted && no_redraw_on_reenter) 1726 if (tty_out->term_initted && no_redraw_on_reenter)
1727 { 1727 {
1728 /* XXX This seems wrong on multi-tty. */
1728 if (display_completed) 1729 if (display_completed)
1729 direct_output_forward_char (0); 1730 direct_output_forward_char (0);
1730 } 1731 }