🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #2159

UNOFFICIAL patches to Epoch patch lvl 2

#2159
From: Mike Newton
Date: Tue, 05 Mar 1991 13:42
546 lines
17675 bytes
The recent patch 2 to epoch is quite nice (!), but has a few small problems...
 1. it doesnt include a few of the patches posted to the net that (at least
      i thought) were important.
 2. the handling of when time.h and sys/time.h were included was inconsistent
      between the various X related src/ files.
 3. it forced key binding to a char rather than a map (some people do not have
      ^h as their help char).
 4. it didnt include Ken Laprades mouse.c patches.
 5. it didnt include any DGUX (4.30 / 4.31) patches
 6. build-install bug fix

This _UNOFFICIAL_ patch fixes these problems.  Apply it after patch 1 and 2.
Then byte recompile any .el files that have been changed.

It should work on all machines which the original worked, and will also add
DG AViiONs, and probably help porting to other machines with the sys/time.h 
hacks.

I've been using this patch for a day, but there's obviously no guarantees...
be sure to save your old versions.

In addition, in a few days, I'll update the files on csvax to include all
the extra functionality of my earlier patch sets.

- mike (newton@gumby.cs.caltech.edu)

ps: for reference, i'm calling this patch 'e3.2.2-nc.1'



*** /u1/tmp/epoch-3.2/src/screen.c	Fri Mar  1 16:10:20 1991
--- screen.c	Mon Mar  4 18:05:44 1991
***************
*** 1530,1537 ****
      height = MIN( MAX(XFASTINT(row), 2 - (XROOT(screen) == mini_root)),
  		  MScreenLength);
  
!     dx = 2*xs->in_border + XFASTINT(col)*xs->font_width;
!     dy = 2*xs->in_border + XFASTINT(row)*xs->font_height;
      return Success == XResizeWindow(xs->display,xs->xid,dx,dy) ? Qt : Qnil;
      }
      
--- 1530,1541 ----
      height = MIN( MAX(XFASTINT(row), 2 - (XROOT(screen) == mini_root)),
  		  MScreenLength);
  
! /*   old  usage...:
!  * dx = 2*xs->in_border + XFASTINT(col)*xs->font_width;
!  * dy = 2*xs->in_border + XFASTINT(row)*xs->font_height; 
!  */
!     dx = 2*xs->in_border + width*xs->font_width;
!     dy = 2*xs->in_border + height*xs->font_height;
      return Success == XResizeWindow(xs->display,xs->xid,dx,dy) ? Qt : Qnil;
      }
      
***************
*** 1563,1568 ****
--- 1567,1573 ----
  Lisp_Object Vepoch_version;
  Lisp_Object Vepoch_bell_volume;
  Lisp_Object Vepoch_function_key_mapping;
+ Lisp_Object Vepoch_sticky_focus;
  /* list of symbols recognized for screen property alist */
  Lisp_Object Qx_cursor_glyph;
  Lisp_Object Qx_title;
***************
*** 1635,1640 ****
--- 1640,1649 ----
      DEFVAR_LISP("epoch::global-update",&Vx_global_update,
  		"If not nil, update screens with update flag set during normal updates");
      Vx_global_update = Qnil;
+ 
+     DEFVAR_LISP ("epoch::sticky-focus", &Vepoch_sticky_focus,
+   "If nil, focus follows the pointer, otherwise focus sticks with a screen.");
+     Vepoch_sticky_focus = Qnil;
  
      DEFVAR_LISP("epoch::screen-properties",&Vx_screen_properties,
  "Alist of symbol, value pairs of defaults for creating a new screen.\n\
*** /u1/tmp/epoch-3.2/src/window.c	Fri Mar  1 16:10:15 1991
--- window.c	Mon Mar  4 17:49:03 1991
***************
*** 78,84 ****
  int next_screen_context_lines;
  
  /* take care of some forward references */
! static VOID replace_window(), unshow_buffer();
  static int save_window_save();
  
  /* Incremented for each window created.  */
--- 78,84 ----
  int next_screen_context_lines;
  
  /* take care of some forward references */
! /* static VOID replace_window(), unshow_buffer(); - see 5 lines below -- MON */
  static int save_window_save();
  
  /* Incremented for each window created.  */
***************
*** 1507,1512 ****
--- 1507,1513 ----
    /*
     * [cjl] Silent failure for attempts to resize only window on screen
     */
+   /* ??? 1 or 2 in secnd line??? -- MON */
    if ((EQ(selected_window,minibuf_window)) ||
        (EQ(selected_window,Fnext_window(selected_window,make_number(1)))))
      return;
*** /u1/tmp/epoch-3.2/src/x11term.c	Fri Mar  1 16:10:08 1991
--- x11term.c	Mon Mar  4 17:21:36 1991
***************
*** 38,44 ****
  
  #include "x11term.h"
  
! #if defined(USG) && ! defined(IBMRTAIX) && !defined(OS_386ix)
  #include <time.h>
  #else
  #include <sys/time.h>
--- 38,45 ----
  
  #include "x11term.h"
  
! /* modified list as per other usages -- MON */
! #if defined(USG) && ! defined(OS_386ix) && ! defined(IRIS_4D) && ! defined(USGV4) && ! defined(IBMAIX)
  #include <time.h>
  #else
  #include <sys/time.h>
***************
*** 1394,1399 ****
--- 1395,1403 ----
          register kbd_char_t *bufp;
          register int numchars;
      {
+     /* Epoch boolean, non-nil, focus sticks with screen. */
+     extern Lisp_Object Vepoch_sticky_focus; /* by jw@sics.se; added -- MON */
+ 
      /* Number of keyboard chars we have produced so far.  */
      int count = 0;
      int nbytes,rows,cols;
***************
*** 1580,1588 ****
  		if (! event.xcrossing.focus || X_focus == 2) break;
  	    case FocusIn :
  	    case FocusOut :
! 		X_focus =
! 		    event.type == FocusIn ? 2 :
! 			(event.type == EnterNotify ? 1 : 0);
  		QUEUE_EVENT(&event);
  		if (cur_Xscreen->cursor_exists)
  		    {
--- 1584,1597 ----
  		if (! event.xcrossing.focus || X_focus == 2) break;
  	    case FocusIn :
  	    case FocusOut :
!                 X_focus =
! 		  /* event.type == FocusIn ? 2 :
! 		   *   (event.type == EnterNotify ? 1 : 0);
! 		   * from Johan Widen jw@sics.se ...
! 		   */ /* added in -- MON */
! 		  ((event.type == FocusIn)
! 		   ? ((Vepoch_sticky_focus == Qnil) ? 1 : 2)
! 		   : ((event.type == EnterNotify) ? 1 : 0));
  		QUEUE_EVENT(&event);
  		if (cur_Xscreen->cursor_exists)
  		    {
*** /u1/tmp/epoch-3.2/src/buffer.c	Thu Oct 18 17:21:36 1990
--- buffer.c	Fri Feb 22 05:01:39 1991
***************
*** 522,527 ****
--- 522,534 ----
    return Qnil;
  }
  
+ /*
+  * note : following patched with 'evenworse' to get around the 
+  * 'stuck in *scratch* buffer switch/kill cycle'.  ie: it makes
+  * buffer switching more often go someplace where the user has
+  * been active. -- MON (newton@ggumby.cs.caltech.edu)
+  */
+ 
  DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 1, 0,
    "Return most recently selected buffer other than BUFFER.\n\
  Buffers not visible in windows are preferred to visible buffers.\n\
***************
*** 530,537 ****
    (buffer)
       register Lisp_Object buffer;
  {
!   register Lisp_Object tail, buf, notsogood, tem;
!   notsogood = Qnil;
  
    for (tail = Vbuffer_alist; !NULL (tail); tail = Fcdr (tail))
      {
--- 537,544 ----
    (buffer)
       register Lisp_Object buffer;
  {
!   register Lisp_Object tail, buf, notsogood, evenworse, tem;
!   notsogood = evenworse = Qnil;
  
    for (tail = Vbuffer_alist; !NULL (tail); tail = Fcdr (tail))
      {
***************
*** 539,548 ****
        if (EQ (buf, buffer))
  	continue;
        if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ')
! 	continue;
  #ifdef CB
        if (NULL(Fmemq(Fcurrent_screen(), (XBUFFER(buf)->allowed_screens))))
! 	continue;
  #endif
        tem = Fget_buffer_window (buf);
        if (NULL (tem))
--- 546,562 ----
        if (EQ (buf, buffer))
  	continue;
        if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ')
! 	{
! 	  if (NULL(evenworse))
! 	    evenworse=buf;
! 	  continue;
! 	}
  #ifdef CB
        if (NULL(Fmemq(Fcurrent_screen(), (XBUFFER(buf)->allowed_screens))))
! 	{
! 	  evenworse = buf;
! 	  continue;
! 	}
  #endif
        tem = Fget_buffer_window (buf);
        if (NULL (tem))
***************
*** 552,557 ****
--- 566,574 ----
      }
    if (!NULL (notsogood))
      return notsogood;
+   if (!NULL (evenworse) &&
+       strncmp(XSTRING(XBUFFER(evenworse)->name)->data, " *Minibuf", 9))
+     return evenworse;
    return Fget_buffer_create (build_string ("*scratch*"));
  }
  
***************
*** 851,857 ****
    if (c == p)
      return;
  
!   if (w)
      swb = NULL (selected_window) ? 0 : XBUFFER (w->buffer);
  
    if (p && NULL (p->name))
--- 868,874 ----
    if (c == p)
      return;
  
!   if (selected_window)	/* was 'w' not 'se..' mac@kpc.com (Michael McNamara) */
      swb = NULL (selected_window) ? 0 : XBUFFER (w->buffer);
  
    if (p && NULL (p->name))
*** /u1/tmp/epoch-3.2/src/mouse.c	Tue Oct 16 11:45:04 1990
--- mouse.c	Mon Mar  4 18:28:18 1991
***************
*** 32,38 ****
  #include "x11term.h"
  #include "dispextern.h"
  #include "termchar.h"
! #ifdef USG
  #include <time.h>
  #else
  #include <sys/time.h>
--- 32,38 ----
  #include "x11term.h"
  #include "dispextern.h"
  #include "termchar.h"
! #if defined(USG) && ! defined(OS_386ix) && ! defined(IRIS_4D) && ! defined(USGV4) && ! defined(IBMAIX)
  #include <time.h>
  #else
  #include <sys/time.h>
***************
*** 251,256 ****
--- 251,258 ----
  #include "buffer.h"
  #include "indent.h"
  
+ extern int minibuf_prompt_width;
+ 
  DEFUN ("epoch::coords-to-point",Fepoch_coords_to_point,Sepoch_coords_to_point,
         2,3,0,
         "Convert X Y SCREEN in character coordinates to a list of\n\
***************
*** 258,268 ****
  	(lx,ly,screen) Lisp_Object lx,ly,screen;
  {
    Lisp_Object win,buffer,old_inhibit_quit;
!   int x,y,hscroll;
    struct W_Screen *ws, *old_ws = cur_Wscreen;
    struct window *w;
    struct buffer *b, *old_b = bf_cur;
    struct position *pos;
  
    CHECK_NUMBER(lx,0);
    CHECK_NUMBER(ly,0);
--- 260,271 ----
  	(lx,ly,screen) Lisp_Object lx,ly,screen;
  {
    Lisp_Object win,buffer,old_inhibit_quit;
!   int x,y;
    struct W_Screen *ws, *old_ws = cur_Wscreen;
    struct window *w;
    struct buffer *b, *old_b = bf_cur;
    struct position *pos;
+   int startp, hscroll;
  
    CHECK_NUMBER(lx,0);
    CHECK_NUMBER(ly,0);
***************
*** 284,290 ****
        w = XWINDOW(win);
        if (NULL(w->buffer)) continue; /* no buffer, not valid */
        if (x >= w->left && x < (w->left + w->width)
! 	  && y >= w->top && y < (w->top + w->height -1))
  	break;
        /* Looks stupid, but the problem is that we have to allow the minibuf
         * as a valid window the _first_ time through here, but not else when,
--- 287,293 ----
        w = XWINDOW(win);
        if (NULL(w->buffer)) continue; /* no buffer, not valid */
        if (x >= w->left && x < (w->left + w->width)
! 	  && y >= w->top && y < (w->top + w->height))
  	break;
        /* Looks stupid, but the problem is that we have to allow the minibuf
         * as a valid window the _first_ time through here, but not else when,
***************
*** 301,328 ****
    buffer = w->buffer;
    b = XBUFFER(buffer);
  
!   y -= XFASTINT(w->top);
!   x -= XFASTINT(w->left);
!   hscroll = XFASTINT(w->hscroll);
  
!   old_inhibit_quit = Vinhibit_quit;
!   Vinhibit_quit = Qt;		/* don't allow quits out of here */
!   SetBfx(b);
!   cur_Wscreen = ws;
!   pos = compute_motion (marker_position(w->start) +
! 			( hscroll > 0 ? hscroll-1 : 0 ),
! 			0,0,		/* starting position */
! 			NumCharacters+1,y,x,
! 			XFASTINT(w->width) - 1 -
! 			(XFASTINT(w->width) + XFASTINT(w->left) != ws->width),
! 			hscroll,0);
!   cur_Wscreen = old_ws;
!   SetBfx(old_b);
!   Vinhibit_quit = old_inhibit_quit;
  
!   /* could have gone 1 line to far, if the correct line wasn't long enough */
!   if (pos->vpos == y+1) pos->bufpos -= 1; /* backup over newline */
! 
    return Fcons(pos->bufpos,
  	       Fcons(buffer,
  		     Fcons(win,
--- 304,341 ----
    buffer = w->buffer;
    b = XBUFFER(buffer);
  
!   if (!EQ(win,minibuf_window) && y == (w->top + w->height - 1))
!     /* In mode line: return nil position. */
!     return Fcons(Qnil,
! 		 Fcons(buffer,
! 		       Fcons(win,
! 			     Fcons(screen,Qnil))));
!   else
!     {
!       y -= w->top;
!       x -= w->left;
  
!       old_inhibit_quit = Vinhibit_quit;
!       Vinhibit_quit = Qt;		/* don't allow quits out of here */
!       SetBfx(b);
!       cur_Wscreen = ws;
!       startp = marker_position (w->start);
!       hscroll = XINT (w->hscroll);
!       pos = compute_motion (startp,0,
! 			    ((EQ (win, minibuf_window) && startp == 1)
! 			     ? minibuf_prompt_width : 0)
! 			    +
! 			    (hscroll ? 1 - hscroll : 0),
! 			    NumCharacters+1,y,x,
! 			    Fwindow_width(win) - 1,hscroll,0);
!       cur_Wscreen = old_ws;
!       SetBfx(old_b);
!       Vinhibit_quit = old_inhibit_quit;
  
!       /* could have gone 1 line to far, if the correct line wasn't long enough */
!       if (pos->vpos == y+1) pos->bufpos -= 1; /* backup over newline */
!     }
!   
    return Fcons(pos->bufpos,
  	       Fcons(buffer,
  		     Fcons(win,
*** epoch-3.2/src/s-dgux-4.30.h	Tue Oct 16 11:46:17 1990
--- /e/src/s-dgux-4.30.h	Sat Jan 12 19:13:39 1991
***************
*** 1,6 ****
  /* This file contains changes made by Data General, July 1990. */
  
! /* s-dgux-4.20.h -- define parameters for 
     Data General's DG/UX 4.30 for the AViiON
  
     Copyright (C) 1989 Free Software Foundation, Inc.
--- 1,6 ----
  /* This file contains changes made by Data General, July 1990. */
  
! /* s-dgux-4.30.h -- define parameters for 
     Data General's DG/UX 4.30 for the AViiON
  
     Copyright (C) 1989 Free Software Foundation, Inc.
***************
*** 52,67 ****
  #define DGUX
  #endif
  
  #define DGUX_REV_4
! #define DGUX_REV_4_10
! #define DGUX_REV_4_20
  #define DGUX_REV_4_30
  
  /* Override some defaults in building emacs.  Do not optimize
!    unless you are running GCC 1.35.20 or later!  */
  
! #ifdef m88k
! #define C_DEBUG_SWITCH -g -W -O
  #define CC_PROGRAM gcc
  #define LD_SWITCH_SYSTEM -L/usr/lib/X11
  #define LIBS_STANDARD /usr/lib/gcc/gcc-gnulib -lc
--- 52,80 ----
  #define DGUX
  #endif
  
+ /*
+  * Do NOT define old version unless you are running them!  This
+  * will cause the code in sysdep.c to do bauding wrong. -- MON
+  */
+ 
  #define DGUX_REV_4
! /* #define DGUX_REV_4_10 */
! /* #define DGUX_REV_4_20 */
  #define DGUX_REV_4_30
  
  /* Override some defaults in building emacs.  Do not optimize
!  * unless you are running GCC 1.35.20 or later! -- MON
!  */
  
! #ifdef __GNUC__
! /* it looks like epoch has so many non-standard-ansi-standard function
!  * parameter decl's that i cant get it though 'gcc' (ansi), but 'cc' 
!  * (same program, different name) will work or we can ...
!  */
! /* due to the number of problems (crashes), lets turn off -O on Epoch 3.2 */
! /* #define C_DEBUG_SWITCH -traditional -g -W */
! /* seems to be more stable now... */
! #define C_DEBUG_SWITCH -traditional -g -W -O
  #define CC_PROGRAM gcc
  #define LD_SWITCH_SYSTEM -L/usr/lib/X11
  #define LIBS_STANDARD /usr/lib/gcc/gcc-gnulib -lc
***************
*** 340,343 ****
--- 353,371 ----
  extern int tputs (), tgetent (), tgetflag (), tgetnum ();
  #endif
  
+ 
+ /* 
+  * My changes -- newton@ggumby.cs.caltech.edu
+  *
+  * These should work w/ 4.30 ....
+  * 
+  */
  
+ #define SAFE_BCOPY_RIGHT_OVERLAP 1
+ #define SAFE_BCOPY_LEFT_OVERLAP 1
+ #undef LOAD_AVE_TYPE
+ 
+ /* This is from the dg-rtp.dg.com emacs dist -- MON  */
+ /*  Pass the environment on subshells */
+ 
+ #define	MAINTAIN_ENVIRONMENT
*** /u1/tmp/epoch-3.2/contrib/hyper/hyper-man.el	Fri Mar  1 16:08:21 1991
--- hyper-man.el	Mon Mar  4 18:17:16 1991
***************
*** 91,98 ****
  (defvar In-Hyper-Man nil)
  (defvar Error-Message)
  
! (global-set-key  "\C-hu" 'hyper-man-begin)
! (global-set-key  "\C-hi" 'pre-info)
  
  
              
--- 91,100 ----
  (defvar In-Hyper-Man nil)
  (defvar Error-Message)
  
! ; Do not define these here in case the user likes a help map on another
! ; key than C-h !   -- MON
! ;(global-set-key  "\C-hu" 'hyper-man-begin)
! ;(global-set-key  "\C-hi" 'pre-info)
  
  
              
*** epoch-3.2/build-install	Sun Oct 21 09:41:50 1990
--- /e/build-install	Sun Oct 28 21:27:31 1990
***************
*** 5,11 ****
  set EMACS=/usr/local/lib/emacs
  set BIN=/usr/local/bin
  
! /bin/sed "s;/usr/local/lib/emacs;$EMACS;" < src/paths.h-dist > src/paths.h
  
  (cd etc; make) || exit 1
  (cd src; make) || exit 1
--- 5,11 ----
  set EMACS=/usr/local/lib/emacs
  set BIN=/usr/local/bin
  
! /bin/sed "s;/usr/local/lib/emacs;$EMACS;g" < src/paths.h-dist > src/paths.h
  
  (cd etc; make) || exit 1
  (cd src; make) || exit 1
diff -c3 -r epoch-3.2/contrib/pierson/epoch-patch.el /e/contrib/pierson/epoch-patch.el
*** epoch-3.2/contrib/pierson/epoch-patch.el	Sun Oct 21 11:36:53 1990
--- /e/contrib/pierson/epoch-patch.el	Mon Oct 29 05:50:08 1990
***************
*** 178,184 ****
     (aset diff-vector 6 'b)
     (emerge-refresh-mode-line)))
  
- 
- ------- End of Forwarded Message
- 
- 
--- 178,180 ----
Technical Details
Message-ID: <newton.668180537@gumby>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!snorkelwacker.mit.edu!stanford.edu!eos!data.nas.nasa.gov!mustang!nntp-server.caltech.edu!gumby!newton

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc7ee,50bf0e22cfd842f2,start
X-Google-Attributes: gidfc7ee,public
X-Google-ArrivalTime: 1991-03-05 14:56:57 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!snorkelwacker.mit.edu!stanford.edu!eos!data.nas.nasa.gov!mustang!nntp-server.caltech.edu!gumby!newton
From: newton@gumby.cs.caltech.edu (Mike Newton)
Newsgroups: gnu.epoch.misc
Subject: UNOFFICIAL patches to Epoch patch lvl 2
Summary: munc munch
Keywords: epoch, m88k, time.h, core, purple hippos
Message-ID: <newton.668180537@gumby>
Date: 5 Mar 91 13:42:17 GMT
Sender: news@nntp-server.caltech.edu
Organization: California Institute of Technology, Pasadena
Lines: 546