home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / text / emacsdif.lha / emacs-18.58 / src-diffs < prev   
Encoding:
C/C++ Source or Header  |  1992-05-17  |  40.3 KB  |  1,647 lines

  1. *** emacs-18.58/src/termcap.c    1992/02/21 11:21:03
  2. --- GNUEMACS:src/termcap.c    1992/02/23 11:07:09
  3. ***************
  4. *** 344,350 ****
  5. --- 344,354 ----
  6.   #ifdef VMS
  7.     filep = tem && legal_filename_p (tem);
  8.   #else
  9. + #ifdef AMIGA
  10. +   filep = tem != 0;            /* Always assume that it is a file */
  11. + #else
  12.     filep = tem && (*tem == '/');
  13. + #endif
  14.   #endif /* VMS */
  15.   
  16.     /* If tem is non-null and starts with / (in the un*x case, that is),
  17. ***************
  18. *** 377,383 ****
  19. --- 381,391 ----
  20.   #ifdef VMS
  21.       tem = "emacs_library:[etc]termcap.dat";
  22.   #else
  23. + #ifdef AMIGA
  24. +     tem = "s:termcap";
  25. + #else
  26.       tem = "/etc/termcap";
  27. + #endif
  28.   #endif
  29.   
  30.     /* Here we know we must search a file and tem has its name.  */
  31. *** emacs-18.58/src/alloc.c    1992/02/21 11:18:24
  32. --- GNUEMACS:src/alloc.c    1992/05/13 23:07:01
  33. ***************
  34. *** 76,81 ****
  35. --- 76,86 ----
  36.      Preallocated since perhaps we can't allocate it when memory is full.  */
  37.   Lisp_Object memory_exhausted_message;
  38.   
  39. + #ifdef AMIGA_DUMP
  40. + int *pure;   /* pure array is allocated at run-time */
  41. + int puresize = DEF_PURESIZE; /* and has a variable size */
  42. + #define PUREBEG (char *) pure
  43. + #else /* not AMIGA_DUMP */
  44.   #ifndef HAVE_SHM
  45.   #ifdef VMS
  46.   int pure[PURESIZE / sizeof (int)];    /*no need to initialize - wasted space*/
  47. ***************
  48. *** 87,92 ****
  49. --- 92,98 ----
  50.   #define pure PURE_SEG_BITS   /* Use shared memory segment */
  51.   #define PUREBEG (char *)PURE_SEG_BITS
  52.   #endif /* not HAVE_SHM */
  53. + #endif /* not AMIGA_DUMP */
  54.   
  55.   /* Index in pure at which next pure object will be allocated. */
  56.   int pureptr;
  57. ***************
  58. *** 727,734 ****
  59. --- 733,744 ----
  60.   #ifdef __GNUC__
  61.   Lisp_Object *staticvec[NSTATICS] = {0};
  62.   #else
  63. + #ifdef AMIGA_DUMP
  64. + Lisp_Object *staticvec[NSTATICS]; /* Doesn't need to be pure */
  65. + #else
  66.   char staticvec1[NSTATICS * sizeof (Lisp_Object *)] = {0};
  67.   #define staticvec ((Lisp_Object **) staticvec1)
  68. + #endif
  69.   #endif
  70.   
  71.   /* Put an entry in staticvec, pointing at the variable whose address is given */
  72. *** emacs-18.58/src/dispnew.c    1992/02/21 11:18:24
  73. --- GNUEMACS:src/dispnew.c    1992/05/16 21:25:46
  74. ***************
  75. *** 661,666 ****
  76. --- 661,680 ----
  77.     if (force_redisplay)
  78.       force = 1;
  79.   
  80. + #ifdef FAST_DISPLAY
  81. +   /* Don't compute for i/d line if just want cursor motion. */
  82. +   /* Don't allow preemption, etc either */
  83. +   for (i = 0; i < screen_height; i++)
  84. +     if (new_screen->enable[i])
  85. +       break;
  86. +   if (i >= screen_height)
  87. +     {
  88. +       update_begin();
  89. +       goto update_done;
  90. +     }
  91. + #endif
  92.     if (!force)
  93.       detect_input_pending ();
  94.     if (!force
  95. ***************
  96. *** 677,686 ****
  97.     if (!line_ins_del_ok)
  98.       inhibit_hairy_id = 1;
  99.   
  100.     /* Don't compute for i/d line if just want cursor motion. */
  101.     for (i = 0; i < screen_height; i++)
  102. !     if (new_screen->enable)
  103.         break;
  104.   
  105.     /* Try doing i/d line, if not yet inhibited.  */
  106.     if (!inhibit_hairy_id && i < screen_height)
  107. --- 691,702 ----
  108.     if (!line_ins_del_ok)
  109.       inhibit_hairy_id = 1;
  110.   
  111. + #ifndef FAST_DISPLAY
  112.     /* Don't compute for i/d line if just want cursor motion. */
  113.     for (i = 0; i < screen_height; i++)
  114. !     if (new_screen->enable[i])
  115.         break;
  116. + #endif
  117.   
  118.     /* Try doing i/d line, if not yet inhibited.  */
  119.     if (!inhibit_hairy_id && i < screen_height)
  120. ***************
  121. *** 724,729 ****
  122. --- 740,748 ----
  123.         update_line (i);
  124.       }
  125.       }
  126. + #ifdef FAST_DISPLAY
  127. + update_done:
  128. + #endif
  129.     pause = (i < screen_height - 1) ? i + 1 : 0;
  130.   
  131.     /* Now just clean up termcap drivers and set cursor, etc.  */
  132. ***************
  133. *** 876,881 ****
  134. --- 895,951 ----
  135.     else
  136.       reassert_line_highlight (new_screen->highlight[vpos], vpos);
  137.   
  138. + #ifdef FAST_DISPLAY
  139. +   if (current_screen->enable[vpos])
  140. +   {
  141. +       obody = current_screen->contents[vpos];
  142. +       olen = current_screen->used[vpos];
  143. +   }
  144. +   else olen = 0;
  145. +   nbody = new_screen->contents[vpos];
  146. +   nlen = new_screen->used[vpos];
  147. +   
  148. +   /* Pretend trailing spaces are not there at all,
  149. +      unless for one reason or another we must write all spaces.  */
  150. +   /* We know that the previous character byte contains 0.  */
  151. +   if (! new_screen->highlight[vpos])
  152. +   {
  153. +       if (!must_write_spaces)
  154. +       while (nbody[nlen - 1] == ' ')
  155. +           nlen--;
  156. +   }
  157. +   else
  158. +   {
  159. +       /* For an inverse-video line, give it extra trailing spaces
  160. +      all the way to the screen edge
  161. +      so that the reverse video extends all the way across.  */
  162. +       while (nlen < screen_width - 1)
  163. +       nbody[nlen++] = ' ';
  164. +   }
  165. +   
  166. +   while (olen > 0 && nlen > 0 && *obody == *nbody)
  167. +   {
  168. +       olen--; nlen--; obody++; nbody++;
  169. +   }
  170. +   if (olen > 0 || nlen > 0)
  171. +       move_cursor (vpos, nbody - new_screen->contents[vpos]);
  172. +   if (nlen > 0) output_chars (nbody, nlen);
  173. +   
  174. +   if (olen > nlen && new_screen->used[vpos] != screen_width)
  175. +       clear_end_of_line(current_screen->used[vpos]);
  176. +   /* Exchange contents between current_screen and new_screen.  */
  177. +   temp = new_screen->contents[vpos];
  178. +   new_screen->contents[vpos] = current_screen->contents[vpos];
  179. +   current_screen->contents[vpos] = temp;
  180. +   
  181. +   /* One way or another, this will enable the line being updated.  */
  182. +   current_screen->enable[vpos] = 1;
  183. +   current_screen->used[vpos] = new_screen->used[vpos];
  184. +   current_screen->highlight[vpos] = new_screen->highlight[vpos];
  185. + #else /* not FAST_DISPLAY */
  186.     /* ??? */
  187.     if (! current_screen->enable[vpos])
  188.       {
  189. ***************
  190. *** 1154,1159 ****
  191. --- 1224,1230 ----
  192.     temp = new_screen->contents[vpos];
  193.     new_screen->contents[vpos] = current_screen->contents[vpos];
  194.     current_screen->contents[vpos] = temp;
  195. + #endif /* not FAST_DISPLAY */
  196.   }
  197.   
  198.   count_blanks (str)
  199. ***************
  200. *** 1525,1530 ****
  201. --- 1596,1604 ----
  202.         select (1, &waitchannels, 0, 0, &timeout);
  203.   #endif                /* HAVE_TIMEVAL */
  204.   #endif                /* not VMS */
  205. + #ifdef    AMIGA
  206. +       sleep_or_input(XINT(n));
  207. + #endif    AMIGA
  208.   
  209.         immediate_quit = 0;
  210.   #endif                /* no subprocesses */
  211. ***************
  212. *** 1552,1559 ****
  213. --- 1626,1643 ----
  214.     cursor_in_echo_area = 0;
  215.     terminal_type = (char *) 0;
  216.   
  217. + #ifdef AMIGA
  218. +   amiga_term_open();
  219. + #endif
  220.     if (!inhibit_window_system)
  221.       {
  222. + #ifdef AMIGA
  223. +       amiga_term_init();
  224. +       /* Using Intuition V2.04 */
  225. +       Vwindow_system = intern ("intuition");
  226. +       Vwindow_system_version = make_number (2);
  227. +       goto term_init_done;
  228. + #endif /* AMIGA */
  229.   #ifdef HAVE_X_WINDOWS
  230.         extern char *alternate_display;
  231.         char *disp = (char *) egetenv ("DISPLAY");
  232. *** emacs-18.58/src/callint.c    1992/02/21 11:18:24
  233. --- GNUEMACS:src/callint.c    1992/03/01 11:35:25
  234. ***************
  235. *** 120,126 ****
  236. --- 120,130 ----
  237.     return exp;
  238.   }
  239.   
  240. + #ifdef AMIGA_DUMP
  241. + char *far callint_argfuns[]
  242. + #else
  243.   char *callint_argfuns[]
  244. + #endif
  245.       = {"", "point", "mark", "region-beginning", "region-end"};
  246.   
  247.   static void
  248. *** emacs-18.58/src/lisp.h    1992/02/21 11:20:30
  249. --- GNUEMACS:src/lisp.h    1992/05/13 23:07:01
  250. ***************
  251. *** 287,293 ****
  252.     (XUINT (a) | (XUINT (a) > PURESIZE ? DATA_SEG_BITS : PURE_SEG_BITS))
  253.   #else /* not HAVE_SHM */
  254.   #ifdef DATA_SEG_BITS
  255. ! /* This case is used for the rt-pc.
  256.      In the diffs I was given, it checked for ptr = 0
  257.      and did not adjust it in that case.
  258.      But I don't think that zero should ever be found
  259. --- 287,293 ----
  260.     (XUINT (a) | (XUINT (a) > PURESIZE ? DATA_SEG_BITS : PURE_SEG_BITS))
  261.   #else /* not HAVE_SHM */
  262.   #ifdef DATA_SEG_BITS
  263. ! /* This case is used for the rt-pc and the Amiga.
  264.      In the diffs I was given, it checked for ptr = 0
  265.      and did not adjust it in that case.
  266.      But I don't think that zero should ever be found
  267. ***************
  268. *** 520,525 ****
  269. --- 520,532 ----
  270.     { if (XTYPE ((x)) == Lisp_Marker) XFASTINT (x) = marker_position (x); \
  271.       else if (XTYPE ((x)) != Lisp_Int) x = wrong_type_argument (Qinteger_or_marker_p, (x)); }
  272.   
  273. + #ifdef AMIGA_DUMP
  274. + #define CHECK_IMPURE(obj) \
  275. +   { extern int *pure, puresize; \
  276. +     if ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + puresize) \
  277. +     && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure) \
  278. +       pure_write_error (); }
  279. + #else /* not AMIGA_DUMP */
  280.   #ifdef VIRT_ADDR_VARIES
  281.   
  282.   /* For machines like APOLLO where text and data can go anywhere
  283. ***************
  284. *** 529,535 ****
  285.       if ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + PURESIZE) \
  286.       && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure) \
  287.         pure_write_error (); }
  288.   #else /* not VIRT_ADDR_VARIES */
  289.   #ifdef PNTR_COMPARISON_TYPE
  290.   
  291. --- 536,541 ----
  292. ***************
  293. *** 548,553 ****
  294. --- 554,560 ----
  295.   
  296.   #endif /* PNTR_COMPARISON_TYPE */
  297.   #endif /* VIRT_ADDRESS_VARIES */
  298. + #endif /* not AMIGA_DUMP */
  299.   
  300.   /* Cast pointers to this type to compare them.  Some machines want int.  */
  301.   #ifndef PNTR_COMPARISON_TYPE
  302. *** emacs-18.58/src/dired.c    1992/02/21 11:18:24
  303. --- GNUEMACS:src/dired.c    1992/02/23 10:28:04
  304. ***************
  305. *** 384,390 ****
  306. --- 384,394 ----
  307.   
  308.     bcopy (XSTRING (dirname)->data, fullname, pos);
  309.   #ifndef VMS
  310. + #ifdef AMIGA
  311. +   if ((fullname[pos - 1] != '/')&&(fullname[pos - 1] != ':'))
  312. + #else
  313.     if (fullname[pos - 1] != '/')
  314. + #endif
  315.       fullname[pos++] = '/';
  316.   #endif
  317.   
  318. *** emacs-18.58/src/term.c    1992/02/21 11:21:03
  319. --- GNUEMACS:src/term.c    1992/03/01 11:35:25
  320. ***************
  321. *** 161,167 ****
  322. --- 161,171 ----
  323.      or'd with 0100.  Zero if no standout marker at all.  */
  324.   /* used iff TN_standout_width >= 0. */
  325.   char *chars_wasted;
  326. + #ifdef AMIGA_DUMP
  327. + char *copybuf;
  328. + #else
  329.   static char *copybuf;
  330. + #endif
  331.   
  332.   /* nonzero means supposed to write text in standout mode.  */
  333.   int standout_requested;
  334. *** emacs-18.58/src/indent.c    1992/02/21 11:18:24
  335. --- GNUEMACS:src/indent.c    1992/03/01 11:35:25
  336. ***************
  337. *** 35,40 ****
  338. --- 35,45 ----
  339.   #define min(a, b) ((a) < (b) ? (a) : (b))
  340.   #define max(a, b) ((a) > (b) ? (a) : (b))
  341.   
  342. + #ifdef EIGHT_BIT
  343. + /* Visible characters */
  344. + extern char visible[];
  345. + #endif
  346.   /* These three values memoize the current column to avoid recalculation */
  347.   /* Some things in set last_known_column_point to -1
  348.     to mark the memoized value as invalid */
  349. ***************
  350. *** 115,121 ****
  351. --- 120,130 ----
  352.       }
  353.   
  354.         c = *--ptr;
  355. + #ifdef EIGHT_BIT
  356. +       if (visible[c])
  357. + #else
  358.         if (c >= 040 && c < 0177)
  359. + #endif
  360.       {
  361.         col++;
  362.       }
  363. ***************
  364. *** 326,332 ****
  365. --- 335,345 ----
  366.       }
  367.         else if (ctl_arrow && (c < 040 || c == 0177))
  368.           col++;
  369. + #ifdef EIGHT_BIT
  370. +       else if (!visible[c])
  371. + #else
  372.         else if (c < 040 || c >= 0177)
  373. + #endif
  374.           col += 3;
  375.       }
  376.   
  377. ***************
  378. *** 373,381 ****
  379. --- 386,447 ----
  380.         prev_hpos = hpos;
  381.   
  382.         c = FETCH_CHAR (pos);
  383. + #ifdef EIGHT_BIT
  384. +       if (visible[c])
  385. + #else
  386.         if (c >= 040 && c < 0177)
  387. + #endif
  388. + #ifdef FAST_DISPLAY
  389. +         {
  390. +       unsigned char *p;
  391. +       int gap_pos;
  392. +       int maxhpos;
  393. +       if (vpos == tovpos)
  394. +         {
  395. +           maxhpos = tohpos;
  396. +           if (maxhpos > width) maxhpos = width;
  397. +         }
  398. +       else maxhpos = width;
  399. +       if (pos < GPT)
  400. +         {
  401. +           gap_pos = GPT;
  402. +           p = BEG_ADDR + pos;
  403. +         }
  404. +       else
  405. +         {
  406. +           gap_pos = -1;
  407. +           p = GAP_SIZE + BEG_ADDR + pos;
  408. +         }
  409. +       do
  410. +         {
  411. +           hpos++;
  412. +           if (hpos >= maxhpos)
  413. +           {
  414. +           prev_hpos = hpos - 1;
  415. +           if (hpos >= width) goto check_hpos;
  416. +           /* We've reached the target pos */
  417. +           pos++;
  418. +           goto done;
  419. +           }
  420. +           pos++;
  421. +           if (pos >= to)
  422. +             {
  423. +           prev_hpos = hpos - 1;
  424. +           goto done;
  425. +             }
  426. +           if (gap_pos == pos) p += GAP_SIZE;
  427. +           c = *p++;
  428. +         }
  429. +       while (visible[c]);
  430. +       prev_hpos = hpos;
  431. +         }
  432. +       if (c == '\t')
  433. + #else /* not FAST_DISPLAY */
  434.       hpos++;
  435.         else if (c == '\t')
  436. + #endif /* not FAST_DISPLAY */
  437.       {
  438.         hpos += tab_width - ((hpos + tab_offset + hscroll - (hscroll > 0)
  439.                   /* Add tab_width here to make sure positive.
  440. ***************
  441. *** 431,436 ****
  442. --- 497,505 ----
  443.         else
  444.       hpos += (ctl_arrow && c < 0200) ? 2 : 4;
  445.   
  446. + #ifdef FAST_DISPLAY
  447. + check_hpos:
  448. + #endif
  449.         /* Handle right margin.  */
  450.         if (hpos >= width
  451.         && (hpos > width
  452. ***************
  453. *** 459,464 ****
  454. --- 528,536 ----
  455.   
  456.       }
  457.       }
  458. + #ifdef FAST_DISPLAY
  459. +   done:
  460. + #endif
  461.   
  462.     val_compute_motion.bufpos = pos;
  463.     val_compute_motion.hpos = hpos;
  464. *** emacs-18.58/src/doc.c    1992/02/21 11:18:24
  465. --- GNUEMACS:src/doc.c    1992/02/23 10:28:48
  466. ***************
  467. *** 188,194 ****
  468. --- 188,198 ----
  469.   
  470.   #ifndef CANNOT_DUMP
  471.     name = (char *) alloca (XSTRING (filename)->size + 8);
  472. + #ifdef AMIGA
  473. +   strcpy (name, "/etc/");
  474. + #else
  475.     strcpy (name, "../etc/");
  476. + #endif
  477.   #else /* CANNOT_DUMP */
  478.     CHECK_STRING (Vexec_directory, 0);
  479.     name = (char *) alloca (XSTRING (filename)->size +
  480. *** emacs-18.58/src/filemode.c    1992/02/21 11:18:24
  481. --- GNUEMACS:src/filemode.c    1992/02/23 10:30:44
  482. ***************
  483. *** 70,75 ****
  484. --- 70,89 ----
  485.   
  486.   #define VOID void
  487.   
  488. + #ifdef AMIGA
  489. + VOID
  490. + filemodestring (s,a)
  491. +    struct stat    *s;
  492. +    char *a;
  493. + {
  494. +    a[0] = s->st_mode & S_IFDIR ? 'd' : '-';
  495. +    a[7] = a[4] = a[1] = s->st_mode & S_IREAD ? 'r' : '-';
  496. +    a[8] = a[5] = a[2] = s->st_mode & S_IREAD ? 'w' : '-';
  497. +    a[9] = a[6] = a[3] = s->st_mode & S_IREAD ? 'x' : '-';
  498. + }
  499. + #else /* not AMIGA */
  500.   static char ftypelet ();
  501.   static VOID rwx (), setst ();
  502.   
  503. ***************
  504. *** 193,195 ****
  505. --- 207,210 ----
  506.         chars[9] = 't';
  507.   #endif
  508.   }
  509. + #endif /* not AMIGA */
  510. *** emacs-18.58/src/tparam.c    1992/02/21 11:21:03
  511. --- GNUEMACS:src/tparam.c    1992/05/13 23:07:01
  512. ***************
  513. *** 258,264 ****
  514.     return outstring;
  515.   }
  516.   
  517. ! #ifdef DEBUG
  518.   
  519.   main (argc, argv)
  520.        int argc;
  521. --- 258,264 ----
  522.     return outstring;
  523.   }
  524.   
  525. ! #ifdef TPARAM_DEBUG
  526.   
  527.   main (argc, argv)
  528.        int argc;
  529. ***************
  530. *** 274,277 ****
  531.     return 0;
  532.   }
  533.   
  534. ! #endif /* DEBUG */
  535. --- 274,277 ----
  536.     return 0;
  537.   }
  538.   
  539. ! #endif /* TPARAM_DEBUG */
  540. *** emacs-18.58/src/xdisp.c    1992/02/21 11:21:03
  541. --- GNUEMACS:src/xdisp.c    1992/04/19 10:42:36
  542. ***************
  543. *** 31,36 ****
  544. --- 31,49 ----
  545.   #include "commands.h"
  546.   #include "macros.h"
  547.   
  548. + #ifdef FAST_DISPLAY
  549. + #define MAX_WIN_LINE 64
  550. + static int win_line_bufpos[MAX_WIN_LINE];
  551. + static int win_line_modified;
  552. + static struct buffer *win_line_buffer;
  553. + #define CLEAR_WIN_LINE() (win_line_buffer = 0)
  554. + #endif
  555. + #ifdef EIGHT_BIT
  556. + char visible[256];        /* visible[i] is true if character i is
  557. +                    displayable */
  558. + #endif
  559.   extern int interrupt_input;
  560.   extern int command_loop_level;
  561.   
  562. ***************
  563. *** 263,269 ****
  564. --- 276,289 ----
  565.       windows_or_buffers_changed++;
  566.   
  567.     if (EQ (minibuf_window, selected_window))
  568. + #ifdef FAST_DISPLAY
  569. +     {
  570. +       this_line_bufpos = 0;
  571. +       CLEAR_WIN_LINE();
  572. +     }
  573. + #else
  574.       this_line_bufpos = 0;
  575. + #endif
  576.   
  577.     prev_echo_area_contents = echo_area_contents;
  578.   }
  579. ***************
  580. *** 315,320 ****
  581. --- 335,344 ----
  582.         must_finish = 1;
  583.       }
  584.   
  585. + #ifdef FAST_DISPLAY
  586. +   if (windows_or_buffers_changed) CLEAR_WIN_LINE();
  587. + #endif
  588.     if (clip_changed || windows_or_buffers_changed)
  589.       update_mode_lines++;
  590.   
  591. ***************
  592. *** 441,446 ****
  593. --- 465,473 ----
  594.        Also, don't forget to check every line to update the arrow.  */
  595.     if (pause)
  596.       {
  597. + #ifdef FAST_DISPLAY
  598. +       CLEAR_WIN_LINE();
  599. + #endif
  600.         this_line_bufpos = 0;
  601.         if (!NULL (last_arrow_position))
  602.       {
  603. ***************
  604. *** 693,701 ****
  605. --- 720,754 ----
  606.         && (just_this_one || XFASTINT (w->width) == screen_width)
  607.         && !EQ (window, minibuf_window))
  608.       {
  609. + #ifdef FAST_DISPLAY
  610. +       int *wlb;
  611. +       int line, best_startp, best_vpos;
  612. +       best_startp = startp; best_vpos = 0;
  613. +       if (win_line_buffer && BUF_MODIFF(win_line_buffer) > win_line_modified)
  614. +       CLEAR_WIN_LINE();
  615. +       if (current_buffer == win_line_buffer && current_buffer == XBUFFER (w->buffer))
  616. +         {
  617. +       /* Try & find line to start from */
  618. +       wlb = win_line_bufpos; line = 0;
  619. +       while (line < MAX_WIN_LINE)
  620. +         {
  621. +           if (*wlb && point > *wlb && *wlb > best_startp)
  622. +             {
  623. +           best_startp = *wlb;
  624. +           best_vpos = line;
  625. +             }
  626. +           line++; wlb++;
  627. +         }
  628. +         }
  629. +       pos = *compute_motion (best_startp, best_vpos, (hscroll ? 1 - hscroll : 0),
  630. +                 point, height + 1, 10000, width, hscroll,
  631. +                 pos_tab_offset (w, startp));
  632. + #else /* not FAST_DISPLAY */
  633.         pos = *compute_motion (startp, 0, (hscroll ? 1 - hscroll : 0),
  634.                   point, height + 1, 10000, width, hscroll,
  635.                   pos_tab_offset (w, startp));
  636. + #endif /* not FAST_DISPLAY */
  637.   
  638.         if (pos.vpos < height)
  639.       {
  640. ***************
  641. *** 827,832 ****
  642. --- 880,889 ----
  643.   
  644.     struct position val;
  645.   
  646. + #ifdef FAST_DISPLAY
  647. +   if (XBUFFER(w->buffer) == win_line_buffer) CLEAR_WIN_LINE();
  648. + #endif
  649.     Fset_marker (w->start, make_number (pos), Qnil);
  650.   
  651.     point_vpos = -1;
  652. ***************
  653. *** 890,895 ****
  654. --- 947,956 ----
  655.     int delta;
  656.     int tab_offset, epto;
  657.   
  658. + #ifdef FAST_DISPLAY
  659. +   if (XBUFFER(w->buffer) == win_line_buffer) CLEAR_WIN_LINE();
  660. + #endif
  661.     if (GPT - BEG < beg_unchanged)
  662.       beg_unchanged = GPT - BEG;
  663.     if (Z - GPT < end_unchanged)
  664. ***************
  665. *** 1260,1266 ****
  666. --- 1321,1332 ----
  667.     int end;
  668.     register int pause;
  669.     register unsigned char *p;
  670. + #ifdef FAST_DISPLAY
  671. +   register long _endp;
  672. + #define endp ((char *)_endp)
  673. + #else
  674.     unsigned char *endp;
  675. + #endif
  676.     register unsigned char *startp;
  677.     register unsigned char *p1prev;
  678.     int tab_width = XINT (current_buffer->tab_width);
  679. ***************
  680. *** 1299,1305 ****
  681. --- 1365,1375 ----
  682.     end = ZV;
  683.   
  684.     startp = new_screen->contents[vpos] + XFASTINT (w->left);
  685. + #ifdef FAST_DISPLAY
  686. +   _endp = (long)startp + width;
  687. + #else
  688.     endp = startp + width;
  689. + #endif
  690.   
  691.     /* Loop generating characters.
  692.      Stop at end of buffer, before newline,
  693. ***************
  694. *** 1308,1313 ****
  695. --- 1378,1386 ----
  696.     pause = pos;
  697.     while (p1 < endp)
  698.       {
  699. + #ifdef FAST_DISPLAY
  700. + restart:
  701. + #endif
  702.         p1prev = p1;
  703.         if (pos == pause)
  704.       {
  705. ***************
  706. *** 1328,1334 ****
  707. --- 1401,1446 ----
  708.         p = &FETCH_CHAR (pos);
  709.       }
  710.         c = *p++;
  711. + #ifdef EIGHT_BIT
  712. +       if (visible[c])
  713. + #else
  714.         if (c >= 040 && c < 0177)
  715. + #endif
  716. + #ifdef FAST_DISPLAY
  717. +       /* This optimises the frequent part (displayable characters) of
  718. +      this inner loop. If the conditions aren't met, return to old
  719. +      inner loop. */
  720. +         {
  721. +       if (p1 >= startp)
  722. +         {
  723. +           do
  724. +             {
  725. +           *p1++ = c;
  726. +           pos++;
  727. +           if (p1 >= endp)
  728. +             {
  729. +               p1prev = p1 - 1;
  730. +               goto done;
  731. +             }
  732. +           if (pos == pause) goto restart;
  733. +           c = *p++;
  734. +             }
  735. + #ifdef EIGHT_BIT
  736. +           while (visible[c]);
  737. + #else
  738. +           while (c >= 040 && c < 0177);
  739. + #endif
  740. +           p1prev = p1;
  741. +         }
  742. +       else
  743. +         {
  744. +           p1++;
  745. +           pos++;
  746. +           goto restart;
  747. +         }
  748. +         }
  749. +       if (c == '\n')
  750. + #else /* not FAST_DISPLAY */
  751.       {
  752.         if (p1 >= startp)
  753.           *p1 = c;
  754. ***************
  755. *** 1335,1340 ****
  756. --- 1447,1453 ----
  757.         p1++;
  758.       }
  759.         else if (c == '\n')
  760. + #endif
  761.       {
  762.         invis = 0;
  763.         while (pos < end
  764. ***************
  765. *** 1408,1413 ****
  766. --- 1521,1529 ----
  767.       }
  768.         pos++;
  769.       }
  770. + #ifdef FAST_DISPLAY
  771. + done:
  772. + #endif
  773.   
  774.     val.hpos = - XINT (w->hscroll);
  775.     if (val.hpos)
  776. ***************
  777. *** 1495,1500 ****
  778. --- 1611,1637 ----
  779.           this_line_bufpos = 0;
  780.       }
  781.       }
  782. + #ifdef FAST_DISPLAY
  783. +   /* Save positions of all lines of current window */
  784. +   if (w == XWINDOW(selected_window) && vpos < MAX_WIN_LINE)
  785. +   {
  786. +       /* Line is not continued and did not start in middle of character */
  787. +       if (hpos == (XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0)
  788. +       && val.vpos)
  789. +       {
  790. +       if (current_buffer != win_line_buffer ||
  791. +           !(win_line_modified >= MODIFF))
  792. +       {
  793. +           win_line_buffer = current_buffer;
  794. +           win_line_modified = MODIFF;
  795. +           bzero(win_line_bufpos, sizeof win_line_bufpos);
  796. +       }
  797. +       win_line_bufpos[vpos - XINT (w->top)] = start;
  798. +       }
  799. +       else
  800. +       win_line_bufpos[vpos - XINT (w->top)] = 0;
  801. +   }
  802. + #endif /* FAST_DISPLAY */
  803.   
  804.     /* If hscroll and line not empty, insert truncation-at-left marker */
  805.     if (hscroll && lastpos != start)
  806. ***************
  807. *** 1506,1512 ****
  808. --- 1643,1653 ----
  809.   
  810.     if (XFASTINT (w->width) + XFASTINT (w->left) != screen_width)
  811.       {
  812. + #ifdef FAST_DISPLAY
  813. +       _endp++;
  814. + #else
  815.         endp++;
  816. + #endif
  817.         if (p1 < startp) p1 = startp;
  818.         while (p1 < endp) *p1++ = ' ';
  819.         *p1++ = '|';
  820. ***************
  821. *** 1535,1540 ****
  822. --- 1676,1684 ----
  823.     val.bufpos = pos;
  824.     val_display_text_line = val;
  825.     return &val_display_text_line;
  826. + #ifdef FAST_DISPLAY
  827. + #undef endp
  828. + #endif
  829.   }
  830.   
  831.   /* Display the mode line for window w */
  832. ***************
  833. *** 1960,1966 ****
  834. --- 2104,2114 ----
  835.       {
  836.         c = *string++;
  837.         if (!c) break;
  838. + #ifdef EIGHT_BIT
  839. +       if (visible[c])
  840. + #else
  841.         if (c >= 040 && c < 0177)
  842. + #endif
  843.       {
  844.         if (p1 >= start)
  845.           *p1 = c;
  846. ***************
  847. *** 2075,2081 ****
  848. --- 2223,2235 ----
  849.     register
  850.   #endif COMPILER_REGISTER_BUG
  851.       struct window *mini_w;
  852. + #ifdef EIGHT_BIT
  853. +   int i;
  854. + #endif
  855.   
  856. + #ifdef FAST_DISPLAY
  857. +   CLEAR_WIN_LINE();
  858. + #endif
  859.     this_line_bufpos = 0;
  860.   
  861.     mini_w = XWINDOW (minibuf_window);
  862. ***************
  863. *** 2094,2097 ****
  864. --- 2248,2257 ----
  865.         XFASTINT (XWINDOW (root_window)->width) = screen_width;
  866.         XFASTINT (mini_w->width) = screen_width;
  867.       }
  868. + #ifdef EIGHT_BIT
  869. +   for (i = 040; i < 0177; i++) visible[i] = 1;
  870. + #ifdef AMIGA
  871. +   for (i = 0240; i <= 0377; i++) visible[i] = 1;
  872. + #endif
  873. + #endif
  874.   }
  875. *** emacs-18.58/src/keyboard.c    1992/02/21 11:18:24
  876. --- GNUEMACS:src/keyboard.c    1992/05/02 17:35:08
  877. ***************
  878. *** 1151,1156 ****
  879. --- 1151,1167 ----
  880.   #endif /* not SIGIO */
  881.   #endif /* subprocesses */
  882.   
  883. + #ifdef    AMIGA
  884. +       set_waiting_for_input (0);
  885. +       amiga_consume_input(this_command_key_count == 0);
  886. +       if (!kbd_count)
  887. +       {
  888. +           amiga_wait_for_input();
  889. +           amiga_consume_input(this_command_key_count == 0);
  890. +       }
  891. +       clear_waiting_for_input ();
  892. + #endif    /* AMIGA */
  893.         if (!interrupt_input && !kbd_count)
  894.           {
  895.             read_avail_input (0);
  896. ***************
  897. *** 1254,1259 ****
  898. --- 1265,1275 ----
  899.   read_avail_input (nread)
  900.        int nread;
  901.   {
  902. + #ifdef    AMIGA    /* This is where the input work finally gets done */
  903. +   /* Note, The nread != 0 case isn't handled as it doesn't arise on the Amiga.
  904. +      (Look carefully at calls to read_avail_input) */
  905. +   amiga_consume_input(FALSE);
  906. + #else    /* AMIGA */
  907.     /* This function is not used on VMS.  */
  908.   #ifndef VMS
  909.     char buf[256 * BUFFER_SIZE_FACTOR];
  910. ***************
  911. *** 1328,1333 ****
  912. --- 1344,1350 ----
  913.       break;
  914.       }
  915.   #endif /* not VMS */
  916. + #endif /* not AMIGA */
  917.   }
  918.   
  919.   #ifdef SIGIO   /* for entire page */
  920. ***************
  921. *** 1576,1581 ****
  922. --- 1593,1605 ----
  923.         nextlocal = Qnil;
  924.         nextglobal = Qnil;
  925.   
  926. + #ifdef AMIGA
  927. +       /* Gross hack so that C-\ sequences are always handled, even in local
  928. +      modes that redefine C-\ (like View).
  929. +      This is necessary because some sequences (like C-\ A, ARexx event)
  930. +      must always be dealt with. */
  931. +       if (c == '\034') local = Qnil;
  932. + #endif
  933.         read_key_sequence_cmd = !NULL (local) ? local : global;
  934.   
  935.         /* trace symbols to their function definitions */
  936. *** emacs-18.58/src/alloca.c    1992/02/21 11:18:24
  937. --- GNUEMACS:src/alloca.c    1992/03/01 11:35:25
  938. ***************
  939. *** 72,78 ****
  940.   #define    STACK_DIRECTION    0        /* direction unknown */
  941.   #endif
  942.   
  943. ! #if STACK_DIRECTION != 0
  944.   
  945.   #define    STACK_DIR    STACK_DIRECTION    /* known at compile-time */
  946.   
  947. --- 72,78 ----
  948.   #define    STACK_DIRECTION    0        /* direction unknown */
  949.   #endif
  950.   
  951. ! #if (STACK_DIRECTION) != 0
  952.   
  953.   #define    STACK_DIR    STACK_DIRECTION    /* known at compile-time */
  954.   
  955. ***************
  956. *** 143,148 ****
  957. --- 143,151 ----
  958.   {
  959.     auto char    probe;        /* probes stack depth: */
  960.     register char    *depth = &probe;
  961. + #ifdef AMIGA_DUMP
  962. +   extern int alloca_calling;
  963. + #endif
  964.   
  965.   #if STACK_DIRECTION == 0
  966.     if (STACK_DIR == 0)        /* unknown growth direction */
  967. ***************
  968. *** 176,185 ****
  969. --- 179,194 ----
  970.   
  971.     /* Allocate combined header + user data storage. */
  972.   
  973. + #ifdef AMIGA_DUMP
  974. +   alloca_calling = 1;
  975. + #endif
  976.     {
  977.       register pointer    new = xmalloc (sizeof (header) + size);
  978.       /* address of header */
  979.   
  980. + #ifdef AMIGA_DUMP
  981. +   alloca_calling = 0;
  982. + #endif
  983.       ((header *)new)->h.next = last_alloca_header;
  984.       ((header *)new)->h.deep = depth;
  985.   
  986. *** emacs-18.58/src/callproc.c    1992/02/21 11:18:24
  987. --- GNUEMACS:src/callproc.c    1992/04/29 21:39:06
  988. ***************
  989. *** 126,132 ****
  990. --- 126,136 ----
  991.   #ifdef VMS
  992.       args[1] = build_string ("NLA0:");
  993.   #else
  994. + #ifdef AMIGA
  995. +     args[1] = build_string ("NIL:");
  996. + #else
  997.       args[1] = build_string ("/dev/null");
  998. + #ednif /* not AMIGA */
  999.   #endif /* not VMS */
  1000.     else
  1001.       args[1] = Fexpand_file_name (args[1], current_buffer->directory);
  1002. ***************
  1003. *** 178,184 ****
  1004. --- 182,192 ----
  1005.   #ifdef VMS
  1006.       fd[1] = open ("NLA0:", 0), fd[0] = -1;
  1007.   #else
  1008. + #ifdef AMIGA
  1009. +     fd[1] = open ("NIL:", O_WRONLY), fd[0] = -1;
  1010. + #else  
  1011.       fd[1] = open ("/dev/null", O_WRONLY), fd[0] = -1;
  1012. + #endif /* not AMIGA */
  1013.   #endif /* not VMS */
  1014.     else
  1015.       {
  1016. ***************
  1017. *** 192,197 ****
  1018. --- 200,221 ----
  1019.     synch_process_death = 0;
  1020.     synch_process_retcode = 0;
  1021.   
  1022. + #ifdef AMIGA
  1023. +   {
  1024. +     register unsigned char *temp;
  1025. +     if (XTYPE (current_buffer->directory) == Lisp_String)
  1026. +       {
  1027. +     register int i;
  1028. +     i = XSTRING (current_buffer->directory)->size;
  1029. +     temp = (unsigned char *) alloca (i + 1);
  1030. +     bcopy (XSTRING (current_buffer->directory)->data, temp, i);
  1031. +     temp[i] = 0;
  1032. +       }
  1033. +     pid = exec(new_argv[0], new_argv, filefd, fd[1], temp);
  1034. +   }
  1035. + #else  
  1036.     {
  1037.       /* child_setup must clobber environ in systems with true vfork.
  1038.          Protect it from permanent change.  */
  1039. ***************
  1040. *** 229,234 ****
  1041. --- 253,259 ----
  1042.       close (filefd);
  1043.       close (fd1);
  1044.     }
  1045. + #endif /* not AMIGA */
  1046.   
  1047.     if (pid < 0)
  1048.       {
  1049. ***************
  1050. *** 300,306 ****
  1051. --- 325,335 ----
  1052.     register Lisp_Object filename_string, start, end;
  1053.     char tempfile[20];
  1054.   
  1055. + #ifdef AMIGA
  1056. +   strcpy (tempfile, "t:emacsXXXXXX");
  1057. + #else
  1058.     strcpy (tempfile, "/tmp/emacsXXXXXX");
  1059. + #endif
  1060.     mktemp (tempfile);
  1061.   
  1062.     filename_string = build_string (tempfile);
  1063. ***************
  1064. *** 316,321 ****
  1065. --- 345,351 ----
  1066.     unlink (tempfile);
  1067.     return Qnil;
  1068.   }
  1069. + #ifndef AMIGA
  1070.   
  1071.   /* This is the last thing run in a newly forked inferior
  1072.      either synchronous or asynchronous.
  1073. ***************
  1074. *** 423,428 ****
  1075. --- 453,459 ----
  1076.     write (1, new_argv[0], strlen (new_argv[0]));
  1077.     _exit (1);
  1078.   }
  1079. + #endif /* not AMIGA */
  1080.   
  1081.   init_callproc ()
  1082.   {
  1083. ***************
  1084. *** 435,440 ****
  1085. --- 466,479 ----
  1086.     Vexec_path = decode_env_path (0, PATH_EXEC);
  1087.     Vexec_directory = Ffile_name_as_directory (Fcar (Vexec_path));
  1088.     Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
  1089. + #ifdef AMIGA
  1090. +   {
  1091. +     char *amiga_path(), *apath = amiga_path();
  1092. +     Vexec_path = nconc2 (decode_env_path (0, apath), Vexec_path);
  1093. +     free(apath);
  1094. +   }
  1095. + #endif  
  1096.   
  1097.     execdir = Fdirectory_file_name (Vexec_directory);
  1098.     if (access (XSTRING (execdir)->data, 0) < 0)
  1099. ***************
  1100. *** 445,451 ****
  1101. --- 484,494 ----
  1102.       }
  1103.   
  1104.     sh = (char *) egetenv ("SHELL");
  1105. + #ifdef AMIGA
  1106. +   Vshell_file_name = build_string (sh ? sh : "GNUEmacs:etc/sh");
  1107. + #else
  1108.     Vshell_file_name = build_string (sh ? sh : "/bin/sh");
  1109. + #endif
  1110.   
  1111.   #ifndef MAINTAIN_ENVIRONMENT
  1112.     /* The equivalent of this operation was done
  1113. *** emacs-18.58/src/buffer.c    1992/02/21 11:18:24
  1114. --- GNUEMACS:src/buffer.c    1992/02/23 10:26:24
  1115. ***************
  1116. *** 1140,1146 ****
  1117.   #ifndef VMS
  1118.     /* Maybe this should really use some standard subroutine
  1119.        whose definition is filename syntax dependent.  */
  1120. !   if (buf[strlen (buf) - 1] != '/')
  1121.       strcat (buf, "/");
  1122.   #endif /* not VMS */
  1123.     current_buffer->directory = build_string (buf);
  1124. --- 1140,1150 ----
  1125.   #ifndef VMS
  1126.     /* Maybe this should really use some standard subroutine
  1127.        whose definition is filename syntax dependent.  */
  1128. !   if (buf[strlen (buf) - 1] != '/'
  1129. ! #ifdef AMIGA
  1130. ! && buf[strlen (buf) -1] != ':'
  1131. ! #endif /*AMIGA  */
  1132. ! )
  1133.       strcat (buf, "/");
  1134.   #endif /* not VMS */
  1135.     current_buffer->directory = build_string (buf);
  1136. *** emacs-18.58/src/keymap.c    1992/02/21 11:18:24
  1137. --- GNUEMACS:src/keymap.c    1992/02/23 11:01:10
  1138. ***************
  1139. *** 29,34 ****
  1140. --- 29,38 ----
  1141.   
  1142.   /* Actually allocate storage for these variables */
  1143.   
  1144. + #ifdef AMIGA
  1145. + #define HAVE_X_WINDOWS        /* We want the mouse map too */
  1146. + #endif
  1147.   #ifdef HAVE_X_WINDOWS
  1148.   Lisp_Object MouseMap;        /* Keymap for mouse commands */
  1149.   #endif /* HAVE_X_WINDOWS */
  1150. *** emacs-18.58/src/fileio.c    1992/02/21 11:18:24
  1151. --- GNUEMACS:src/fileio.c    1992/02/23 10:29:59
  1152. ***************
  1153. *** 147,152 ****
  1154. --- 147,155 ----
  1155.     p = beg + XSTRING (file)->size;
  1156.   
  1157.     while (p != beg && p[-1] != '/'
  1158. + #ifdef    AMIGA
  1159. +          && p[-1] != ':'
  1160. + #endif    /* AMIGA */
  1161.   #ifdef VMS
  1162.        && p[-1] != ':' && p[-1] != ']' && p[-1] != '>'
  1163.   #endif /* VMS */
  1164. ***************
  1165. *** 174,179 ****
  1166. --- 177,185 ----
  1167.     end = p = beg + XSTRING (file)->size;
  1168.   
  1169.     while (p != beg && p[-1] != '/'
  1170. + #ifdef    AMIGA
  1171. +          && p[-1] != ':'
  1172. + #endif    /* AMIGA */
  1173.   #ifdef VMS
  1174.        && p[-1] != ':' && p[-1] != ']' && p[-1] != '>'
  1175.   #endif /* VMS */
  1176. ***************
  1177. *** 248,256 ****
  1178. --- 254,268 ----
  1179.         out[size] = '\0';
  1180.       }
  1181.   #else /* not VMS */
  1182. + #ifdef    AMIGA
  1183. +   /* AmigaDOS syntax, append slash if the last char isn't a ':' or '/' */
  1184. +   if (out[size] != '/' && out[size] != ':' && size != 0)
  1185. +     strcat (out, "/");
  1186. + #else    /* not AMIGA */
  1187.     /* For Unix syntax, Append a slash if necessary */
  1188.     if (out[size] != '/')
  1189.       strcat (out, "/");
  1190. + #endif /* not AMIGA */
  1191.   #endif /* not VMS */
  1192.     return out;
  1193.   }
  1194. ***************
  1195. *** 462,467 ****
  1196. --- 474,578 ----
  1197.        (name, defalt)
  1198.        Lisp_Object name, defalt;
  1199.   {
  1200. + #ifdef AMIGA
  1201. +   unsigned char *nm, *tilde, *newdir, *colon, *t_pos, *target;
  1202. +   CHECK_STRING (name, 0);
  1203. +   nm = XSTRING (name)->data;
  1204. +   /* Find base directory */
  1205. +   if (NULL (defalt))
  1206. +       defalt = current_buffer->directory;
  1207. +   CHECK_STRING (defalt, 1);
  1208. +   newdir = XSTRING (defalt)->data;
  1209. +   /* Concat newdir w/ nm and canonicalize */
  1210. +   /* newdir always contains at least the device name.
  1211. +      It is assumed canonical */
  1212. +   target = (unsigned char *)alloca(strlen(nm) + strlen(newdir) + 2);
  1213. +   file_name_as_directory (target, newdir);
  1214. +   t_pos = target + strlen(target);
  1215. +   while (*nm)
  1216. +   {
  1217. +       unsigned char *comp_end = nm;
  1218. +       int comp_len;
  1219. +       /* Find next component of path (everything upto the next /) */
  1220. +       do comp_end++; while (comp_end[0] && comp_end[-1] != '/' && comp_end[-1] != ':');
  1221. +       comp_len = comp_end - nm;
  1222. +       if (comp_len == 1 && nm[0] == '/' ||
  1223. +       nm[0] == '.' && nm[1] == '.' &&
  1224. +       (comp_len == 2 || comp_len == 3 && nm[2] == '/'))
  1225. +       {
  1226. +       /* Previous directory */
  1227. +       if (t_pos > target && t_pos[-1] != ':')
  1228. +       {
  1229. +           t_pos--; /* Back up over / */
  1230. +           while (t_pos > target &&
  1231. +              t_pos[-1] != ':' && t_pos[-1] != '/') t_pos--;
  1232. +       }
  1233. +       }
  1234. +       else if (comp_len == 2 && nm[0] == '.' && nm[1] == '/' ||
  1235. +            comp_len == 1 && nm[0] == '.') ; /* Ignore . */
  1236. +       else if (nm[0] == ':') /* Just keep disk name */
  1237. +       {
  1238. +       char *new_pos;
  1239. +       *t_pos = 0; /* Limit search for : */
  1240. +       t_pos = index(target, ':');
  1241. +       if (t_pos) t_pos++;
  1242. +       else t_pos = target;
  1243. +       }
  1244. +       else if (nm[0] == '~' || index(nm, ':'))
  1245. +       {
  1246. +       char *exp_name;
  1247. +       if (nm[0] == '~')
  1248. +           if (nm[1] == '/' || nm[1] == 0) /* Home directory */
  1249. +           {
  1250. +           newdir = (unsigned char *) egetenv ("HOME");
  1251. +           if (!newdir) newdir = (unsigned char *) "s:";
  1252. +           }
  1253. +           else
  1254. +           {
  1255. +           /* Handle ~ followed by user name.  */
  1256. +           char lastc = nm[comp_len - 1];
  1257. +           int len = comp_len - 1;
  1258. +           if (lastc == ':' || lastc == '/') len--;
  1259. +           /* ~name becomes name: */
  1260. +           newdir = (unsigned char *) alloca (len + 2);
  1261. +           bcopy((char *) nm + 1, newdir, len);
  1262. +           newdir[len] = ':';
  1263. +           newdir[len + 1] = 0;
  1264. +           }
  1265. +       else /* we have name: */
  1266. +       {
  1267. +           newdir = (char *)alloca(comp_len + 1);
  1268. +           bcopy(nm, newdir, comp_len);
  1269. +           newdir[comp_len] = 0;
  1270. +       }
  1271. +       exp_name = (char *)alloca(1024);
  1272. +       if (expand_path(newdir, exp_name, 1024))
  1273. +           if (strncmp(exp_name, "Tao:", 4) != 0) /* Hack for WShell PATH: */
  1274. +           newdir = exp_name;
  1275. +       target = (unsigned char *)alloca(strlen(nm) + strlen(newdir) + 2);
  1276. +       file_name_as_directory (target, newdir);
  1277. +       t_pos = target + strlen(target);
  1278. +       }
  1279. +       else /* Copy component */
  1280. +       {
  1281. +       bcopy(nm, t_pos, comp_len);
  1282. +       t_pos += comp_len;
  1283. +       }
  1284. +       nm = comp_end;
  1285. +   }
  1286. +   return make_string (target, t_pos - target);
  1287. + #else /* not AMIGA */
  1288.     unsigned char *nm;
  1289.     
  1290.     register unsigned char *newdir, *p, *o;
  1291. ***************
  1292. *** 793,798 ****
  1293. --- 904,910 ----
  1294.       }
  1295.   
  1296.     return make_string (target, o - target);
  1297. + #endif /* not AMIGA */
  1298.   }
  1299.   
  1300.   DEFUN ("substitute-in-file-name", Fsubstitute_in_file_name,
  1301. ***************
  1302. *** 823,828 ****
  1303. --- 935,957 ----
  1304.   
  1305.     for (p = nm; p != endp; p++)
  1306.       {
  1307. + #ifdef AMIGA
  1308. +       if (p[0] == '~' && p != nm && p[-1] == '/')
  1309. +     {
  1310. +         nm = p;
  1311. +         substituted = 1;
  1312. +     }
  1313. +       else if (p[0] == ':')
  1314. +     {
  1315. +           char *p2 = p;
  1316. +       while (p2 > nm && p2[-1] != ':' && p2[-1] != '/') p2--;
  1317. +       if (p2 != nm)
  1318. +         {
  1319. +           nm = p2;
  1320. +           substituted = 1;
  1321. +         }
  1322. +     }
  1323. + #else /* not AMIGA */
  1324.         if ((p[0] == '~' ||
  1325.   #ifdef APOLLO
  1326.          /* // at start of file name is meaningful in Apollo system */
  1327. ***************
  1328. *** 843,848 ****
  1329. --- 972,978 ----
  1330.         nm = p;
  1331.         substituted = 1;
  1332.       }
  1333. + #endif /* not AMIGA */
  1334.       }
  1335.   
  1336.   #ifdef VMS
  1337. ***************
  1338. *** 1351,1356 ****
  1339. --- 1481,1493 ----
  1340.   
  1341.     CHECK_STRING (filename, 0);
  1342.     ptr = XSTRING (filename)->data;
  1343. + #ifdef    AMIGA
  1344. +   /* An absolute filename has a non-leading ':' in it */
  1345. +   if (*ptr != ':')
  1346. +       while (*ptr)
  1347. +       if (*ptr++ == ':') return Qt;
  1348. +   return Qnil;
  1349. + #else    /* not AMIGA */
  1350.     if (*ptr == '/' || *ptr == '~'
  1351.   #ifdef VMS
  1352.   /* ??? This criterion is probably wrong for '<'.  */
  1353. ***************
  1354. *** 1362,1367 ****
  1355. --- 1499,1505 ----
  1356.       return Qt;
  1357.     else
  1358.       return Qnil;
  1359. + #endif /* not AMIGA */
  1360.   }
  1361.   
  1362.   DEFUN ("file-exists-p", Ffile_exists_p, Sfile_exists_p, 1, 1, 0,
  1363. ***************
  1364. *** 1486,1492 ****
  1365. --- 1624,1634 ----
  1366.   
  1367.     if (stat (XSTRING (abspath)->data, &st) < 0)
  1368.       return Qnil;
  1369. + #ifdef AMIGA
  1370. +   return make_number (st.st_mode & ~S_IFMT);
  1371. + #else
  1372.     return make_number (st.st_mode & 07777);
  1373. + #endif
  1374.   }
  1375.   
  1376.   DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, 0,
  1377. *** emacs-18.58/src/lread.c    1992/02/21 11:18:24
  1378. --- GNUEMACS:src/lread.c    1992/03/01 11:35:25
  1379. ***************
  1380. *** 238,248 ****
  1381. --- 238,252 ----
  1382.        Lisp_Object pathname;
  1383.   {
  1384.     register unsigned char *s = XSTRING (pathname)->data;
  1385. + #ifdef AMIGA
  1386. +   return (*s && index(s + 1, ':')); /* Non-leading : */
  1387. + #else
  1388.     return (*s == '~' || *s == '/'
  1389.   #ifdef VMS
  1390.         || index (s, ':')
  1391.   #endif /* VMS */
  1392.         );
  1393. + #endif /* not AMIGA */
  1394.   }
  1395.   
  1396.   /* Search for a file whose name is STR, looking in directories
  1397. ***************
  1398. *** 557,563 ****
  1399. --- 561,571 ----
  1400.   }
  1401.   
  1402.   static int read_buffer_size;
  1403. + #ifdef AMIGA_DUMP
  1404. + char *read_buffer;
  1405. + #else
  1406.   static char *read_buffer;
  1407. + #endif
  1408.   
  1409.   static Lisp_Object
  1410.   read1 (readcharfun)
  1411. *** emacs-18.58/src/emacs.c    1992/02/21 11:18:24
  1412. --- GNUEMACS:src/emacs.c    1992/05/16 21:25:46
  1413. ***************
  1414. *** 75,80 ****
  1415. --- 75,84 ----
  1416.   #endif
  1417.   #endif
  1418.   
  1419. + #ifdef AMIGA_DUMP
  1420. + #define HAVE_SHM        /* Simplifies the ifdefs */
  1421. + #endif
  1422.   #ifndef O_RDWR
  1423.   #define O_RDWR 2
  1424.   #endif
  1425. ***************
  1426. *** 220,225 ****
  1427. --- 224,233 ----
  1428.     extern int errno;
  1429.     extern void malloc_warning ();
  1430.   
  1431. + #ifdef AMIGA
  1432. +   amiga_early_init(&argc, &argv);
  1433. + #endif
  1434.   /* Map in shared memory, if we are using that.  */
  1435.   #ifdef HAVE_SHM
  1436.     if (argc > 1 && !strcmp (argv[1], "-nl"))
  1437. ***************
  1438. *** 292,297 ****
  1439. --- 300,319 ----
  1440.     xargc = argc;
  1441.   #endif
  1442.   
  1443. + #ifdef    AMIGA
  1444. + /* Handle the -t switch, which specifies device & unit to use as terminal */
  1445. +   if (skip_args + 3 < argc && !strcmp (argv[skip_args + 1], "-t"))
  1446. +     {
  1447. +       extern char *far serial_device;
  1448. +       extern long serial_unit;
  1449. +       skip_args += 3;
  1450. +       serial_device = argv[skip_args - 1];
  1451. +       serial_unit = atoi(argv[skip_args]);
  1452. +       fprintf (stderr, "Using %s (unit %d)\n", serial_device ,serial_unit);
  1453. +       inhibit_window_system = 1;    /* -t => -nw */
  1454. +     }
  1455. + #else /* not AMIGA */
  1456.   /* Handle the -t switch, which specifies filename to use as terminal */
  1457.     if (skip_args + 2 < argc && !strcmp (argv[skip_args + 1], "-t"))
  1458.       {
  1459. ***************
  1460. *** 305,310 ****
  1461. --- 327,333 ----
  1462.         inhibit_window_system = 1;    /* -t => -nw */
  1463.   #endif
  1464.       }
  1465. + #endif /* not AMIGA */
  1466.   #ifdef HAVE_X_WINDOWS
  1467.   /* Handle the -d switch, which means use a different display for X */
  1468.     if (skip_args + 2 < argc && (!strcmp (argv[skip_args + 1], "-d") ||
  1469. ***************
  1470. *** 417,422 ****
  1471. --- 440,448 ----
  1472.         init_window_once ();    /* Init the window system */
  1473.       }
  1474.   
  1475. + #ifdef AMIGA
  1476. +   init_amiga ();
  1477. + #endif
  1478.     init_alloc ();
  1479.   #ifdef MAINTAIN_ENVIRONMENT
  1480.     init_environ ();
  1481. ***************
  1482. *** 686,692 ****
  1483. --- 712,722 ----
  1484.   #ifdef VMS
  1485.   #define SEPCHAR ','
  1486.   #else
  1487. + #ifdef AMIGA            /* Can't use : on Amiga */
  1488. + #define SEPCHAR ','
  1489. + #else
  1490.   #define SEPCHAR ':'
  1491. + #endif
  1492.   #endif
  1493.   
  1494.   Lisp_Object
  1495. *** emacs-18.58/src/lastfile.c    1992/02/21 11:18:24
  1496. --- GNUEMACS:src/lastfile.c    1992/05/13 23:07:01
  1497. ***************
  1498. *** 35,40 ****
  1499. --- 35,49 ----
  1500.    coming from libraries.
  1501.   */
  1502.   
  1503. + #ifdef AMIGA_DUMP
  1504. + /* I need to find the end of initialised and unitialised data, as well as of
  1505. +    executable code.
  1506. + */
  1507. + int last_data = 1;
  1508. + int last_bss;
  1509. + void last_function() { }
  1510. + #else /* not AMIGA_DUMP */
  1511.   #ifdef VMS
  1512.   /* Prevent the file from being totally empty.  */
  1513.   static dummy () {}
  1514. ***************
  1515. *** 41,43 ****
  1516. --- 50,53 ----
  1517.   #endif
  1518.   
  1519.   char my_edata = 0;
  1520. + #endif /* not AMIGA_DUMP */
  1521. *** emacs-18.58/src/scroll.c    1992/02/21 11:21:03
  1522. --- GNUEMACS:src/scroll.c    1992/05/16 21:25:46
  1523. ***************
  1524. *** 55,60 ****
  1525. --- 55,61 ----
  1526.   int *ILncost;
  1527.   int *DLncost;
  1528.   
  1529. + #ifdef FAST_DISPLAY
  1530.   scrolling_1 (window_size, unchanged_at_top, unchanged_at_bottom,
  1531.            draw_cost, old_hash, new_hash, free_at_end)
  1532.        int window_size, unchanged_at_top, unchanged_at_bottom;
  1533. ***************
  1534. *** 63,68 ****
  1535. --- 64,127 ----
  1536.        int *new_hash;
  1537.        int free_at_end;
  1538.   {
  1539. +   int lines, i;
  1540. +   int window_end = unchanged_at_top + window_size;
  1541. +   /* Rebase arrays at line 0 */
  1542. +   old_hash -= unchanged_at_top - 1;
  1543. +   new_hash -= unchanged_at_top - 1;
  1544. +   draw_cost -= unchanged_at_top - 1;
  1545. +   /* We can't allow un-enabled lines to be scrolled (they are not redrawable). 
  1546. +      Restrict window to the first set of contiguous enabled lines 
  1547. +      (an enabled line has draw_cost[x] != INFINITY) */
  1548. +   for (i = unchanged_at_top; i < window_end && draw_cost[i] != INFINITY; i++) ;
  1549. +   /*unchanged_at_bottom += window_size - i;*/
  1550. +   /*window_size = i - unchanged_at_top;*/
  1551. +   window_end = i;
  1552. +   if (lines = calc_scroll(old_hash, new_hash, unchanged_at_top, window_end))
  1553. +       scroll_screen_lines(unchanged_at_top, window_end - lines, lines);
  1554. +   else if (lines = calc_scroll(new_hash, old_hash, unchanged_at_top, window_end))
  1555. +       scroll_screen_lines(unchanged_at_top + lines, window_end, -lines);
  1556. + }
  1557. + int calc_scroll(int *old_hash, int *new_hash, int from, int to)
  1558. + /* For insert attempt, the parameters are correct.
  1559. +    For delete attempt, swap the old & new hash parameters
  1560. + */
  1561. + {
  1562. +     int try = from + 1, lines, i;
  1563. +     int hash1 = old_hash[from];
  1564. +     do
  1565. +     {
  1566. +     if (hash1 == new_hash[try])
  1567. +     {
  1568. +         /* Check if other lines match too */
  1569. +         lines = try - from; /* Amount to insert */
  1570. +         for (i = try + 1; i < to; i++)
  1571. +         if (old_hash[i - lines] != new_hash[i]) break;
  1572. +         if (i == to) /* It works ! */
  1573. +         return lines;
  1574. +     }
  1575. +     try++;
  1576. +     }
  1577. +     while (try < to);
  1578. +     return 0;
  1579. + }
  1580. + #else /* not FAST_DISPLAY */
  1581. + scrolling_1 (window_size, unchanged_at_top, unchanged_at_bottom,
  1582. +          draw_cost, old_hash, new_hash, free_at_end)
  1583. +      int window_size, unchanged_at_top, unchanged_at_bottom;
  1584. +      int *draw_cost;
  1585. +      int *old_hash;
  1586. +      int *new_hash;
  1587. +      int free_at_end;
  1588. + {
  1589.     struct matrix_elt *matrix;
  1590.     matrix = ((struct matrix_elt *)
  1591.           alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix));
  1592. ***************
  1593. *** 320,325 ****
  1594. --- 379,385 ----
  1595.     if (window)
  1596.       set_terminal_window (0);
  1597.   }
  1598. + #endif /* not FAST_DISPLAY */
  1599.   
  1600.   /* Return number of lines in common between current screen contents
  1601.      and the text to be displayed,
  1602.