Skip to content

Instantly share code, notes, and snippets.

@johnsonjh
Created August 20, 2021 08:04
Show Gist options
  • Save johnsonjh/ea3168ecb7051d4efa7a593b3f830bb9 to your computer and use it in GitHub Desktop.
Save johnsonjh/ea3168ecb7051d4efa7a593b3f830bb9 to your computer and use it in GitHub Desktop.
3c3
< #define PATH_LOADSEARCH "/usr/local/emacs/lisp"
---
> #define PATH_LOADSEARCH "/usr/lib/emacs/lisp"
7,11c7,9
< to set the Lisp variable exec-path and the first file name in it
< sets the Lisp variable exec-directory.
< exec-directory is used for finding various documentation files
< and certain executables. */
< #define PATH_EXEC "/usr/local/emacs/etc"
---
> to set the Lisp variable exec-path and the first file namein it
> sets the Lisp variable exec-directory. */
> #define PATH_EXEC "/usr/lib/emacs/etc"
17c15
< #define PATH_LOCK "/usr/local/emacs/lock/"
---
> #define PATH_LOCK "/usr/lib/emacs/lock/"
21c19
< #define PATH_SUPERLOCK "/usr/local/emacs/lock/!!!SuperLock!!!"
---
> #define PATH_SUPERLOCK "/usr/lib/emacs/lock/!!!SuperLock!!!"
55,57d54
< /* Sun can't write competent compilers */
< #define COMPILER_REGISTER_BUG
<
61a59,60
> #define LIB_STANDARD -lsys_s
>
67a67,74
> #define environ _environ
>
> #define NO_REMAP
> #define UNEXEC unexNeXT.o
>
> #ifndef FSCALE
> #define FSCALE 256
> #endif
22a23,27
> #ifdef hpux
> /* needed by <pwd.h> */
> #include <stdio.h>
> #undef NULL
> #endif
33,37c38,41
< static char user_real_name[33]; /* login ID of current user */
< static char user_full_name[50]; /* full name of current user */
<
< static char system_name[40];
< static char *user_name;
---
> static Lisp_Object Vsystem_name;
> static Lisp_Object Vuser_real_name; /* login name of current user ID */
> static Lisp_Object Vuser_full_name; /* full name of current user */
> static Lisp_Object Vuser_name; /* user name from USER or LOGNAME. */
42,43c46,49
< register char *p;
< struct passwd *pw; /* password entry for the current user */
---
> char *user_name;
> register unsigned char *p, *q;
> struct passwd *pw; /* password entry for the current user */
> Lisp_Object tem;
48,52c54,55
< p = (char *) get_system_name ();
< if (p == 0 || *p == 0)
< p = "Bogus System Name";
< strncpy (system_name, p, sizeof system_name);
< p = system_name;
---
> Vsystem_name = build_string (get_system_name ());
> p = XSTRING (Vsystem_name)->data;
55,59c58,59
< if (*p < ' ')
< *p = 0;
< else
< if (*p == ' ')
< *p = '-';
---
> if (*p == ' ' || *p == '\t')
> *p = '-';
67c67
< #endif /* not CANNOT_DUMP */
---
> #endif /* not CANNOT_DUMP */
70,73c70
< if (pw == 0)
< strcpy (user_real_name, "unknown");
< else
< strncpy (user_real_name, pw->pw_name, sizeof user_real_name);
---
> Vuser_real_name = build_string (pw ? pw->pw_name : "unknown");
77,79c74,78
< user_name = (char *) getenv ("LOGNAME"); /* USG equivalent */
< if (!user_name)
< user_name = user_real_name;
---
> user_name = (char *) getenv ("LOGNAME"); /* USG equivalent */
> if (user_name)
> Vuser_name = build_string (user_name);
> else
> Vuser_name = Vuser_real_name;
81c80,81
< if (strcmp (user_name, user_real_name))
---
> tem = Fstring_equal (Vuser_name, Vuser_real_name);
> if (!NULL (tem) && user_name)
84,125c84,103
< #ifndef AMPERSAND_FULL_NAME
< if (pw == 0)
< strcpy (user_full_name, "unknown");
< else
< strncpy (user_full_name, USER_FULL_NAME, sizeof user_full_name);
< p = index (user_full_name, ',');
< if (p) *p = 0;
< #else
< if (pw == 0)
< p = "unknown";
< else
< p = USER_FULL_NAME;
< {
< int first = 1;
< register char *q, *r;
<
< q = user_full_name; r = user_name;
<
< for (; (*p != 0) && (*p != ','); p++)
< {
< if (*p == '&')
< {
< if (*r != 0)
< {
< *q = *r++;
< *q = UPCASE (*q);
< for (q++; *r != 0; r++)
< {
< if (q == &user_full_name[sizeof user_full_name - 1])
< break;
< *q++ = *r;
< }
< }
< }
< else
< *q++ = *p;
< if (q == &user_full_name[sizeof user_full_name - 2])
< break;
< }
< *q = 0;
< }
< #endif /* AMPERSAND_FULL_NAME */
---
> p = (unsigned char *) (pw ? USER_FULL_NAME : "unknown");
> q = (unsigned char *) index (p, ',');
> Vuser_full_name = make_string (p, q ? q - p : strlen (p));
>
> #ifdef AMPERSAND_FULL_NAME
> p = XSTRING (Vuser_full_name)->data;
> q = (unsigned char *) index (p, '&');
> /* Substitute the login name for the &, upcasing the first character. */
> if (q)
> {
> char *r
> = (char *) alloca (strlen (p) + XSTRING (Vuser_name)->size + 1);
> bcopy (p, r, q - p);
> r[q - p] = 0;
> strcat (r, XSTRING (Vuser_real_name)->data);
> r[q - p] = UPCASE (r[q - p]);
> strcat (r, q + 1);
> Vuser_full_name = build_string (r);
> }
> #endif /* AMPERSAND_FULL_NAME */
167c145
< DEFSIMPLE ("point", Fpoint, Spoint,
---
> DEFUN ("point", Fpoint, Spoint, 0, 0, 0,
169,170c147,153
< Beginning of buffer is position (point-min)",
< Lisp_Int, XSETINT, point)
---
> Beginning of buffer is position (point-min)")
> ()
> {
> Lisp_Object temp;
> XFASTINT (temp) = point;
> return temp;
> }
178a162,172
> int
> in_accessible_range (loc)
> int loc;
> {
> if (loc < BEGV)
> return BEGV;
> if (loc > ZV)
> return ZV;
> return loc;
> }
>
188,190c182
< if (charno < FirstCharacter) charno = FirstCharacter;
< if (charno > NumCharacters) charno = NumCharacters + 1;
< SetPoint (charno);
---
> SET_PT (in_accessible_range (charno));
199c191
< m = Fmarker_position (bf_cur->mark);
---
> m = Fmarker_position (current_buffer->mark);
228c220
< return Fmarker_position (bf_cur->mark);
---
> return Fmarker_position (current_buffer->mark);
238c230
< return bf_cur->mark;
---
> return current_buffer->mark;
263c255
< bf_cur->mark = Qnil;
---
> current_buffer->mark = Qnil;
268,269c260,261
< if (NULL (bf_cur->mark))
< bf_cur->mark = Fmake_marker ();
---
> if (NULL (current_buffer->mark))
> current_buffer->mark = Fmake_marker ();
271c263
< Fset_marker (bf_cur->mark, pos, Qnil);
---
> Fset_marker (current_buffer->mark, pos, Qnil);
279,280c271
< register Lisp_Object oldpoint, oldmark;
< register int visible = XBUFFER (XWINDOW (selected_window)->buffer) == bf_cur;
---
> register int visible = XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer;
282,284c273,274
< oldpoint = Fpoint_marker ();
< oldmark = Fcopy_marker (bf_cur->mark);
< return Fcons (oldpoint, Fcons (oldmark, visible ? Qt : Qnil));
---
> return Fcons (Fpoint_marker (),
> Fcons (Fcopy_marker (current_buffer->mark), visible ? Qt : Qnil));
305,306c295,297
< Fset_marker (bf_cur->mark, tem, Fcurrent_buffer ());
< unchain_marker (tem);
---
> Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ());
> if (XMARKER (tem)->buffer)
> unchain_marker (tem);
308c299
< if (!NULL (tem) && bf_cur != XBUFFER (XWINDOW (selected_window)->buffer))
---
> if (!NULL (tem) && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer))
330,337c321,338
< DEFSIMPLE ("buffer-size", Fbufsize, Sbufsize,
< "Return the number of characters in the current buffer.",
< Lisp_Int, XSETINT, bf_s1 + bf_s2)
<
< DEFSIMPLE ("point-min", Fpoint_min, Spoint_min,
< "Return the minimum permissible value of point in the current buffer.\n\
< This is 1, unless a clipping restriction is in effect.",
< Lisp_Int, XSETINT, FirstCharacter)
---
> DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 0, 0,
> "Return the number of characters in the current buffer.")
> ()
> {
> Lisp_Object temp;
> XFASTINT (temp) = Z - BEG;
> return temp;
> }
>
> DEFUN ("point-min", Fpoint_min, Spoint_min, 0, 0, 0,
> "Return the minimum permissible value of point in the current buffer.\n\
> This is 1, unless a clipping restriction is in effect.")
> ()
> {
> Lisp_Object temp;
> XFASTINT (temp) = BEGV;
> return temp;
> }
344c345
< return buildmark (FirstCharacter);
---
> return buildmark (BEGV);
347c348
< DEFSIMPLE ("point-max", Fpoint_max, Spoint_max,
---
> DEFUN ("point-max", Fpoint_max, Spoint_max, 0, 0, 0,
350,351c351,357
< in which case it is less.",
< Lisp_Int, XSETINT, NumCharacters+1)
---
> in which case it is less.")
> ()
> {
> Lisp_Object temp;
> XFASTINT (temp) = ZV;
> return temp;
> }
358c364,373
< return buildmark (NumCharacters+1);
---
> return buildmark (ZV);
> }
>
> DEFUN ("following-char", Ffollchar, Sfollchar, 0, 0, 0,
> "Return the character following point, as a number.")
> ()
> {
> Lisp_Object temp;
> XFASTINT (temp) = FETCH_CHAR (point);
> return temp;
361,366c376,386
< DEFSIMPLE ("following-char", Ffollchar, Sfollchar,
< "Return the character following point, as a number.",
< Lisp_Int, XSETINT, point>NumCharacters ? 0 : CharAt(point))
< DEFSIMPLE ("preceding-char", Fprevchar, Sprevchar,
< "Return the character preceding point, as a number.",
< Lisp_Int, XSETINT, point<=FirstCharacter ? 0 : CharAt(point-1))
---
> DEFUN ("preceding-char", Fprevchar, Sprevchar, 0, 0, 0,
> "Return the character preceding point, as a number.")
> ()
> {
> Lisp_Object temp;
> if (point <= BEGV)
> XFASTINT (temp) = 0;
> else
> XFASTINT (temp) = FETCH_CHAR (point - 1);
> return temp;
> }
368c388
< DEFPRED ("bobp", Fbobp, Sbobp,
---
> DEFUN ("bobp", Fbobp, Sbobp, 0, 0, 0,
370,372c390,398
< If the buffer is narrowed, this means the beginning of the narrowed part.",
< point<=FirstCharacter)
< DEFPRED ("eobp", Feobp, Seobp,
---
> If the buffer is narrowed, this means the beginning of the narrowed part.")
> ()
> {
> if (point == BEGV)
> return Qt;
> return Qnil;
> }
>
> DEFUN ("eobp", Feobp, Seobp, 0, 0, 0,
374,379c400,417
< If the buffer is narrowed, this means the end of the narrowed part.",
< point>NumCharacters)
< DEFPRED ("bolp", Fbolp, Sbolp,
< "Return T if point is at the beginning of a line.",
< point<=FirstCharacter || CharAt(point-1)=='\n')
< DEFPRED ("eolp", Feolp, Seolp,
---
> If the buffer is narrowed, this means the end of the narrowed part.")
> ()
> {
> if (point == ZV)
> return Qt;
> return Qnil;
> }
>
> DEFUN ("bolp", Fbolp, Sbolp, 0, 0, 0,
> "Return T if point is at the beginning of a line.")
> ()
> {
> if (point == BEGV || FETCH_CHAR (point - 1) == '\n')
> return Qt;
> return Qnil;
> }
>
> DEFUN ("eolp", Feolp, Seolp, 0, 0, 0,
381,382c419,425
< `End of a line' includes point being at the end of the buffer.",
< point>NumCharacters || CharAt(point)=='\n')
---
> `End of a line' includes point being at the end of the buffer.")
> ()
> {
> if (point == ZV || FETCH_CHAR (point) == '\n')
> return Qt;
> return Qnil;
> }
392c435,436
< register int n = XINT (pos);
---
> register int n;
>
394d437
< if (n < FirstCharacter || n > NumCharacters) return Qnil;
396c439,442
< XFASTINT (val) = CharAt (n);
---
> n = XINT (pos);
> if (n < BEGV || n >= ZV) return Qnil;
>
> XFASTINT (val) = FETCH_CHAR (n);
405c451
< return build_string (user_name);
---
> return Vuser_name;
414c460
< return build_string (user_real_name);
---
> return Vuser_real_name;
435c481
< return build_string (user_full_name);
---
> return Vuser_full_name;
442c488
< return build_string (system_name);
---
> return Vsystem_name;
449,450c495,496
< long now = time ( (long *) 0);
< register char *tem = (char *) ctime (&now);
---
> long current_time = time (0);
> register char *tem = (char *) ctime (&current_time);
454a501,506
> insert1 (arg)
> Lisp_Object arg;
> {
> Finsert (1, &arg);
> }
>
472c524
< InsCStr (str, 1);
---
> insert (str, 1);
476c528
< InsCStr (XSTRING (tem)->data, XSTRING (tem)->size);
---
> insert (XSTRING (tem)->data, XSTRING (tem)->size);
535c587
< if (n < 0)
---
> if (n <= 0)
543c595
< InsCStr (string, strlen);
---
> insert (string, strlen);
547c599
< InsCStr (string, n);
---
> insert (string, n);
566c618
< if (beg <= bf_s1 && end > bf_s1)
---
> if (beg < GPT && end > GPT)
568c620
< return make_string (&CharAt (beg), end - beg);
---
> return make_string (&FETCH_CHAR (beg), end - beg);
575,577c627,629
< if (FirstCharacter <= bf_s1 && NumCharacters + 1 > bf_s1)
< move_gap (FirstCharacter);
< return make_string (&CharAt (FirstCharacter), NumCharacters + 1 - FirstCharacter);
---
> if (BEGV < GPT && ZV > GPT)
> move_gap (BEGV);
> return make_string (BEGV_ADDR, ZV - BEGV);
596c648
< beg = bp->text.head_clip - 1;
---
> beg = BUF_BEGV (bp);
600c652
< beg = XINT (b) - 1;
---
> beg = XINT (b);
603,604c655
< end = bp->text.size1 + bp->text.size2
< - bp->text.tail_clip;
---
> end = BUF_ZV (bp);
608c659
< end = XINT (e) - 1;
---
> end = XINT (e);
616c667
< if (point != bf_s1 + 1)
---
> if (point != GPT)
618,621c669,670
< if (bf_gap < end - beg)
< make_gap (end - beg);
< /* Make sure buf->text is up to date in case buf is the current buffer. */
< bf_cur->text = bf_text;
---
> if (GAP_SIZE < end - beg)
> make_gap (end - beg - GAP_SIZE);
623c672
< if (!(bp->text.head_clip - 1 <= beg
---
> if (!(BUF_BEGV (bp) <= beg
625c674
< && end <= bp->text.size1 + bp->text.size2 - bp->text.tail_clip))
---
> && end <= BUF_ZV (bp)))
631c680
< if (beg < bp->text.size1)
---
> if (beg < BUF_GPT (bp))
633,634c682,683
< InsCStr (bp->text.p1 + 1 + beg, min (end, bp->text.size1) - beg);
< beg = min (end, bp->text.size1);
---
> insert (BUF_CHAR_ADDRESS (bp, beg), min (end, BUF_GPT (bp)) - beg);
> beg = min (end, BUF_GPT (bp));
637c686
< InsCStr (bp->text.p2 + 1 + beg, end - beg);
---
> insert (BUF_CHAR_ADDRESS (bp, beg), end - beg);
662c711,716
< bf_modified--;
---
> {
> if (MODIFF - 1 == current_buffer->save_modified)
> current_buffer->save_modified++;
> if (MODIFF - 1 == current_buffer->auto_save_modified)
> current_buffer->auto_save_modified++;
> }
666c720
< if (CharAt (pos) == look)
---
> if (FETCH_CHAR (pos) == look)
670c724
< CharAt (pos) = XINT (tochar);
---
> FETCH_CHAR (pos) = XINT (tochar);
694,695c748,749
< bf_cur->text.head_clip = bf_head_clip = 1;
< bf_cur->text.tail_clip = bf_tail_clip = 0;
---
> BEGV = BEG;
> SET_BUF_ZV (current_buffer, Z);
723,724c777
< if (!(1 <= XINT (b) && XINT (b) <= XINT (e)
< && XINT (e) <= bf_s1 + bf_s2 + 1))
---
> if (!(BEG <= XINT (b) && XINT (b) <= XINT (e) && XINT (e) <= Z))
727,728c780,781
< bf_cur->text.head_clip = bf_head_clip = XFASTINT (b);
< bf_cur->text.tail_clip = bf_tail_clip = bf_s1 + bf_s2 + 1 - XFASTINT (e);
---
> BEGV = XFASTINT (b);
> SET_BUF_ZV (current_buffer, XFASTINT (e));
730c783
< SetPoint (XFASTINT (b));
---
> SET_PT (XFASTINT (b));
732c785
< SetPoint (XFASTINT (e));
---
> SET_PT (XFASTINT (e));
740c793
< register Lisp_Object ml, mh;
---
> register Lisp_Object bottom, top;
743,745c796,798
< does not advance mh and is considered "outside" the saved region. */
< XFASTINT (ml) = bf_head_clip;
< XFASTINT (mh) = bf_tail_clip;
---
> does not advance top and is considered "outside" the saved region. */
> XFASTINT (bottom) = BEGV - BEG;
> XFASTINT (top) = Z - ZV;
747c800
< return Fcons (Fcurrent_buffer (), Fcons (ml, mh));
---
> return Fcons (Fcurrent_buffer (), Fcons (bottom, top));
754c807
< register struct buffer *old = bf_cur;
---
> register struct buffer *buf;
758c811
< Fset_buffer (XCONS (data)->car);
---
> buf = XBUFFER (XCONS (data)->car);
766c819
< if (newhead + newtail > bf_s1 + bf_s2 + 1)
---
> if (newhead + newtail > BUF_Z (buf) - BUF_BEG (buf))
768c821
< newhead = 1;
---
> newhead = 0;
771,772c824,825
< bf_cur->text.head_clip = bf_head_clip = newhead;
< bf_cur->text.tail_clip = bf_tail_clip = newtail;
---
> BUF_BEGV (buf) = BUF_BEG (buf) + newhead;
> SET_BUF_ZV (buf, BUF_Z (buf) - newtail);
776,779c829
< if (point < FirstCharacter)
< SetPoint (FirstCharacter);
< if (point > NumCharacters+1)
< SetPoint (NumCharacters+1);
---
> SET_BUF_PT (buf, in_accessible_range (BUF_PT (buf)));
781d830
< SetBfp (old);
956c1005
< if (!NULL (bf_cur->case_fold_search)
---
> if (!NULL (current_buffer->case_fold_search)
980a1030,1034
> staticpro (&Vsystem_name);
> staticpro (&Vuser_name);
> staticpro (&Vuser_full_name);
> staticpro (&Vuser_real_name);
>
148c148
<
---
>
150c150
<
---
>
155,158c155
< #ifdef NeXT
< #define environ _environ
< #endif
< #ifndef DONT_NEED_ENVIRON
---
> #ifndef DONT_NEED_ENVIRON
210d206
< _environ = &environ;
348c344
<
---
>
384,386d379
< #ifdef NeXT
< int (* _cthread_init_routine)();
< #endif
400,404d392
< #ifdef NeXT
< _mach_init();
< if (_cthread_init_routine)
< (*_cthread_init_routine)();
< #endif
456c444
< put an underscore character in its name otherwise. */
---
> put an underscore character in its name otherwise. */
460a449,452
> asm(" global float_loc");
> asm(" set float_loc,0xFFFFB000");
> asm(" global fpa_loc");
> asm(" set fpa_loc,0xfff08000");
470,471c462,464
< asm(" beq.b skip_float");
< asm(" fmov.l &0x7480,%fpcr");
---
> asm(" beq.b skip_float");
> asm(" fmov.l &0x7400,%fpcr");
> /* asm(" fmov.l &0x7480,%fpcr"); */
473a467,468
> asm(" mov.l %a0,%d0");
> asm(" add.l %d0,%d0");
475a471,473
> asm(" add.l %d0,%d0");
> asm(" subx.w %d1,%d1");
> asm(" mov.w %d1,flag_fpa");
507c505,506
<
---
> asm(" comm flag_fpa, 4");
>
534c533
< /* initialize signal catching for UTX/32 1.2; this is
---
> /* initialize signal catching for UTX/32 1.2; this is
574c573
<
---
>
584c583
<
---
>
27c27
< #include "s-bsd4-2.h"
---
> #include "s-mach.h"
34c34
< #include "m-vax.h"
---
> #include "m-NeXT.h"
90a91,98
> /* Maximum screen width we handle. */
>
> #define MScreenWidth 300
>
> /* Maximum screen length we handle. */
>
> #define MScreenLength 300
>
98c106
< #define PURESIZE 119000
---
> #define PURESIZE 118000
102a103,106
> #ifdef mips
> #include <sys/ioctl.h>
> #endif
>
126a131,134
> #ifdef BROKEN_TIOCGETC
> #undef TIOCGETC
> #endif
>
142a151,164
> #ifdef TIOCGWINSZ
> #ifndef IRIS_4D
> #ifndef mips
> #ifndef aix386
> #ifndef NO_SIOCTL_H
> /* Some USG systems with TIOCGWINSZ need this file; some don't have it.
> We don't know how to distinguish them.
> If this #include gets an error, just delete it. */
> #include <sys/sioctl.h>
> #endif
> #endif
> #endif
> #endif
> #endif
159a182,185
> #ifdef BROKEN_FIONREAD
> #undef FIONREAD
> #endif
>
288,290c314,318
< baud_rate = ospeed == 0 ? 1200
< : ospeed < sizeof baud_convert / sizeof baud_convert[0]
< ? baud_convert[ospeed] : 9600;
---
>
> baud_rate = (ospeed < sizeof baud_convert / sizeof baud_convert[0]
> ? baud_convert[ospeed] : 9600);
> if (baud_rate == 0)
> baud_rate = 1200;
328c356
< #ifdef BSD
---
> #if defined(BSD) || (defined(HPUX) && !defined(HPUX_5))
361c389
< #else /* not BSD */
---
> #else /* not BSD, and not HPUX version >= 6 */
371c399
< #endif /* not BSD */
---
> #endif /* not BSD, and not HPUX version >= 6 */
441c469
< /* AIX enhanced edit looses NULs, so disable it */
---
> /* AIX enhanced edit loses NULs, so disable it */
486a515,521
> /* Record a signal code and the handler for it. */
> struct save_signal
> {
> int code;
> int (*handler) ();
> };
>
503a539
> #ifdef SIGTSTP
505a542,544
> #else
> kill (-getpgrp (0), SIGTSTP);
> #endif
518,520c557,561
< int (*interrupt) ();
< int (*quit) ();
< int (*term) ();
---
> struct save_signal saved_handlers[5];
>
> saved_handlers[0].code = SIGINT;
> saved_handlers[1].code = SIGQUIT;
> saved_handlers[2].code = SIGTERM;
522,523c563,567
< int (*sigio) ();
< #endif SIGIO
---
> saved_handlers[3].code = SIGIO;
> saved_handlers[4].code = 0;
> #else
> saved_handlers[3].code = 0;
> #endif
540c584
< /* mentioning bf_cur->buffer would mean including buffer.h,
---
> /* mentioning current_buffer->buffer would mean including buffer.h,
566,571c610
< interrupt = (int (*)()) signal (SIGINT, SIG_IGN);
< quit = (int (*)()) signal (SIGQUIT, SIG_IGN);
< term = (int (*)()) signal (SIGTERM, SIG_IGN);
< #ifdef SIGIO
< sigio = (int (*)()) signal (SIGIO, SIG_IGN);
< #endif /* SIGIO */
---
> save_signal_handlers (&saved_handlers);
573,578c612
< signal (SIGINT, interrupt);
< signal (SIGQUIT, quit);
< signal (SIGTERM, term);
< #ifdef SIGIO
< signal (SIGIO, sigio);
< #endif /* SIGIO */
---
> restore_signal_handlers (&saved_handlers);
582a617,637
>
> save_signal_handlers (saved_handlers)
> struct save_signal *saved_handlers;
> {
> while (saved_handlers->code)
> {
> saved_handlers->handler
> = (int (*) ()) signal (saved_handlers->code, SIG_IGN);
> saved_handlers++;
> }
> }
>
> restore_signal_handlers (saved_handlers)
> struct save_signal *saved_handlers;
> {
> while (saved_handlers->code)
> {
> signal (saved_handlers->code, saved_handlers->handler);
> saved_handlers++;
> }
> }
696c751
< TERMINAL sg;
---
> TERMINAL tty;
739c794
< sg = old_gtty;
---
> tty = old_gtty;
742,743c797,798
< sg.c_iflag |= (IGNBRK); /* Ignore break condition */
< sg.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */
---
> tty.c_iflag |= (IGNBRK); /* Ignore break condition */
> tty.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */
745c800
< sg.c_iflag &= ~ISTRIP; /* don't strip 8th bit on input */
---
> tty.c_iflag &= ~ISTRIP; /* don't strip 8th bit on input */
747,749c802,804
< sg.c_lflag &= ~ECHO; /* Disable echo */
< sg.c_lflag &= ~ICANON; /* Disable erase/kill processing */
< sg.c_lflag |= ISIG; /* Enable signals */
---
> tty.c_lflag &= ~ECHO; /* Disable echo */
> tty.c_lflag &= ~ICANON; /* Disable erase/kill processing */
> tty.c_lflag |= ISIG; /* Enable signals */
752c807
< sg.c_iflag |= IXON; /* Enable start/stop output control */
---
> tty.c_iflag |= IXON; /* Enable start/stop output control */
754c809
< sg.c_iflag &= ~IXANY;
---
> tty.c_iflag &= ~IXANY;
758,760c813,815
< sg.c_iflag &= ~IXON; /* Disable start/stop output control */
< sg.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */
< sg.c_oflag &= ~TAB3; /* Disable tab expansion */
---
> tty.c_iflag &= ~IXON; /* Disable start/stop output control */
> tty.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */
> tty.c_oflag &= ~TAB3; /* Disable tab expansion */
762,763c817,818
< sg.c_cflag |= CS8; /* allow 8th bit on input */
< sg.c_cflag &= ~PARENB; /* Don't check parity */
---
> tty.c_cflag |= CS8; /* allow 8th bit on input */
> tty.c_cflag &= ~PARENB; /* Don't check parity */
765c820
< sg.c_cc[VINTR] = '\007'; /* ^G gives SIGINT */
---
> tty.c_cc[VINTR] = '\007'; /* ^G gives SIGINT */
769,771c824,826
< sg.c_cc[VQUIT] = '\007';
< sg.c_cc[VMIN] = 1; /* Input should wait for at least 1 char */
< sg.c_cc[VTIME] = 0; /* no matter how long that takes. */
---
> tty.c_cc[VQUIT] = '\007';
> tty.c_cc[VMIN] = 1; /* Input should wait for at least 1 char */
> tty.c_cc[VTIME] = 0; /* no matter how long that takes. */
773c828
< sg.c_cc[VSWTCH] = CDEL; /* Turn off shell layering use of C-z */
---
> tty.c_cc[VSWTCH] = CDEL; /* Turn off shell layering use of C-z */
777,778c832,833
< sg.c_line = 0;
< sg.c_iflag &= ~ASCEDIT;
---
> tty.c_line = 0;
> tty.c_iflag &= ~ASCEDIT;
783,784c838,839
< s.c_iflag &= ~IGNBRK;
< s.c_iflag &= ~BRKINT;
---
> tty.c_iflag &= ~IGNBRK;
> tty.c_iflag &= ~BRKINT;
788c843
< sg.tt_char |= TT$M_NOECHO | TT$M_EIGHTBIT;
---
> tty.tt_char |= TT$M_NOECHO | TT$M_EIGHTBIT;
790c845
< sg.tt_char |= TT$M_TTSYNC;
---
> tty.tt_char |= TT$M_TTSYNC;
792,793c847,848
< sg.tt_char &= ~TT$M_TTSYNC;
< sg.tt2_char |= TT2$M_PASTHRU | TT2$M_XON;
---
> tty.tt_char &= ~TT$M_TTSYNC;
> tty.tt2_char |= TT2$M_PASTHRU | TT2$M_XON;
795,797c850,852
< sg.sg_flags &= ~(ECHO | CRMOD | XTABS);
< sg.sg_flags |= ANYP;
< sg.sg_flags |= interrupt_input ? RAW : CBREAK;
---
> tty.sg_flags &= ~(ECHO | CRMOD | XTABS);
> tty.sg_flags |= ANYP;
> tty.sg_flags |= interrupt_input ? RAW : CBREAK;
803c858
< &sg.class, 12, 0, 0, 0, 0);
---
> &tty.class, 12, 0, 0, 0, 0);
805c860
< ioctl (0, TIOCSETN, &sg);
---
> ioctl (0, TIOCSETN, &tty);
817c872
< #ifdef IBMRTAIX
---
> #ifdef AIX
839a895
> #ifndef HAVE_TERMIO
865a922
> #endif /* not HAVE_TERMIO */
909c966
< TERMINAL sg;
---
> TERMINAL tty;
913,914c970,971
< SYS$QIOW (0, input_chan, IO$_SENSEMODE, &sg, 0, 0,
< &sg.class, 12, 0, 0, 0, 0);
---
> SYS$QIOW (0, input_chan, IO$_SENSEMODE, &tty, 0, 0,
> &tty.class, 12, 0, 0, 0, 0);
916c973
< ioctl (0, TIOCGETP, &sg);
---
> ioctl (0, TIOCGETP, &tty);
918c975
< return (TABS_OK(sg));
---
> return (TABS_OK(tty));
946,948d1002
< if ((unsigned) size.ws_col > MScreenWidth
< || (unsigned) size.ws_row > MScreenLength)
< return;
953,957c1007,1011
< TERMINAL sg;
< SYS$QIOW (0, input_chan, IO$_SENSEMODE, &sg, 0, 0,
< &sg.class, 12, 0, 0, 0, 0);
< *widthp = sg.scr_wid;
< *heightp = sg.scr_len;
---
> TERMINAL tty;
> SYS$QIOW (0, input_chan, IO$_SENSEMODE, &tty, 0, 0,
> &tty.class, 12, 0, 0, 0, 0);
> *widthp = tty.scr_wid;
> *heightp = tty.scr_len;
976c1030
< topos (screen_height - 1, 0);
---
> move_cursor (screen_height - 1, 0);
979c1033
< topos (screen_height - 1, 0);
---
> move_cursor (screen_height - 1, 0);
992a1047
> #ifndef HAVE_TERMIO
996a1052
> #endif /* not HAVE_TERMIO */
1018c1074
< #ifdef IBMRTAIX
---
> #ifdef AIX
1022a1079,1127
> #ifdef HAVE_PTYS
>
> /* Set up the proper status flags for use of a pty. */
>
> setup_pty (fd)
> int fd;
> {
> /* I'm told that TOICREMOTE does not mean control chars
> "can't be sent" but rather that they don't have
> input-editing or signaling effects.
> That should be good, because we have other ways
> to do those things in Emacs.
> However, telnet mode seems not to work on 4.2.
> So TIOCREMOTE is turned off now. */
>
> /* Under hp-ux, if TIOCREMOTE is turned on, some calls
> will hang. In particular, the "timeout" feature (which
> causes a read to return if there is no data available)
> does this. Also it is known that telnet mode will hang
> in such a way that Emacs must be stopped (perhaps this
> is the same problem).
>
> If TIOCREMOTE is turned off, then there is a bug in
> hp-ux which sometimes loses data. Apparently the
> code which blocks the master process when the internal
> buffer fills up does not work. Other than this,
> though, everything else seems to work fine.
>
> Since the latter lossage is more benign, we may as well
> lose that way. -- cph */
> #ifdef FIONBIO
> #ifdef SYSV_PTYS
> {
> int on = 1;
> ioctl (fd, FIONBIO, &on);
> }
> #endif
> #endif
> #ifdef IBMRTAIX
> /* On AIX, the parent gets SIGHUP when a pty attached child dies. So, we */
> /* ignore SIGHUP once we've started a child on a pty. Note that this may */
> /* cause EMACS not to die when it should, i.e., when its own controlling */
> /* tty goes away. I've complained to the AIX developers, and they may */
> /* change this behavior, but I'm not going to hold my breath. */
> signal (SIGHUP, SIG_IGN);
> #endif
> }
> #endif /* HAVE_PTYS */
>
1135,1136c1240,1241
< RedoModes++;
< DoDsp (1);
---
> update_mode_lines++;
> redisplay_preserve_echo_area ();
1270a1376,1378
> #ifdef NeXT
> return ((char *)0); /* wrong: but nobody uses it anyway */
> #else
1272a1381
> #endif
1329a1439,1443
> #ifdef __NeXT__
> static int etext;
>
> etext = get_etext();
> #else
1330a1445
> #endif
1345a1461,1465
> #ifdef __NeXT__
> static int edata;
>
> edata = get_edata();
> #else
1346a1467
> #endif
1759a1881,1886
> #ifdef HPUX
> #ifdef X11
> #define HAVE_RANDOM
> #endif
> #endif
>
1760a1888
> #ifndef HAVE_RANDOM
1780a1909
> #endif /* HAVE_RANDOM */
1813c1942
< if (lib$sys_trnlog(&d_name, &eqlen, &equiv) == 1)
---
> if (lib$sys_trnlog (&d_name, &eqlen, &equiv) == 1)
1815,1816c1944,1949
< buf[eqlen] = '\0';
< return buf;
---
> char *str = (char *) xmalloc (eqlen + 1);
> bcopy (buf, str, eqlen);
> str[eqlen] = '\0';
> /* This is a storage leak, but a pain to fix. With luck,
> no one will ever notice. */
> return str;
2050a2184,2185
> #ifndef HAVE_RENAME
>
2069a2205
> #endif /* not HAVE_RENAME */
2121a2258
> #if 0
2131a2269
> #endif /* 0 */
2208a2347
> #ifndef HAVE_CLOSEDIR
2216a2356
> #endif /* not HAVE_CLOSEDIR */
3494c3634
< #ifdef IBMRTAIX
---
> #ifdef AIX
3555c3695
< #endif IBMRTAIX
---
> #endif /* AIX */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment