diff options
| author | Stefan Monnier | 2010-12-10 19:13:08 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2010-12-10 19:13:08 -0500 |
| commit | 2c302df3a13236bfbf8ea1b771d13618fcda8d71 (patch) | |
| tree | f26dc9f22861dc37610de319d05255de058c221b /src/sysdep.c | |
| parent | 0c747cb143fa227e78f350ac353d703f489209df (diff) | |
| parent | 175069efeb080517afefdd44a06f7a779ea8c25c (diff) | |
| download | emacs-2c302df3a13236bfbf8ea1b771d13618fcda8d71.tar.gz emacs-2c302df3a13236bfbf8ea1b771d13618fcda8d71.zip | |
Merge from trunk
Diffstat (limited to 'src/sysdep.c')
| -rw-r--r-- | src/sysdep.c | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index f68d475d22c..ac766058d34 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -90,12 +90,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 90 | #include "dispextern.h" | 90 | #include "dispextern.h" |
| 91 | #include "process.h" | 91 | #include "process.h" |
| 92 | #include "cm.h" /* for reset_sys_modes */ | 92 | #include "cm.h" /* for reset_sys_modes */ |
| 93 | #ifdef HAVE_TERM_H | ||
| 94 | /* Include this last. If it is ncurses header file, it adds a lot of | ||
| 95 | defines that interfere with stuff in other headers. Someone responsible | ||
| 96 | for ncurses messed up bigtime. See bug#6812. */ | ||
| 97 | #include <term.h> | ||
| 98 | #endif | ||
| 99 | 93 | ||
| 100 | #ifdef WINDOWSNT | 94 | #ifdef WINDOWSNT |
| 101 | #include <direct.h> | 95 | #include <direct.h> |
| @@ -123,6 +117,9 @@ struct utimbuf { | |||
| 123 | #endif | 117 | #endif |
| 124 | #endif | 118 | #endif |
| 125 | 119 | ||
| 120 | /* Declare here, including term.h is problematic on some systems. */ | ||
| 121 | extern void tputs (const char *, int, int (*)(int)); | ||
| 122 | |||
| 126 | static const int baud_convert[] = | 123 | static const int baud_convert[] = |
| 127 | { | 124 | { |
| 128 | 0, 50, 75, 110, 135, 150, 200, 300, 600, 1200, | 125 | 0, 50, 75, 110, 135, 150, 200, 300, 600, 1200, |
| @@ -232,8 +229,8 @@ discard_tty_input (void) | |||
| 232 | { | 229 | { |
| 233 | if (tty->input) /* Is the device suspended? */ | 230 | if (tty->input) /* Is the device suspended? */ |
| 234 | { | 231 | { |
| 235 | EMACS_GET_TTY (fileno (tty->input), &buf); | 232 | emacs_get_tty (fileno (tty->input), &buf); |
| 236 | EMACS_SET_TTY (fileno (tty->input), &buf, 0); | 233 | emacs_set_tty (fileno (tty->input), &buf, 0); |
| 237 | } | 234 | } |
| 238 | } | 235 | } |
| 239 | } | 236 | } |
| @@ -369,7 +366,7 @@ child_setup_tty (int out) | |||
| 369 | #ifndef WINDOWSNT | 366 | #ifndef WINDOWSNT |
| 370 | struct emacs_tty s; | 367 | struct emacs_tty s; |
| 371 | 368 | ||
| 372 | EMACS_GET_TTY (out, &s); | 369 | emacs_get_tty (out, &s); |
| 373 | s.main.c_oflag |= OPOST; /* Enable output postprocessing */ | 370 | s.main.c_oflag |= OPOST; /* Enable output postprocessing */ |
| 374 | s.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */ | 371 | s.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */ |
| 375 | #ifdef NLDLY | 372 | #ifdef NLDLY |
| @@ -447,7 +444,7 @@ child_setup_tty (int out) | |||
| 447 | s.main.c_cc[VTIME] = 0; | 444 | s.main.c_cc[VTIME] = 0; |
| 448 | #endif | 445 | #endif |
| 449 | 446 | ||
| 450 | EMACS_SET_TTY (out, &s, 0); | 447 | emacs_set_tty (out, &s, 0); |
| 451 | #endif /* not WINDOWSNT */ | 448 | #endif /* not WINDOWSNT */ |
| 452 | } | 449 | } |
| 453 | #endif /* not MSDOS */ | 450 | #endif /* not MSDOS */ |
| @@ -557,15 +554,6 @@ sys_subshell (void) | |||
| 557 | 554 | ||
| 558 | close_process_descs (); /* Close Emacs's pipes/ptys */ | 555 | close_process_descs (); /* Close Emacs's pipes/ptys */ |
| 559 | 556 | ||
| 560 | #ifdef SET_EMACS_PRIORITY | ||
| 561 | { | ||
| 562 | extern EMACS_INT emacs_priority; | ||
| 563 | |||
| 564 | if (emacs_priority < 0) | ||
| 565 | nice (-emacs_priority); | ||
| 566 | } | ||
| 567 | #endif | ||
| 568 | |||
| 569 | #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */ | 557 | #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */ |
| 570 | { | 558 | { |
| 571 | char *epwd = getenv ("PWD"); | 559 | char *epwd = getenv ("PWD"); |
| @@ -859,7 +847,7 @@ init_sys_modes (struct tty_display_info *tty_out) | |||
| 859 | if (! tty_out->old_tty) | 847 | if (! tty_out->old_tty) |
| 860 | tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty)); | 848 | tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty)); |
| 861 | 849 | ||
| 862 | EMACS_GET_TTY (fileno (tty_out->input), tty_out->old_tty); | 850 | emacs_get_tty (fileno (tty_out->input), tty_out->old_tty); |
| 863 | 851 | ||
| 864 | tty = *tty_out->old_tty; | 852 | tty = *tty_out->old_tty; |
| 865 | 853 | ||
| @@ -1005,7 +993,7 @@ init_sys_modes (struct tty_display_info *tty_out) | |||
| 1005 | dos_ttraw (tty_out); | 993 | dos_ttraw (tty_out); |
| 1006 | #endif | 994 | #endif |
| 1007 | 995 | ||
| 1008 | EMACS_SET_TTY (fileno (tty_out->input), &tty, 0); | 996 | emacs_set_tty (fileno (tty_out->input), &tty, 0); |
| 1009 | 997 | ||
| 1010 | /* This code added to insure that, if flow-control is not to be used, | 998 | /* This code added to insure that, if flow-control is not to be used, |
| 1011 | we have an unlocked terminal at the start. */ | 999 | we have an unlocked terminal at the start. */ |
| @@ -1097,8 +1085,16 @@ tabs_safe_p (int fd) | |||
| 1097 | { | 1085 | { |
| 1098 | struct emacs_tty etty; | 1086 | struct emacs_tty etty; |
| 1099 | 1087 | ||
| 1100 | EMACS_GET_TTY (fd, &etty); | 1088 | emacs_get_tty (fd, &etty); |
| 1101 | return EMACS_TTY_TABS_OK (&etty); | 1089 | #ifndef DOS_NT |
| 1090 | #ifdef TABDLY | ||
| 1091 | return ((etty.main.c_oflag & TABDLY) != TAB3); | ||
| 1092 | #else /* not TABDLY */ | ||
| 1093 | return 1; | ||
| 1094 | #endif /* not TABDLY */ | ||
| 1095 | #else /* DOS_NT */ | ||
| 1096 | return 0; | ||
| 1097 | #endif /* DOS_NT */ | ||
| 1102 | } | 1098 | } |
| 1103 | 1099 | ||
| 1104 | /* Get terminal size from system. | 1100 | /* Get terminal size from system. |
| @@ -1260,7 +1256,7 @@ reset_sys_modes (struct tty_display_info *tty_out) | |||
| 1260 | #endif /* F_SETFL */ | 1256 | #endif /* F_SETFL */ |
| 1261 | 1257 | ||
| 1262 | if (tty_out->old_tty) | 1258 | if (tty_out->old_tty) |
| 1263 | while (EMACS_SET_TTY (fileno (tty_out->input), | 1259 | while (emacs_set_tty (fileno (tty_out->input), |
| 1264 | tty_out->old_tty, 0) < 0 && errno == EINTR) | 1260 | tty_out->old_tty, 0) < 0 && errno == EINTR) |
| 1265 | ; | 1261 | ; |
| 1266 | 1262 | ||
| @@ -3071,6 +3067,3 @@ system_process_attributes (Lisp_Object pid) | |||
| 3071 | 3067 | ||
| 3072 | #endif /* !defined (WINDOWSNT) */ | 3068 | #endif /* !defined (WINDOWSNT) */ |
| 3073 | 3069 | ||
| 3074 | |||
| 3075 | /* arch-tag: edb43589-4e09-4544-b325-978b5b121dcf | ||
| 3076 | (do not change this comment) */ | ||