home *** CD-ROM | disk | FTP | other *** search
- *** emacs-18.58/src/termcap.c 1992/02/21 11:21:03
- --- GNUEMACS:src/termcap.c 1992/02/23 11:07:09
- ***************
- *** 344,350 ****
- --- 344,354 ----
- #ifdef VMS
- filep = tem && legal_filename_p (tem);
- #else
- + #ifdef AMIGA
- + filep = tem != 0; /* Always assume that it is a file */
- + #else
- filep = tem && (*tem == '/');
- + #endif
- #endif /* VMS */
-
- /* If tem is non-null and starts with / (in the un*x case, that is),
- ***************
- *** 377,383 ****
- --- 381,391 ----
- #ifdef VMS
- tem = "emacs_library:[etc]termcap.dat";
- #else
- + #ifdef AMIGA
- + tem = "s:termcap";
- + #else
- tem = "/etc/termcap";
- + #endif
- #endif
-
- /* Here we know we must search a file and tem has its name. */
- *** emacs-18.58/src/alloc.c 1992/02/21 11:18:24
- --- GNUEMACS:src/alloc.c 1992/05/13 23:07:01
- ***************
- *** 76,81 ****
- --- 76,86 ----
- Preallocated since perhaps we can't allocate it when memory is full. */
- Lisp_Object memory_exhausted_message;
-
- + #ifdef AMIGA_DUMP
- + int *pure; /* pure array is allocated at run-time */
- + int puresize = DEF_PURESIZE; /* and has a variable size */
- + #define PUREBEG (char *) pure
- + #else /* not AMIGA_DUMP */
- #ifndef HAVE_SHM
- #ifdef VMS
- int pure[PURESIZE / sizeof (int)]; /*no need to initialize - wasted space*/
- ***************
- *** 87,92 ****
- --- 92,98 ----
- #define pure PURE_SEG_BITS /* Use shared memory segment */
- #define PUREBEG (char *)PURE_SEG_BITS
- #endif /* not HAVE_SHM */
- + #endif /* not AMIGA_DUMP */
-
- /* Index in pure at which next pure object will be allocated. */
- int pureptr;
- ***************
- *** 727,734 ****
- --- 733,744 ----
- #ifdef __GNUC__
- Lisp_Object *staticvec[NSTATICS] = {0};
- #else
- + #ifdef AMIGA_DUMP
- + Lisp_Object *staticvec[NSTATICS]; /* Doesn't need to be pure */
- + #else
- char staticvec1[NSTATICS * sizeof (Lisp_Object *)] = {0};
- #define staticvec ((Lisp_Object **) staticvec1)
- + #endif
- #endif
-
- /* Put an entry in staticvec, pointing at the variable whose address is given */
- *** emacs-18.58/src/dispnew.c 1992/02/21 11:18:24
- --- GNUEMACS:src/dispnew.c 1992/05/16 21:25:46
- ***************
- *** 661,666 ****
- --- 661,680 ----
- if (force_redisplay)
- force = 1;
-
- + #ifdef FAST_DISPLAY
- + /* Don't compute for i/d line if just want cursor motion. */
- + /* Don't allow preemption, etc either */
- + for (i = 0; i < screen_height; i++)
- + if (new_screen->enable[i])
- + break;
- +
- + if (i >= screen_height)
- + {
- + update_begin();
- + goto update_done;
- + }
- + #endif
- +
- if (!force)
- detect_input_pending ();
- if (!force
- ***************
- *** 677,686 ****
- if (!line_ins_del_ok)
- inhibit_hairy_id = 1;
-
- /* Don't compute for i/d line if just want cursor motion. */
- for (i = 0; i < screen_height; i++)
- ! if (new_screen->enable)
- break;
-
- /* Try doing i/d line, if not yet inhibited. */
- if (!inhibit_hairy_id && i < screen_height)
- --- 691,702 ----
- if (!line_ins_del_ok)
- inhibit_hairy_id = 1;
-
- + #ifndef FAST_DISPLAY
- /* Don't compute for i/d line if just want cursor motion. */
- for (i = 0; i < screen_height; i++)
- ! if (new_screen->enable[i])
- break;
- + #endif
-
- /* Try doing i/d line, if not yet inhibited. */
- if (!inhibit_hairy_id && i < screen_height)
- ***************
- *** 724,729 ****
- --- 740,748 ----
- update_line (i);
- }
- }
- + #ifdef FAST_DISPLAY
- + update_done:
- + #endif
- pause = (i < screen_height - 1) ? i + 1 : 0;
-
- /* Now just clean up termcap drivers and set cursor, etc. */
- ***************
- *** 876,881 ****
- --- 895,951 ----
- else
- reassert_line_highlight (new_screen->highlight[vpos], vpos);
-
- + #ifdef FAST_DISPLAY
- + if (current_screen->enable[vpos])
- + {
- + obody = current_screen->contents[vpos];
- + olen = current_screen->used[vpos];
- + }
- + else olen = 0;
- +
- + nbody = new_screen->contents[vpos];
- + nlen = new_screen->used[vpos];
- +
- + /* Pretend trailing spaces are not there at all,
- + unless for one reason or another we must write all spaces. */
- + /* We know that the previous character byte contains 0. */
- + if (! new_screen->highlight[vpos])
- + {
- + if (!must_write_spaces)
- + while (nbody[nlen - 1] == ' ')
- + nlen--;
- + }
- + else
- + {
- + /* For an inverse-video line, give it extra trailing spaces
- + all the way to the screen edge
- + so that the reverse video extends all the way across. */
- + while (nlen < screen_width - 1)
- + nbody[nlen++] = ' ';
- + }
- +
- + while (olen > 0 && nlen > 0 && *obody == *nbody)
- + {
- + olen--; nlen--; obody++; nbody++;
- + }
- + if (olen > 0 || nlen > 0)
- + move_cursor (vpos, nbody - new_screen->contents[vpos]);
- + if (nlen > 0) output_chars (nbody, nlen);
- +
- + if (olen > nlen && new_screen->used[vpos] != screen_width)
- + clear_end_of_line(current_screen->used[vpos]);
- + /* Exchange contents between current_screen and new_screen. */
- + temp = new_screen->contents[vpos];
- + new_screen->contents[vpos] = current_screen->contents[vpos];
- + current_screen->contents[vpos] = temp;
- +
- + /* One way or another, this will enable the line being updated. */
- + current_screen->enable[vpos] = 1;
- + current_screen->used[vpos] = new_screen->used[vpos];
- + current_screen->highlight[vpos] = new_screen->highlight[vpos];
- +
- + #else /* not FAST_DISPLAY */
- +
- /* ??? */
- if (! current_screen->enable[vpos])
- {
- ***************
- *** 1154,1159 ****
- --- 1224,1230 ----
- temp = new_screen->contents[vpos];
- new_screen->contents[vpos] = current_screen->contents[vpos];
- current_screen->contents[vpos] = temp;
- + #endif /* not FAST_DISPLAY */
- }
-
- count_blanks (str)
- ***************
- *** 1525,1530 ****
- --- 1596,1604 ----
- select (1, &waitchannels, 0, 0, &timeout);
- #endif /* HAVE_TIMEVAL */
- #endif /* not VMS */
- + #ifdef AMIGA
- + sleep_or_input(XINT(n));
- + #endif AMIGA
-
- immediate_quit = 0;
- #endif /* no subprocesses */
- ***************
- *** 1552,1559 ****
- --- 1626,1643 ----
- cursor_in_echo_area = 0;
- terminal_type = (char *) 0;
-
- + #ifdef AMIGA
- + amiga_term_open();
- + #endif
- if (!inhibit_window_system)
- {
- + #ifdef AMIGA
- + amiga_term_init();
- + /* Using Intuition V2.04 */
- + Vwindow_system = intern ("intuition");
- + Vwindow_system_version = make_number (2);
- + goto term_init_done;
- + #endif /* AMIGA */
- #ifdef HAVE_X_WINDOWS
- extern char *alternate_display;
- char *disp = (char *) egetenv ("DISPLAY");
- *** emacs-18.58/src/callint.c 1992/02/21 11:18:24
- --- GNUEMACS:src/callint.c 1992/03/01 11:35:25
- ***************
- *** 120,126 ****
- --- 120,130 ----
- return exp;
- }
-
- + #ifdef AMIGA_DUMP
- + char *far callint_argfuns[]
- + #else
- char *callint_argfuns[]
- + #endif
- = {"", "point", "mark", "region-beginning", "region-end"};
-
- static void
- *** emacs-18.58/src/lisp.h 1992/02/21 11:20:30
- --- GNUEMACS:src/lisp.h 1992/05/13 23:07:01
- ***************
- *** 287,293 ****
- (XUINT (a) | (XUINT (a) > PURESIZE ? DATA_SEG_BITS : PURE_SEG_BITS))
- #else /* not HAVE_SHM */
- #ifdef DATA_SEG_BITS
- ! /* This case is used for the rt-pc.
- In the diffs I was given, it checked for ptr = 0
- and did not adjust it in that case.
- But I don't think that zero should ever be found
- --- 287,293 ----
- (XUINT (a) | (XUINT (a) > PURESIZE ? DATA_SEG_BITS : PURE_SEG_BITS))
- #else /* not HAVE_SHM */
- #ifdef DATA_SEG_BITS
- ! /* This case is used for the rt-pc and the Amiga.
- In the diffs I was given, it checked for ptr = 0
- and did not adjust it in that case.
- But I don't think that zero should ever be found
- ***************
- *** 520,525 ****
- --- 520,532 ----
- { if (XTYPE ((x)) == Lisp_Marker) XFASTINT (x) = marker_position (x); \
- else if (XTYPE ((x)) != Lisp_Int) x = wrong_type_argument (Qinteger_or_marker_p, (x)); }
-
- + #ifdef AMIGA_DUMP
- + #define CHECK_IMPURE(obj) \
- + { extern int *pure, puresize; \
- + if ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + puresize) \
- + && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure) \
- + pure_write_error (); }
- + #else /* not AMIGA_DUMP */
- #ifdef VIRT_ADDR_VARIES
-
- /* For machines like APOLLO where text and data can go anywhere
- ***************
- *** 529,535 ****
- if ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + PURESIZE) \
- && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure) \
- pure_write_error (); }
- -
- #else /* not VIRT_ADDR_VARIES */
- #ifdef PNTR_COMPARISON_TYPE
-
- --- 536,541 ----
- ***************
- *** 548,553 ****
- --- 554,560 ----
-
- #endif /* PNTR_COMPARISON_TYPE */
- #endif /* VIRT_ADDRESS_VARIES */
- + #endif /* not AMIGA_DUMP */
-
- /* Cast pointers to this type to compare them. Some machines want int. */
- #ifndef PNTR_COMPARISON_TYPE
- *** emacs-18.58/src/dired.c 1992/02/21 11:18:24
- --- GNUEMACS:src/dired.c 1992/02/23 10:28:04
- ***************
- *** 384,390 ****
- --- 384,394 ----
-
- bcopy (XSTRING (dirname)->data, fullname, pos);
- #ifndef VMS
- + #ifdef AMIGA
- + if ((fullname[pos - 1] != '/')&&(fullname[pos - 1] != ':'))
- + #else
- if (fullname[pos - 1] != '/')
- + #endif
- fullname[pos++] = '/';
- #endif
-
- *** emacs-18.58/src/term.c 1992/02/21 11:21:03
- --- GNUEMACS:src/term.c 1992/03/01 11:35:25
- ***************
- *** 161,167 ****
- --- 161,171 ----
- or'd with 0100. Zero if no standout marker at all. */
- /* used iff TN_standout_width >= 0. */
- char *chars_wasted;
- + #ifdef AMIGA_DUMP
- + char *copybuf;
- + #else
- static char *copybuf;
- + #endif
-
- /* nonzero means supposed to write text in standout mode. */
- int standout_requested;
- *** emacs-18.58/src/indent.c 1992/02/21 11:18:24
- --- GNUEMACS:src/indent.c 1992/03/01 11:35:25
- ***************
- *** 35,40 ****
- --- 35,45 ----
- #define min(a, b) ((a) < (b) ? (a) : (b))
- #define max(a, b) ((a) > (b) ? (a) : (b))
-
- + #ifdef EIGHT_BIT
- + /* Visible characters */
- + extern char visible[];
- + #endif
- +
- /* These three values memoize the current column to avoid recalculation */
- /* Some things in set last_known_column_point to -1
- to mark the memoized value as invalid */
- ***************
- *** 115,121 ****
- --- 120,130 ----
- }
-
- c = *--ptr;
- + #ifdef EIGHT_BIT
- + if (visible[c])
- + #else
- if (c >= 040 && c < 0177)
- + #endif
- {
- col++;
- }
- ***************
- *** 326,332 ****
- --- 335,345 ----
- }
- else if (ctl_arrow && (c < 040 || c == 0177))
- col++;
- + #ifdef EIGHT_BIT
- + else if (!visible[c])
- + #else
- else if (c < 040 || c >= 0177)
- + #endif
- col += 3;
- }
-
- ***************
- *** 373,381 ****
- --- 386,447 ----
- prev_hpos = hpos;
-
- c = FETCH_CHAR (pos);
- + #ifdef EIGHT_BIT
- + if (visible[c])
- + #else
- if (c >= 040 && c < 0177)
- + #endif
- + #ifdef FAST_DISPLAY
- + {
- + unsigned char *p;
- + int gap_pos;
- + int maxhpos;
- +
- + if (vpos == tovpos)
- + {
- + maxhpos = tohpos;
- + if (maxhpos > width) maxhpos = width;
- + }
- + else maxhpos = width;
- +
- + if (pos < GPT)
- + {
- + gap_pos = GPT;
- + p = BEG_ADDR + pos;
- + }
- + else
- + {
- + gap_pos = -1;
- + p = GAP_SIZE + BEG_ADDR + pos;
- + }
- + do
- + {
- + hpos++;
- + if (hpos >= maxhpos)
- + {
- + prev_hpos = hpos - 1;
- + if (hpos >= width) goto check_hpos;
- + /* We've reached the target pos */
- + pos++;
- + goto done;
- + }
- + pos++;
- + if (pos >= to)
- + {
- + prev_hpos = hpos - 1;
- + goto done;
- + }
- + if (gap_pos == pos) p += GAP_SIZE;
- + c = *p++;
- + }
- + while (visible[c]);
- + prev_hpos = hpos;
- + }
- + if (c == '\t')
- + #else /* not FAST_DISPLAY */
- hpos++;
- else if (c == '\t')
- + #endif /* not FAST_DISPLAY */
- {
- hpos += tab_width - ((hpos + tab_offset + hscroll - (hscroll > 0)
- /* Add tab_width here to make sure positive.
- ***************
- *** 431,436 ****
- --- 497,505 ----
- else
- hpos += (ctl_arrow && c < 0200) ? 2 : 4;
-
- + #ifdef FAST_DISPLAY
- + check_hpos:
- + #endif
- /* Handle right margin. */
- if (hpos >= width
- && (hpos > width
- ***************
- *** 459,464 ****
- --- 528,536 ----
-
- }
- }
- + #ifdef FAST_DISPLAY
- + done:
- + #endif
-
- val_compute_motion.bufpos = pos;
- val_compute_motion.hpos = hpos;
- *** emacs-18.58/src/doc.c 1992/02/21 11:18:24
- --- GNUEMACS:src/doc.c 1992/02/23 10:28:48
- ***************
- *** 188,194 ****
- --- 188,198 ----
-
- #ifndef CANNOT_DUMP
- name = (char *) alloca (XSTRING (filename)->size + 8);
- + #ifdef AMIGA
- + strcpy (name, "/etc/");
- + #else
- strcpy (name, "../etc/");
- + #endif
- #else /* CANNOT_DUMP */
- CHECK_STRING (Vexec_directory, 0);
- name = (char *) alloca (XSTRING (filename)->size +
- *** emacs-18.58/src/filemode.c 1992/02/21 11:18:24
- --- GNUEMACS:src/filemode.c 1992/02/23 10:30:44
- ***************
- *** 70,75 ****
- --- 70,89 ----
-
- #define VOID void
-
- + #ifdef AMIGA
- + VOID
- + filemodestring (s,a)
- + struct stat *s;
- + char *a;
- + {
- + a[0] = s->st_mode & S_IFDIR ? 'd' : '-';
- + a[7] = a[4] = a[1] = s->st_mode & S_IREAD ? 'r' : '-';
- + a[8] = a[5] = a[2] = s->st_mode & S_IREAD ? 'w' : '-';
- + a[9] = a[6] = a[3] = s->st_mode & S_IREAD ? 'x' : '-';
- + }
- +
- + #else /* not AMIGA */
- +
- static char ftypelet ();
- static VOID rwx (), setst ();
-
- ***************
- *** 193,195 ****
- --- 207,210 ----
- chars[9] = 't';
- #endif
- }
- + #endif /* not AMIGA */
- *** emacs-18.58/src/tparam.c 1992/02/21 11:21:03
- --- GNUEMACS:src/tparam.c 1992/05/13 23:07:01
- ***************
- *** 258,264 ****
- return outstring;
- }
-
- ! #ifdef DEBUG
-
- main (argc, argv)
- int argc;
- --- 258,264 ----
- return outstring;
- }
-
- ! #ifdef TPARAM_DEBUG
-
- main (argc, argv)
- int argc;
- ***************
- *** 274,277 ****
- return 0;
- }
-
- ! #endif /* DEBUG */
- --- 274,277 ----
- return 0;
- }
-
- ! #endif /* TPARAM_DEBUG */
- *** emacs-18.58/src/xdisp.c 1992/02/21 11:21:03
- --- GNUEMACS:src/xdisp.c 1992/04/19 10:42:36
- ***************
- *** 31,36 ****
- --- 31,49 ----
- #include "commands.h"
- #include "macros.h"
-
- + #ifdef FAST_DISPLAY
- + #define MAX_WIN_LINE 64
- + static int win_line_bufpos[MAX_WIN_LINE];
- + static int win_line_modified;
- + static struct buffer *win_line_buffer;
- + #define CLEAR_WIN_LINE() (win_line_buffer = 0)
- + #endif
- +
- + #ifdef EIGHT_BIT
- + char visible[256]; /* visible[i] is true if character i is
- + displayable */
- + #endif
- +
- extern int interrupt_input;
- extern int command_loop_level;
-
- ***************
- *** 263,269 ****
- --- 276,289 ----
- windows_or_buffers_changed++;
-
- if (EQ (minibuf_window, selected_window))
- + #ifdef FAST_DISPLAY
- + {
- + this_line_bufpos = 0;
- + CLEAR_WIN_LINE();
- + }
- + #else
- this_line_bufpos = 0;
- + #endif
-
- prev_echo_area_contents = echo_area_contents;
- }
- ***************
- *** 315,320 ****
- --- 335,344 ----
- must_finish = 1;
- }
-
- + #ifdef FAST_DISPLAY
- + if (windows_or_buffers_changed) CLEAR_WIN_LINE();
- + #endif
- +
- if (clip_changed || windows_or_buffers_changed)
- update_mode_lines++;
-
- ***************
- *** 441,446 ****
- --- 465,473 ----
- Also, don't forget to check every line to update the arrow. */
- if (pause)
- {
- + #ifdef FAST_DISPLAY
- + CLEAR_WIN_LINE();
- + #endif
- this_line_bufpos = 0;
- if (!NULL (last_arrow_position))
- {
- ***************
- *** 693,701 ****
- --- 720,754 ----
- && (just_this_one || XFASTINT (w->width) == screen_width)
- && !EQ (window, minibuf_window))
- {
- + #ifdef FAST_DISPLAY
- + int *wlb;
- + int line, best_startp, best_vpos;
- +
- + best_startp = startp; best_vpos = 0;
- + if (win_line_buffer && BUF_MODIFF(win_line_buffer) > win_line_modified)
- + CLEAR_WIN_LINE();
- + if (current_buffer == win_line_buffer && current_buffer == XBUFFER (w->buffer))
- + {
- + /* Try & find line to start from */
- + wlb = win_line_bufpos; line = 0;
- + while (line < MAX_WIN_LINE)
- + {
- + if (*wlb && point > *wlb && *wlb > best_startp)
- + {
- + best_startp = *wlb;
- + best_vpos = line;
- + }
- + line++; wlb++;
- + }
- + }
- + pos = *compute_motion (best_startp, best_vpos, (hscroll ? 1 - hscroll : 0),
- + point, height + 1, 10000, width, hscroll,
- + pos_tab_offset (w, startp));
- + #else /* not FAST_DISPLAY */
- pos = *compute_motion (startp, 0, (hscroll ? 1 - hscroll : 0),
- point, height + 1, 10000, width, hscroll,
- pos_tab_offset (w, startp));
- + #endif /* not FAST_DISPLAY */
-
- if (pos.vpos < height)
- {
- ***************
- *** 827,832 ****
- --- 880,889 ----
-
- struct position val;
-
- + #ifdef FAST_DISPLAY
- + if (XBUFFER(w->buffer) == win_line_buffer) CLEAR_WIN_LINE();
- + #endif
- +
- Fset_marker (w->start, make_number (pos), Qnil);
-
- point_vpos = -1;
- ***************
- *** 890,895 ****
- --- 947,956 ----
- int delta;
- int tab_offset, epto;
-
- + #ifdef FAST_DISPLAY
- + if (XBUFFER(w->buffer) == win_line_buffer) CLEAR_WIN_LINE();
- + #endif
- +
- if (GPT - BEG < beg_unchanged)
- beg_unchanged = GPT - BEG;
- if (Z - GPT < end_unchanged)
- ***************
- *** 1260,1266 ****
- --- 1321,1332 ----
- int end;
- register int pause;
- register unsigned char *p;
- + #ifdef FAST_DISPLAY
- + register long _endp;
- + #define endp ((char *)_endp)
- + #else
- unsigned char *endp;
- + #endif
- register unsigned char *startp;
- register unsigned char *p1prev;
- int tab_width = XINT (current_buffer->tab_width);
- ***************
- *** 1299,1305 ****
- --- 1365,1375 ----
- end = ZV;
-
- startp = new_screen->contents[vpos] + XFASTINT (w->left);
- + #ifdef FAST_DISPLAY
- + _endp = (long)startp + width;
- + #else
- endp = startp + width;
- + #endif
-
- /* Loop generating characters.
- Stop at end of buffer, before newline,
- ***************
- *** 1308,1313 ****
- --- 1378,1386 ----
- pause = pos;
- while (p1 < endp)
- {
- + #ifdef FAST_DISPLAY
- + restart:
- + #endif
- p1prev = p1;
- if (pos == pause)
- {
- ***************
- *** 1328,1334 ****
- --- 1401,1446 ----
- p = &FETCH_CHAR (pos);
- }
- c = *p++;
- + #ifdef EIGHT_BIT
- + if (visible[c])
- + #else
- if (c >= 040 && c < 0177)
- + #endif
- + #ifdef FAST_DISPLAY
- + /* This optimises the frequent part (displayable characters) of
- + this inner loop. If the conditions aren't met, return to old
- + inner loop. */
- + {
- + if (p1 >= startp)
- + {
- + do
- + {
- + *p1++ = c;
- + pos++;
- + if (p1 >= endp)
- + {
- + p1prev = p1 - 1;
- + goto done;
- + }
- + if (pos == pause) goto restart;
- + c = *p++;
- + }
- + #ifdef EIGHT_BIT
- + while (visible[c]);
- + #else
- + while (c >= 040 && c < 0177);
- + #endif
- + p1prev = p1;
- + }
- + else
- + {
- + p1++;
- + pos++;
- + goto restart;
- + }
- + }
- + if (c == '\n')
- + #else /* not FAST_DISPLAY */
- {
- if (p1 >= startp)
- *p1 = c;
- ***************
- *** 1335,1340 ****
- --- 1447,1453 ----
- p1++;
- }
- else if (c == '\n')
- + #endif
- {
- invis = 0;
- while (pos < end
- ***************
- *** 1408,1413 ****
- --- 1521,1529 ----
- }
- pos++;
- }
- + #ifdef FAST_DISPLAY
- + done:
- + #endif
-
- val.hpos = - XINT (w->hscroll);
- if (val.hpos)
- ***************
- *** 1495,1500 ****
- --- 1611,1637 ----
- this_line_bufpos = 0;
- }
- }
- + #ifdef FAST_DISPLAY
- + /* Save positions of all lines of current window */
- + if (w == XWINDOW(selected_window) && vpos < MAX_WIN_LINE)
- + {
- + /* Line is not continued and did not start in middle of character */
- + if (hpos == (XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0)
- + && val.vpos)
- + {
- + if (current_buffer != win_line_buffer ||
- + !(win_line_modified >= MODIFF))
- + {
- + win_line_buffer = current_buffer;
- + win_line_modified = MODIFF;
- + bzero(win_line_bufpos, sizeof win_line_bufpos);
- + }
- + win_line_bufpos[vpos - XINT (w->top)] = start;
- + }
- + else
- + win_line_bufpos[vpos - XINT (w->top)] = 0;
- + }
- + #endif /* FAST_DISPLAY */
-
- /* If hscroll and line not empty, insert truncation-at-left marker */
- if (hscroll && lastpos != start)
- ***************
- *** 1506,1512 ****
- --- 1643,1653 ----
-
- if (XFASTINT (w->width) + XFASTINT (w->left) != screen_width)
- {
- + #ifdef FAST_DISPLAY
- + _endp++;
- + #else
- endp++;
- + #endif
- if (p1 < startp) p1 = startp;
- while (p1 < endp) *p1++ = ' ';
- *p1++ = '|';
- ***************
- *** 1535,1540 ****
- --- 1676,1684 ----
- val.bufpos = pos;
- val_display_text_line = val;
- return &val_display_text_line;
- + #ifdef FAST_DISPLAY
- + #undef endp
- + #endif
- }
-
- /* Display the mode line for window w */
- ***************
- *** 1960,1966 ****
- --- 2104,2114 ----
- {
- c = *string++;
- if (!c) break;
- + #ifdef EIGHT_BIT
- + if (visible[c])
- + #else
- if (c >= 040 && c < 0177)
- + #endif
- {
- if (p1 >= start)
- *p1 = c;
- ***************
- *** 2075,2081 ****
- --- 2223,2235 ----
- register
- #endif COMPILER_REGISTER_BUG
- struct window *mini_w;
- + #ifdef EIGHT_BIT
- + int i;
- + #endif
-
- + #ifdef FAST_DISPLAY
- + CLEAR_WIN_LINE();
- + #endif
- this_line_bufpos = 0;
-
- mini_w = XWINDOW (minibuf_window);
- ***************
- *** 2094,2097 ****
- --- 2248,2257 ----
- XFASTINT (XWINDOW (root_window)->width) = screen_width;
- XFASTINT (mini_w->width) = screen_width;
- }
- + #ifdef EIGHT_BIT
- + for (i = 040; i < 0177; i++) visible[i] = 1;
- + #ifdef AMIGA
- + for (i = 0240; i <= 0377; i++) visible[i] = 1;
- + #endif
- + #endif
- }
- *** emacs-18.58/src/keyboard.c 1992/02/21 11:18:24
- --- GNUEMACS:src/keyboard.c 1992/05/02 17:35:08
- ***************
- *** 1151,1156 ****
- --- 1151,1167 ----
- #endif /* not SIGIO */
- #endif /* subprocesses */
-
- + #ifdef AMIGA
- + set_waiting_for_input (0);
- + amiga_consume_input(this_command_key_count == 0);
- + if (!kbd_count)
- + {
- + amiga_wait_for_input();
- + amiga_consume_input(this_command_key_count == 0);
- + }
- + clear_waiting_for_input ();
- + #endif /* AMIGA */
- +
- if (!interrupt_input && !kbd_count)
- {
- read_avail_input (0);
- ***************
- *** 1254,1259 ****
- --- 1265,1275 ----
- read_avail_input (nread)
- int nread;
- {
- + #ifdef AMIGA /* This is where the input work finally gets done */
- + /* Note, The nread != 0 case isn't handled as it doesn't arise on the Amiga.
- + (Look carefully at calls to read_avail_input) */
- + amiga_consume_input(FALSE);
- + #else /* AMIGA */
- /* This function is not used on VMS. */
- #ifndef VMS
- char buf[256 * BUFFER_SIZE_FACTOR];
- ***************
- *** 1328,1333 ****
- --- 1344,1350 ----
- break;
- }
- #endif /* not VMS */
- + #endif /* not AMIGA */
- }
-
- #ifdef SIGIO /* for entire page */
- ***************
- *** 1576,1581 ****
- --- 1593,1605 ----
- nextlocal = Qnil;
- nextglobal = Qnil;
-
- + #ifdef AMIGA
- + /* Gross hack so that C-\ sequences are always handled, even in local
- + modes that redefine C-\ (like View).
- + This is necessary because some sequences (like C-\ A, ARexx event)
- + must always be dealt with. */
- + if (c == '\034') local = Qnil;
- + #endif
- read_key_sequence_cmd = !NULL (local) ? local : global;
-
- /* trace symbols to their function definitions */
- *** emacs-18.58/src/alloca.c 1992/02/21 11:18:24
- --- GNUEMACS:src/alloca.c 1992/03/01 11:35:25
- ***************
- *** 72,78 ****
- #define STACK_DIRECTION 0 /* direction unknown */
- #endif
-
- ! #if STACK_DIRECTION != 0
-
- #define STACK_DIR STACK_DIRECTION /* known at compile-time */
-
- --- 72,78 ----
- #define STACK_DIRECTION 0 /* direction unknown */
- #endif
-
- ! #if (STACK_DIRECTION) != 0
-
- #define STACK_DIR STACK_DIRECTION /* known at compile-time */
-
- ***************
- *** 143,148 ****
- --- 143,151 ----
- {
- auto char probe; /* probes stack depth: */
- register char *depth = &probe;
- + #ifdef AMIGA_DUMP
- + extern int alloca_calling;
- + #endif
-
- #if STACK_DIRECTION == 0
- if (STACK_DIR == 0) /* unknown growth direction */
- ***************
- *** 176,185 ****
- --- 179,194 ----
-
- /* Allocate combined header + user data storage. */
-
- + #ifdef AMIGA_DUMP
- + alloca_calling = 1;
- + #endif
- {
- register pointer new = xmalloc (sizeof (header) + size);
- /* address of header */
-
- + #ifdef AMIGA_DUMP
- + alloca_calling = 0;
- + #endif
- ((header *)new)->h.next = last_alloca_header;
- ((header *)new)->h.deep = depth;
-
- *** emacs-18.58/src/callproc.c 1992/02/21 11:18:24
- --- GNUEMACS:src/callproc.c 1992/04/29 21:39:06
- ***************
- *** 126,132 ****
- --- 126,136 ----
- #ifdef VMS
- args[1] = build_string ("NLA0:");
- #else
- + #ifdef AMIGA
- + args[1] = build_string ("NIL:");
- + #else
- args[1] = build_string ("/dev/null");
- + #ednif /* not AMIGA */
- #endif /* not VMS */
- else
- args[1] = Fexpand_file_name (args[1], current_buffer->directory);
- ***************
- *** 178,184 ****
- --- 182,192 ----
- #ifdef VMS
- fd[1] = open ("NLA0:", 0), fd[0] = -1;
- #else
- + #ifdef AMIGA
- + fd[1] = open ("NIL:", O_WRONLY), fd[0] = -1;
- + #else
- fd[1] = open ("/dev/null", O_WRONLY), fd[0] = -1;
- + #endif /* not AMIGA */
- #endif /* not VMS */
- else
- {
- ***************
- *** 192,197 ****
- --- 200,221 ----
- synch_process_death = 0;
- synch_process_retcode = 0;
-
- + #ifdef AMIGA
- + {
- + register unsigned char *temp;
- +
- + if (XTYPE (current_buffer->directory) == Lisp_String)
- + {
- + register int i;
- +
- + i = XSTRING (current_buffer->directory)->size;
- + temp = (unsigned char *) alloca (i + 1);
- + bcopy (XSTRING (current_buffer->directory)->data, temp, i);
- + temp[i] = 0;
- + }
- + pid = exec(new_argv[0], new_argv, filefd, fd[1], temp);
- + }
- + #else
- {
- /* child_setup must clobber environ in systems with true vfork.
- Protect it from permanent change. */
- ***************
- *** 229,234 ****
- --- 253,259 ----
- close (filefd);
- close (fd1);
- }
- + #endif /* not AMIGA */
-
- if (pid < 0)
- {
- ***************
- *** 300,306 ****
- --- 325,335 ----
- register Lisp_Object filename_string, start, end;
- char tempfile[20];
-
- + #ifdef AMIGA
- + strcpy (tempfile, "t:emacsXXXXXX");
- + #else
- strcpy (tempfile, "/tmp/emacsXXXXXX");
- + #endif
- mktemp (tempfile);
-
- filename_string = build_string (tempfile);
- ***************
- *** 316,321 ****
- --- 345,351 ----
- unlink (tempfile);
- return Qnil;
- }
- + #ifndef AMIGA
-
- /* This is the last thing run in a newly forked inferior
- either synchronous or asynchronous.
- ***************
- *** 423,428 ****
- --- 453,459 ----
- write (1, new_argv[0], strlen (new_argv[0]));
- _exit (1);
- }
- + #endif /* not AMIGA */
-
- init_callproc ()
- {
- ***************
- *** 435,440 ****
- --- 466,479 ----
- Vexec_path = decode_env_path (0, PATH_EXEC);
- Vexec_directory = Ffile_name_as_directory (Fcar (Vexec_path));
- Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
- + #ifdef AMIGA
- + {
- + char *amiga_path(), *apath = amiga_path();
- +
- + Vexec_path = nconc2 (decode_env_path (0, apath), Vexec_path);
- + free(apath);
- + }
- + #endif
-
- execdir = Fdirectory_file_name (Vexec_directory);
- if (access (XSTRING (execdir)->data, 0) < 0)
- ***************
- *** 445,451 ****
- --- 484,494 ----
- }
-
- sh = (char *) egetenv ("SHELL");
- + #ifdef AMIGA
- + Vshell_file_name = build_string (sh ? sh : "GNUEmacs:etc/sh");
- + #else
- Vshell_file_name = build_string (sh ? sh : "/bin/sh");
- + #endif
-
- #ifndef MAINTAIN_ENVIRONMENT
- /* The equivalent of this operation was done
- *** emacs-18.58/src/buffer.c 1992/02/21 11:18:24
- --- GNUEMACS:src/buffer.c 1992/02/23 10:26:24
- ***************
- *** 1140,1146 ****
- #ifndef VMS
- /* Maybe this should really use some standard subroutine
- whose definition is filename syntax dependent. */
- ! if (buf[strlen (buf) - 1] != '/')
- strcat (buf, "/");
- #endif /* not VMS */
- current_buffer->directory = build_string (buf);
- --- 1140,1150 ----
- #ifndef VMS
- /* Maybe this should really use some standard subroutine
- whose definition is filename syntax dependent. */
- ! if (buf[strlen (buf) - 1] != '/'
- ! #ifdef AMIGA
- ! && buf[strlen (buf) -1] != ':'
- ! #endif /*AMIGA */
- ! )
- strcat (buf, "/");
- #endif /* not VMS */
- current_buffer->directory = build_string (buf);
- *** emacs-18.58/src/keymap.c 1992/02/21 11:18:24
- --- GNUEMACS:src/keymap.c 1992/02/23 11:01:10
- ***************
- *** 29,34 ****
- --- 29,38 ----
-
- /* Actually allocate storage for these variables */
-
- + #ifdef AMIGA
- + #define HAVE_X_WINDOWS /* We want the mouse map too */
- + #endif
- +
- #ifdef HAVE_X_WINDOWS
- Lisp_Object MouseMap; /* Keymap for mouse commands */
- #endif /* HAVE_X_WINDOWS */
- *** emacs-18.58/src/fileio.c 1992/02/21 11:18:24
- --- GNUEMACS:src/fileio.c 1992/02/23 10:29:59
- ***************
- *** 147,152 ****
- --- 147,155 ----
- p = beg + XSTRING (file)->size;
-
- while (p != beg && p[-1] != '/'
- + #ifdef AMIGA
- + && p[-1] != ':'
- + #endif /* AMIGA */
- #ifdef VMS
- && p[-1] != ':' && p[-1] != ']' && p[-1] != '>'
- #endif /* VMS */
- ***************
- *** 174,179 ****
- --- 177,185 ----
- end = p = beg + XSTRING (file)->size;
-
- while (p != beg && p[-1] != '/'
- + #ifdef AMIGA
- + && p[-1] != ':'
- + #endif /* AMIGA */
- #ifdef VMS
- && p[-1] != ':' && p[-1] != ']' && p[-1] != '>'
- #endif /* VMS */
- ***************
- *** 248,256 ****
- --- 254,268 ----
- out[size] = '\0';
- }
- #else /* not VMS */
- + #ifdef AMIGA
- + /* AmigaDOS syntax, append slash if the last char isn't a ':' or '/' */
- + if (out[size] != '/' && out[size] != ':' && size != 0)
- + strcat (out, "/");
- + #else /* not AMIGA */
- /* For Unix syntax, Append a slash if necessary */
- if (out[size] != '/')
- strcat (out, "/");
- + #endif /* not AMIGA */
- #endif /* not VMS */
- return out;
- }
- ***************
- *** 462,467 ****
- --- 474,578 ----
- (name, defalt)
- Lisp_Object name, defalt;
- {
- + #ifdef AMIGA
- + unsigned char *nm, *tilde, *newdir, *colon, *t_pos, *target;
- +
- + CHECK_STRING (name, 0);
- +
- + nm = XSTRING (name)->data;
- + /* Find base directory */
- + if (NULL (defalt))
- + defalt = current_buffer->directory;
- + CHECK_STRING (defalt, 1);
- + newdir = XSTRING (defalt)->data;
- +
- + /* Concat newdir w/ nm and canonicalize */
- + /* newdir always contains at least the device name.
- + It is assumed canonical */
- + target = (unsigned char *)alloca(strlen(nm) + strlen(newdir) + 2);
- + file_name_as_directory (target, newdir);
- + t_pos = target + strlen(target);
- +
- + while (*nm)
- + {
- + unsigned char *comp_end = nm;
- + int comp_len;
- +
- + /* Find next component of path (everything upto the next /) */
- + do comp_end++; while (comp_end[0] && comp_end[-1] != '/' && comp_end[-1] != ':');
- + comp_len = comp_end - nm;
- +
- + if (comp_len == 1 && nm[0] == '/' ||
- + nm[0] == '.' && nm[1] == '.' &&
- + (comp_len == 2 || comp_len == 3 && nm[2] == '/'))
- + {
- + /* Previous directory */
- + if (t_pos > target && t_pos[-1] != ':')
- + {
- + t_pos--; /* Back up over / */
- + while (t_pos > target &&
- + t_pos[-1] != ':' && t_pos[-1] != '/') t_pos--;
- + }
- + }
- + else if (comp_len == 2 && nm[0] == '.' && nm[1] == '/' ||
- + comp_len == 1 && nm[0] == '.') ; /* Ignore . */
- + else if (nm[0] == ':') /* Just keep disk name */
- + {
- + char *new_pos;
- +
- + *t_pos = 0; /* Limit search for : */
- + t_pos = index(target, ':');
- + if (t_pos) t_pos++;
- + else t_pos = target;
- + }
- + else if (nm[0] == '~' || index(nm, ':'))
- + {
- + char *exp_name;
- +
- + if (nm[0] == '~')
- + if (nm[1] == '/' || nm[1] == 0) /* Home directory */
- + {
- + newdir = (unsigned char *) egetenv ("HOME");
- + if (!newdir) newdir = (unsigned char *) "s:";
- + }
- + else
- + {
- + /* Handle ~ followed by user name. */
- + char lastc = nm[comp_len - 1];
- + int len = comp_len - 1;
- +
- + if (lastc == ':' || lastc == '/') len--;
- +
- + /* ~name becomes name: */
- + newdir = (unsigned char *) alloca (len + 2);
- + bcopy((char *) nm + 1, newdir, len);
- + newdir[len] = ':';
- + newdir[len + 1] = 0;
- + }
- + else /* we have name: */
- + {
- + newdir = (char *)alloca(comp_len + 1);
- + bcopy(nm, newdir, comp_len);
- + newdir[comp_len] = 0;
- + }
- + exp_name = (char *)alloca(1024);
- + if (expand_path(newdir, exp_name, 1024))
- + if (strncmp(exp_name, "Tao:", 4) != 0) /* Hack for WShell PATH: */
- + newdir = exp_name;
- + target = (unsigned char *)alloca(strlen(nm) + strlen(newdir) + 2);
- + file_name_as_directory (target, newdir);
- + t_pos = target + strlen(target);
- + }
- + else /* Copy component */
- + {
- + bcopy(nm, t_pos, comp_len);
- + t_pos += comp_len;
- + }
- +
- + nm = comp_end;
- + }
- + return make_string (target, t_pos - target);
- + #else /* not AMIGA */
- unsigned char *nm;
-
- register unsigned char *newdir, *p, *o;
- ***************
- *** 793,798 ****
- --- 904,910 ----
- }
-
- return make_string (target, o - target);
- + #endif /* not AMIGA */
- }
-
- DEFUN ("substitute-in-file-name", Fsubstitute_in_file_name,
- ***************
- *** 823,828 ****
- --- 935,957 ----
-
- for (p = nm; p != endp; p++)
- {
- + #ifdef AMIGA
- + if (p[0] == '~' && p != nm && p[-1] == '/')
- + {
- + nm = p;
- + substituted = 1;
- + }
- + else if (p[0] == ':')
- + {
- + char *p2 = p;
- + while (p2 > nm && p2[-1] != ':' && p2[-1] != '/') p2--;
- + if (p2 != nm)
- + {
- + nm = p2;
- + substituted = 1;
- + }
- + }
- + #else /* not AMIGA */
- if ((p[0] == '~' ||
- #ifdef APOLLO
- /* // at start of file name is meaningful in Apollo system */
- ***************
- *** 843,848 ****
- --- 972,978 ----
- nm = p;
- substituted = 1;
- }
- + #endif /* not AMIGA */
- }
-
- #ifdef VMS
- ***************
- *** 1351,1356 ****
- --- 1481,1493 ----
-
- CHECK_STRING (filename, 0);
- ptr = XSTRING (filename)->data;
- + #ifdef AMIGA
- + /* An absolute filename has a non-leading ':' in it */
- + if (*ptr != ':')
- + while (*ptr)
- + if (*ptr++ == ':') return Qt;
- + return Qnil;
- + #else /* not AMIGA */
- if (*ptr == '/' || *ptr == '~'
- #ifdef VMS
- /* ??? This criterion is probably wrong for '<'. */
- ***************
- *** 1362,1367 ****
- --- 1499,1505 ----
- return Qt;
- else
- return Qnil;
- + #endif /* not AMIGA */
- }
-
- DEFUN ("file-exists-p", Ffile_exists_p, Sfile_exists_p, 1, 1, 0,
- ***************
- *** 1486,1492 ****
- --- 1624,1634 ----
-
- if (stat (XSTRING (abspath)->data, &st) < 0)
- return Qnil;
- + #ifdef AMIGA
- + return make_number (st.st_mode & ~S_IFMT);
- + #else
- return make_number (st.st_mode & 07777);
- + #endif
- }
-
- DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, 0,
- *** emacs-18.58/src/lread.c 1992/02/21 11:18:24
- --- GNUEMACS:src/lread.c 1992/03/01 11:35:25
- ***************
- *** 238,248 ****
- --- 238,252 ----
- Lisp_Object pathname;
- {
- register unsigned char *s = XSTRING (pathname)->data;
- + #ifdef AMIGA
- + return (*s && index(s + 1, ':')); /* Non-leading : */
- + #else
- return (*s == '~' || *s == '/'
- #ifdef VMS
- || index (s, ':')
- #endif /* VMS */
- );
- + #endif /* not AMIGA */
- }
-
- /* Search for a file whose name is STR, looking in directories
- ***************
- *** 557,563 ****
- --- 561,571 ----
- }
-
- static int read_buffer_size;
- + #ifdef AMIGA_DUMP
- + char *read_buffer;
- + #else
- static char *read_buffer;
- + #endif
-
- static Lisp_Object
- read1 (readcharfun)
- *** emacs-18.58/src/emacs.c 1992/02/21 11:18:24
- --- GNUEMACS:src/emacs.c 1992/05/16 21:25:46
- ***************
- *** 75,80 ****
- --- 75,84 ----
- #endif
- #endif
-
- + #ifdef AMIGA_DUMP
- + #define HAVE_SHM /* Simplifies the ifdefs */
- + #endif
- +
- #ifndef O_RDWR
- #define O_RDWR 2
- #endif
- ***************
- *** 220,225 ****
- --- 224,233 ----
- extern int errno;
- extern void malloc_warning ();
-
- + #ifdef AMIGA
- + amiga_early_init(&argc, &argv);
- + #endif
- +
- /* Map in shared memory, if we are using that. */
- #ifdef HAVE_SHM
- if (argc > 1 && !strcmp (argv[1], "-nl"))
- ***************
- *** 292,297 ****
- --- 300,319 ----
- xargc = argc;
- #endif
-
- + #ifdef AMIGA
- + /* Handle the -t switch, which specifies device & unit to use as terminal */
- + if (skip_args + 3 < argc && !strcmp (argv[skip_args + 1], "-t"))
- + {
- + extern char *far serial_device;
- + extern long serial_unit;
- +
- + skip_args += 3;
- + serial_device = argv[skip_args - 1];
- + serial_unit = atoi(argv[skip_args]);
- + fprintf (stderr, "Using %s (unit %d)\n", serial_device ,serial_unit);
- + inhibit_window_system = 1; /* -t => -nw */
- + }
- + #else /* not AMIGA */
- /* Handle the -t switch, which specifies filename to use as terminal */
- if (skip_args + 2 < argc && !strcmp (argv[skip_args + 1], "-t"))
- {
- ***************
- *** 305,310 ****
- --- 327,333 ----
- inhibit_window_system = 1; /* -t => -nw */
- #endif
- }
- + #endif /* not AMIGA */
- #ifdef HAVE_X_WINDOWS
- /* Handle the -d switch, which means use a different display for X */
- if (skip_args + 2 < argc && (!strcmp (argv[skip_args + 1], "-d") ||
- ***************
- *** 417,422 ****
- --- 440,448 ----
- init_window_once (); /* Init the window system */
- }
-
- + #ifdef AMIGA
- + init_amiga ();
- + #endif
- init_alloc ();
- #ifdef MAINTAIN_ENVIRONMENT
- init_environ ();
- ***************
- *** 686,692 ****
- --- 712,722 ----
- #ifdef VMS
- #define SEPCHAR ','
- #else
- + #ifdef AMIGA /* Can't use : on Amiga */
- + #define SEPCHAR ','
- + #else
- #define SEPCHAR ':'
- + #endif
- #endif
-
- Lisp_Object
- *** emacs-18.58/src/lastfile.c 1992/02/21 11:18:24
- --- GNUEMACS:src/lastfile.c 1992/05/13 23:07:01
- ***************
- *** 35,40 ****
- --- 35,49 ----
- coming from libraries.
- */
-
- + #ifdef AMIGA_DUMP
- + /* I need to find the end of initialised and unitialised data, as well as of
- + executable code.
- + */
- + int last_data = 1;
- + int last_bss;
- +
- + void last_function() { }
- + #else /* not AMIGA_DUMP */
- #ifdef VMS
- /* Prevent the file from being totally empty. */
- static dummy () {}
- ***************
- *** 41,43 ****
- --- 50,53 ----
- #endif
-
- char my_edata = 0;
- + #endif /* not AMIGA_DUMP */
- *** emacs-18.58/src/scroll.c 1992/02/21 11:21:03
- --- GNUEMACS:src/scroll.c 1992/05/16 21:25:46
- ***************
- *** 55,60 ****
- --- 55,61 ----
- int *ILncost;
- int *DLncost;
-
- + #ifdef FAST_DISPLAY
- scrolling_1 (window_size, unchanged_at_top, unchanged_at_bottom,
- draw_cost, old_hash, new_hash, free_at_end)
- int window_size, unchanged_at_top, unchanged_at_bottom;
- ***************
- *** 63,68 ****
- --- 64,127 ----
- int *new_hash;
- int free_at_end;
- {
- + int lines, i;
- + int window_end = unchanged_at_top + window_size;
- +
- + /* Rebase arrays at line 0 */
- + old_hash -= unchanged_at_top - 1;
- + new_hash -= unchanged_at_top - 1;
- + draw_cost -= unchanged_at_top - 1;
- +
- + /* We can't allow un-enabled lines to be scrolled (they are not redrawable).
- + Restrict window to the first set of contiguous enabled lines
- + (an enabled line has draw_cost[x] != INFINITY) */
- + for (i = unchanged_at_top; i < window_end && draw_cost[i] != INFINITY; i++) ;
- + /*unchanged_at_bottom += window_size - i;*/
- + /*window_size = i - unchanged_at_top;*/
- + window_end = i;
- +
- + if (lines = calc_scroll(old_hash, new_hash, unchanged_at_top, window_end))
- + scroll_screen_lines(unchanged_at_top, window_end - lines, lines);
- + else if (lines = calc_scroll(new_hash, old_hash, unchanged_at_top, window_end))
- + scroll_screen_lines(unchanged_at_top + lines, window_end, -lines);
- + }
- +
- + int calc_scroll(int *old_hash, int *new_hash, int from, int to)
- + /* For insert attempt, the parameters are correct.
- + For delete attempt, swap the old & new hash parameters
- + */
- + {
- + int try = from + 1, lines, i;
- + int hash1 = old_hash[from];
- +
- + do
- + {
- + if (hash1 == new_hash[try])
- + {
- + /* Check if other lines match too */
- + lines = try - from; /* Amount to insert */
- + for (i = try + 1; i < to; i++)
- + if (old_hash[i - lines] != new_hash[i]) break;
- + if (i == to) /* It works ! */
- + return lines;
- + }
- + try++;
- + }
- + while (try < to);
- +
- + return 0;
- + }
- +
- + #else /* not FAST_DISPLAY */
- +
- + scrolling_1 (window_size, unchanged_at_top, unchanged_at_bottom,
- + draw_cost, old_hash, new_hash, free_at_end)
- + int window_size, unchanged_at_top, unchanged_at_bottom;
- + int *draw_cost;
- + int *old_hash;
- + int *new_hash;
- + int free_at_end;
- + {
- struct matrix_elt *matrix;
- matrix = ((struct matrix_elt *)
- alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix));
- ***************
- *** 320,325 ****
- --- 379,385 ----
- if (window)
- set_terminal_window (0);
- }
- + #endif /* not FAST_DISPLAY */
-
- /* Return number of lines in common between current screen contents
- and the text to be displayed,
-