summaryrefslogtreecommitdiff
path: root/editors/uemacs/files/patch-aa
blob: ea52160078274470907830360aebc2c364bcdd96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
diff -crN --exclude=*freebsd* ue312.orig/Makefile ue312/Makefile
*** ue312.orig/Makefile	Thu Jan  1 01:00:00 1970
--- ue312/Makefile	Sat Jan 14 12:14:26 1995
***************
*** 0 ****
--- 1,12 ----
+ #
+ # simple makefile for uemacs 
+ #
+ 
+ all:
+ 	(cd freebsd; make emacs)
+ 
+ install:	all
+ 	install -c -s freebsd/emacs ${PREFIX}/bin/uemacs
+ 	mkdir -p ${PREFIX}/lib/uemacs
+ 	install -c -m 644 -o bin -g bin cmd/* ${PREFIX}/lib/uemacs
+ 	mv ${PREFIX}/lib/uemacs/emacs.rc ${PREFIX}/lib/uemacs/.emacsrc
diff -crN --exclude=*freebsd* ue312.orig/h/epath.h ue312/h/epath.h
*** ue312.orig/h/epath.h	Tue Mar 16 15:13:46 1993
--- ue312/h/epath.h	Sat Jan 14 11:26:35 1995
***************
*** 68,74 ****
  {
  	".emacsrc",
  	"emacs.hlp",
! 	"/usr/local/",
  	"/usr/lib/",
  	""
  };
--- 68,74 ----
  {
  	".emacsrc",
  	"emacs.hlp",
! 	"/usr/local/lib/uemacs/",
  	"/usr/lib/",
  	""
  };
diff -crN --exclude=*freebsd* ue312.orig/src/bind.c ue312/src/bind.c
*** ue312.orig/src/bind.c	Thu Apr 22 21:20:54 1993
--- ue312/src/bind.c	Sat Jan 14 12:03:55 1995
***************
*** 619,624 ****
--- 619,625 ----
  	register char *sp;	/* pointer into path spec */
  	register int i; 	/* index */
  	static char fspec[NFILEN];	/* full path spec to search */
+         char patha[NFILEN] = "";
  	char *getenv();
  
  	/* if we have an absolute path.. check only there! */
***************
*** 675,683 ****
  #if OS2
  	path = getenv("DPATH");
  #else
! 	path = getenv("PATH");
  #endif
  #endif
  	if (path != NULL)
  		while (*path) {
  
--- 676,686 ----
  #if OS2
  	path = getenv("DPATH");
  #else
! 	strcat(patha, getenv("PATH"));
!         strcat(patha, "/usr/local/lib/uemacs");
  #endif
  #endif
+         path = &patha[0];
  	if (path != NULL)
  		while (*path) {
  
diff -crN --exclude=*freebsd* ue312.orig/src/line.c ue312/src/line.c
*** ue312.orig/src/line.c	Mon Dec 21 14:08:18 1992
--- ue312/src/line.c	Fri Jan 13 19:05:04 1995
***************
*** 668,674 ****
  	register int size;	/* length of line to return */
  	register char *sp;	/* string pointer into line */
  	register char *dp;	/* string pointer into returned line */
! 	char rline[NSTRING];	/* line to return */
  
  	/* find the contents of the current line and its length */
  	lp = curwp->w_dotp;
--- 668,674 ----
  	register int size;	/* length of line to return */
  	register char *sp;	/* string pointer into line */
  	register char *dp;	/* string pointer into returned line */
! 	static char rline[NSTRING];	/* line to return */
  
  	/* find the contents of the current line and its length */
  	lp = curwp->w_dotp;
diff -crN --exclude=*freebsd* ue312.orig/src/lock.c ue312/src/lock.c
*** ue312.orig/src/lock.c	Wed Apr 21 10:22:40 1993
--- ue312/src/lock.c	Fri Jan 13 19:09:11 1995
***************
*** 10,19 ****
--- 10,26 ----
  
  #if	FILOCK
  
+ #if BSD
+ #undef BSD
+ #include <sys/param.h>
+ #endif
+ 
  #if	BSD || WMCS || SUN || XENIX || HPUX8 || HPUX9 || AVIION || USG || AUX
  #include <sys/errno.h>
+ #if !(defined(BSD) && (BSD >= 199103))
  extern int sys_nerr;		/* number of system error messages defined */
  extern char *sys_errlist[];	/* list of message texts */
+ #endif
  #endif
  
  #if	MSC
diff -crN --exclude=*freebsd* ue312.orig/src/unix.c ue312/src/unix.c
*** ue312.orig/src/unix.c	Wed Apr 21 11:09:20 1993
--- ue312/src/unix.c	Sat Jan 14 11:02:21 1995
***************
*** 95,101 ****
--- 95,103 ----
  
  /** Additional include files **/
  #if BSD
+ #undef      BSD				/* well, ...			*/
  #include <sys/time.h>			/* Timer definitions		*/
+ #include <sys/param.h>                  /* BSD version number		*/
  #endif /* BSD */
  #if BSD || SUN || HPUX8 || HPUX9 || AVIION
  #include <signal.h>			/* Signal definitions		*/
***************
*** 104,115 ****
--- 106,125 ----
  #include <termio.h>			/* Terminal I/O definitions	*/
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
  #if AVIION
+ #define     HAVE_TERMIOS    1
  #include <termios.h>			/* Terminal I/O definitions	*/
  #endif /* AVIION */
  #if CURSES
  #include <curses.h>			/* Curses screen output		*/
  #undef WINDOW				/* Oh no!			*/
  #endif /* CURSES */
+ #if (defined(BSD) && (BSD >= 199103))
+ #define     HAVE_TERMIOS    1
+ #include <termios.h>
+ #else
+ #define     HAVE_SGTTY      1
+ #include <sgtty.h>
+ #endif
  
  /** Completion include files **/
  /** Directory accessing: Try and figure this out... if you can! **/
***************
*** 164,185 ****
  #endif /* TERMCAP */
  
  /** Local variables **/
! #if BSD
  static struct sgttyb cursgtty;		/* Current modes		*/
  static struct sgttyb oldsgtty;		/* Original modes		*/
  static struct tchars oldtchars;		/* Current tchars		*/
  static struct ltchars oldlchars;	/* Current ltchars		*/
  static char blank[6] =			/* Blank out character set	*/
  	{ -1, -1, -1, -1, -1, -1 };
! #endif /* BSD */
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  static struct termio curterm;		/* Current modes		*/
  static struct termio oldterm;		/* Original modes		*/
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if AVIION
  static struct termios curterm;		/* Current modes		*/
  static struct termios oldterm;		/* Original modes		*/
! #endif /* AVIION */
  #if TERMCAP
  static char tcapbuf[NCAPBUF];		/* Termcap character storage	*/
  #define CAP_CL		0		/* Clear to end of page		*/
--- 174,195 ----
  #endif /* TERMCAP */
  
  /** Local variables **/
! #if HAVE_SGTTY
  static struct sgttyb cursgtty;		/* Current modes		*/
  static struct sgttyb oldsgtty;		/* Original modes		*/
  static struct tchars oldtchars;		/* Current tchars		*/
  static struct ltchars oldlchars;	/* Current ltchars		*/
  static char blank[6] =			/* Blank out character set	*/
  	{ -1, -1, -1, -1, -1, -1 };
! #endif /* HAVE_SGTTY */
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  static struct termio curterm;		/* Current modes		*/
  static struct termio oldterm;		/* Original modes		*/
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if HAVE_TERMIOS
  static struct termios curterm;		/* Current modes		*/
  static struct termios oldterm;		/* Original modes		*/
! #endif /* HAVE_TERMIOS */
  #if TERMCAP
  static char tcapbuf[NCAPBUF];		/* Termcap character storage	*/
  #define CAP_CL		0		/* Clear to end of page		*/
***************
*** 250,255 ****
--- 260,270 ----
  static int cfcolor = -1;		/* Current forground color	*/
  static int cbcolor = -1;		/* Current background color	*/
  #endif /* COLOR */
+ 
+ /*
+  * I added the K[1-5] capabilities at the end. Hopefully someone finds this
+  * useful.      -- tg
+  */
  static struct keybind keybind[] = {	/* Keybinding list		*/
  	{ "bt", SHFT|CTRL|'i' },	/* Back-tab key			*/
  	{ "k1", SPEC|'1' },		/* F1 key			*/
***************
*** 290,296 ****
  	{ "kP", SPEC|'Z' },		/* Previous page key		*/
  	{ "kR", CTRL|'Z' },		/* Scroll backward key		*/
  	{ "kr", SPEC|'F' },		/* Right arrow key		*/
! 	{ "ku", SPEC|'P' }		/* Up arrow key			*/
  };
  #endif /* TERMCAP */
  static int inbuf[NINCHAR];		/* Input buffer			*/
--- 305,316 ----
  	{ "kP", SPEC|'Z' },		/* Previous page key		*/
  	{ "kR", CTRL|'Z' },		/* Scroll backward key		*/
  	{ "kr", SPEC|'F' },		/* Right arrow key		*/
! 	{ "ku", SPEC|'P' },		/* Up arrow key			*/
!         { "K1", SPEC|'<' },		/* Keypad 7 -> Home		*/
!         { "K2", SPEC|'V' },		/* Keypad 9 -> Page Up		*/
!         { "K3", ' ' },		/* Keypad 5 			*/
!         { "K4", SPEC|'>' },		/* Keypad 1 -> End		*/
!         { "K5", CTRL|'V' }		/* Keypad 3 -> Page Down	*/
  };
  #endif /* TERMCAP */
  static int inbuf[NINCHAR];		/* Input buffer			*/
***************
*** 363,369 ****
  int ttopen()
  {
  	strcpy(os, "UNIX");
! #if BSD
  	/* Get tty modes */
  	if (ioctl(0, TIOCGETP, &oldsgtty) ||
  		ioctl(0, TIOCGETC, &oldtchars) ||
--- 383,389 ----
  int ttopen()
  {
  	strcpy(os, "UNIX");
! #if HAVE_SGTTY
  	/* Get tty modes */
  	if (ioctl(0, TIOCGETP, &oldsgtty) ||
  		ioctl(0, TIOCGETC, &oldtchars) ||
***************
*** 375,388 ****
  
  	/* Set new modes */
  	cursgtty.sg_flags |= CBREAK;
! 	cursgtty.sg_flags &= ~(ECHO|CRMOD);
  
  	/* Set tty modes */
  	if (ioctl(0, TIOCSETP, &cursgtty) ||
  		ioctl(0, TIOCSETC, blank) ||
  		ioctl(0, TIOCSLTC, blank))
  		return(-1);
! #endif /* BSD */
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  
  #if SMOS
--- 395,408 ----
  
  	/* Set new modes */
  	cursgtty.sg_flags |= CBREAK;
! 	cursgtty.sg_flags &= ~(ECHO|CRMOD|IXON|IXANY|IXOFF);
  
  	/* Set tty modes */
  	if (ioctl(0, TIOCSETP, &cursgtty) ||
  		ioctl(0, TIOCSETC, blank) ||
  		ioctl(0, TIOCSLTC, blank))
  		return(-1);
! #endif /* HAVE_SGTTY */
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  
  #if SMOS
***************
*** 437,443 ****
  		return(-1);
  	}
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if AVIION
  	/* Get modes */
  	if (tcgetattr(0, &oldterm)) {
  		perror("Cannot tcgetattr");
--- 457,463 ----
  		return(-1);
  	}
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if HAVE_TERMIOS
  	/* Get modes */
  	if (tcgetattr(0, &oldterm)) {
  		perror("Cannot tcgetattr");
***************
*** 448,455 ****
  	curterm = oldterm;
  
  	/* Set new modes */
! 	curterm.c_iflag &= ~(INLCR|ICRNL|IGNCR);
! 	curterm.c_lflag &= ~(ICANON|ISIG|ECHO);
  	curterm.c_cc[VMIN] = 1;
  	curterm.c_cc[VTIME] = 0;
  
--- 468,476 ----
  	curterm = oldterm;
  
  	/* Set new modes */
!         /* disable XON/XOFF. We want to use ^S/^Q */
! 	curterm.c_iflag &= ~(INLCR|ICRNL|IGNCR|IXON|IXANY|IXOFF);
! 	curterm.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN);
  	curterm.c_cc[VMIN] = 1;
  	curterm.c_cc[VTIME] = 0;
  
***************
*** 463,469 ****
  		perror("Cannot tcsetattr");
  		return(-1);
  	}
! #endif /* AVIION */
  
  	/* Success */
  	return(0);
--- 484,490 ----
  		perror("Cannot tcsetattr");
  		return(-1);
  	}
! #endif /* HAVE_TERMIOS */
  
  	/* Success */
  	return(0);
***************
*** 476,487 ****
  	if (reset != (char*)NULL)
  		write(1, reset, strlen(reset));
  
! #if BSD
  	if (ioctl(0, TIOCSETP, &oldsgtty) ||
  		ioctl(0, TIOCSETC, &oldtchars) ||
  		ioctl(0, TIOCSLTC, &oldlchars))
  		return(-1);
! #endif /* BSD */
  
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  #if SMOS
--- 497,508 ----
  	if (reset != (char*)NULL)
  		write(1, reset, strlen(reset));
  
! #if HAVE_SGTTY
  	if (ioctl(0, TIOCSETP, &oldsgtty) ||
  		ioctl(0, TIOCSETC, &oldtchars) ||
  		ioctl(0, TIOCSLTC, &oldlchars))
  		return(-1);
! #endif /* HAVE_SGTTY */
  
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  #if SMOS
***************
*** 492,502 ****
  		return(-1);
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
  
! #if AVIION
  	/* Set tty mode */
  	if (tcsetattr(0, TCSANOW, &oldterm))
  		return(-1);
! #endif /* AVIION */
  
  	/* Success */
  	return(0);
--- 513,523 ----
  		return(-1);
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
  
! #if HAVE_TERMIOS
  	/* Set tty mode */
  	if (tcsetattr(0, TCSANOW, &oldterm))
  		return(-1);
! #endif /* HAVE_TERMIOS */
  
  	/* Success */
  	return(0);
***************
*** 628,634 ****
  /** Grab input characters, with wait **/
  unsigned char grabwait()
  {
! #if BSD
  	unsigned char ch;
  
  	/* Perform read */
--- 649,655 ----
  /** Grab input characters, with wait **/
  unsigned char grabwait()
  {
! #if HAVE_SGTTY
  	unsigned char ch;
  
  	/* Perform read */
***************
*** 637,644 ****
  		exit(1);
  	}
  	return(ch);
! #endif /* BSD */
! #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || AVIION
  	unsigned char ch;
  
  	/* Change mode, if necessary */
--- 658,665 ----
  		exit(1);
  	}
  	return(ch);
! #endif /* HAVE_SGTTY */
! #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || HAVE_TERMIOS
  	unsigned char ch;
  
  	/* Change mode, if necessary */
***************
*** 648,656 ****
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  		ioctl(0, TCSETA, &curterm);
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if AVIION
  		tcsetattr(0, TCSANOW, &curterm);
! #endif /* AVIION */		
  	}
  
  	/* Perform read */
--- 669,677 ----
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  		ioctl(0, TCSETA, &curterm);
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if HAVE_TERMIOS
  		tcsetattr(0, TCSANOW, &curterm);
! #endif /* HAVE_TERMIOS */		
  	}
  
  	/* Perform read */
***************
*** 661,673 ****
  
  	/* Return new character */
  	return(ch);
! #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || AVIION */
  }
  
  /** Grab input characters, short wait **/
  unsigned char grabnowait()
  {
! #if BSD
  	static struct timeval timout = { 0, 500000L };
  	int count, r;
  
--- 682,694 ----
  
  	/* Return new character */
  	return(ch);
! #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || HAVE_TERMIOS */
  }
  
  /** Grab input characters, short wait **/
  unsigned char grabnowait()
  {
! #if HAVE_SGTTY
  	static struct timeval timout = { 0, 500000L };
  	int count, r;
  
***************
*** 683,690 ****
  
  	/* Perform read */
  	return(grabwait());
! #endif /* BSD */
! #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || AVIION
  	int count;
  	unsigned char ch;
  
--- 704,711 ----
  
  	/* Perform read */
  	return(grabwait());
! #endif /* HAVE_SGTTY */
! #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || HAVE_TERMIOS
  	int count;
  	unsigned char ch;
  
***************
*** 695,703 ****
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  		ioctl(0, TCSETA, &curterm);
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if AVIION
  		tcsetattr(0, TCSANOW, &curterm);
! #endif /* AVIION */		
  	}
  
  	/* Perform read */
--- 716,724 ----
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  		ioctl(0, TCSETA, &curterm);
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if HAVE_TERMIOS
  		tcsetattr(0, TCSANOW, &curterm);
! #endif /* HAVE_TERMIOS */		
  	}
  
  	/* Perform read */
***************
*** 711,717 ****
  
  	/* Return new character */
  	return(ch);
! #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || AVIION */
  }
  
  /** Queue input character **/
--- 732,738 ----
  
  	/* Return new character */
  	return(ch);
! #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || HAVE_TERMIOS */
  }
  
  /** Queue input character **/
***************
*** 879,885 ****
  	cp = getenv("TERM");
  	if (!cp) {
  		puts(TEXT182);
! /*		"Environment variable \"TERM\" not define!" */
  		exit(1);
  	}
  
--- 900,906 ----
  	cp = getenv("TERM");
  	if (!cp) {
  		puts(TEXT182);
! /*		"Environment variable \"TERM\" not defined!" */
  		exit(1);
  	}
  
***************
*** 957,971 ****
  	}
  
  	/* Set speed for padding sequences */
! #if BSD
  	ospeed = cursgtty.sg_ospeed;
! #endif /* BSD */
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  	ospeed = curterm.c_cflag & CBAUD;
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if AVIION
  	ospeed = cfgetospeed(&curterm);
! #endif /* AVIION */
  	
  	/* Send out initialization sequences */
  	putpad(capbind[CAP_IS].store);
--- 978,992 ----
  	}
  
  	/* Set speed for padding sequences */
! #if HAVE_SGTTY
  	ospeed = cursgtty.sg_ospeed;
! #endif /* HAVE_SGTTY */
  #if USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX
  	ospeed = curterm.c_cflag & CBAUD;
  #endif /* USG || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */
! #if HAVE_TERMIOS
  	ospeed = cfgetospeed(&curterm);
! #endif /* HAVE_TERMIOS */
  	
  	/* Send out initialization sequences */
  	putpad(capbind[CAP_IS].store);