🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.acorn.tech
3 messages
3 total messages Started by M Y Ben Gershon Sun, 27 Dec 1992 23:52
MicroEmacs 3.11c/RISCiX
#512
Author: M Y Ben Gershon
Date: Sun, 27 Dec 1992 23:52
16 lines
1357 bytes
RISCiX 1.21 comes with MicroEmacs 3.9.  It works in an xterm window, being
resized whenever the window is resized.  I have tried without much success to
get MicroEmacs 3.11c todo the same.  I can get it to work properly, but
without responding to the xterm window being resized.  Having seen it work
on oter systems, I cannot believe that this is a RISCiX 'exclusive'.  Does
anyone know what flags i ought to be setting to get it to work?  Before you all
say use TERMCAP, you ought to know that it doesn't work, as the xterm and avc
termcap entries both have li and co commented out, and MicroEmacs responds
with a message that the screen is too small.  I guess that some interreaction
with termcap is likely, as the binary distributed with RISCiX has the Micro-
Emacs termcap file compiled.

Manybe someone at Aocrn who knows about RISCiX can help?

Michael Ben-Gershon
mybg@doc.ic.ac.uk
Re: MicroEmacs 3.11c/RISCiX
#513
Author: Andy Mell
Date: Mon, 28 Dec 1992 20:59
24 lines
1604 bytes
In article <1hlfkeINNbu1@swan.doc.ic.ac.uk> mybg@doc.ic.ac.uk (M Y Ben Gershon) writes:
>RISCiX 1.21 comes with MicroEmacs 3.9.  It works in an xterm window, being
>resized whenever the window is resized.  I have tried without much success to
>get MicroEmacs 3.11c todo the same.  I can get it to work properly, but
>without responding to the xterm window being resized.  Having seen it work
>on oter systems, I cannot believe that this is a RISCiX 'exclusive'.  Does

Window resizing has nothing at all to do with termcap, you are mistaken, it
relies on a SIGWINCH signal being sent to the process when its window is
resized. The key to making microemacs refresh properly in a differently
sized window is to intercept SIGWINCH with signal() or other somesuch, 
obtain the window sizes and refresh.

It is more than likely you are not using the correct #defines, so go through
the source again, and find what #define that SIGWINCH use is conditional on.

Andy


-- 
-------------------------------------------------------------------------------
Andy Mell, Applied Physics Department,  |   andy@santafe.edu
University of Hull, Hull, HU7 6RX       |   amell@nyx.cs.du.edu
England.                                |   torq@gnu.ai.mit.edu
Re: MicroEmacs 3.11c/RISCiX
#821
Author: Steve "daffy" Hunt
Date: Mon, 04 Jan 1993 16:34
180 lines
5130 bytes
M Y Ben Gershon (mybg@doc.ic.ac.uk) wrote:
: Manybe someone at Aocrn who knows about RISCiX can help?


Basically it's very easy; intercept SIGWINCH.  The patch below
is what I did to incorporate it into 3.9; I'm sure it could
be adapted to work on more recent versions.

Our source tree contains the following log entry:-

1.3:  bsd.2
88/09/23 13:40:25;  author: steve
Made BSD version follow changes in window size.  Dependent on the
flag FOLLOW_WINDOW_SIZE in estruct.h.  Modules affected: estruct.h,
tcap.c

-- Steve

---------------- CUT HERE ----------------
*** old/estruct.h	Mon Jan  4 16:28:14 1993
--- estruct.h	Fri Sep 23 14:40:25 1988
***************
*** 112,117 ****
--- 112,126 ----
  #define ASCII	1	/* always using ASCII char sequences for now	*/
  #define EBCDIC	0	/* later IBM mainfraim versions will use EBCDIC	*/
  
+ #define FOLLOW_WINDOW_SIZE 1	/* BSD only; if the kernel's idea of    */
+ 				/* window size is sensible, use it	*/
+ 				/* rather than the size gleaned from	*/
+ 				/* TERMCAP.  Also, follow any SIGWINCH	*/
+ 				/* signals that come along.		*/
+ 
+ #define WINDOW_MAX_ROWS 100	/* if FOLLOW_WINDOW_SIZE, then restrict	*/
+ #define WINDOW_MAX_COLS 200	/* window to being this size */
+ 
  /*	System dependant library redefinitions, structures and includes	*/
  
  #if	TURBO
*** old/tcap.c	Mon Jan  4 16:28:25 1993
--- tcap.c	Mon Jan  4 16:29:31 1993
***************
*** 10,15 ****
--- 10,20 ----
  
  #if TERMCAP
  
+ #if BSD && FOLLOW_WINDOW_SIZE
+ #include <sys/ioctl.h>
+ #include <signal.h>
+ #endif
+ 
  #define	MARGIN	8
  #define	SCRSIZ	64
  #define	NPAUSE	10			/* # times thru update to pause */
***************
*** 69,74 ****
--- 74,106 ----
  #endif
  };
  
+ #if (BSD) && (FOLLOW_WINDOW_SIZE)
+ 
+ /*
+  * Signal handler for any SIGWINCH signals that might appear.
+  */
+ 
+ window_changed () {
+     int mycols, myrows;
+     struct winsize wininfo;
+ 
+     signal (SIGWINCH, SIG_IGN);
+     if (ioctl (1, TIOCGWINSZ, &wininfo) == 0) {
+ 	/* ioctl successful */
+ 	myrows = wininfo.ws_row;
+ 	mycols = wininfo.ws_col;
+ 	if (myrows > 0 && mycols > 0) {
+ 	    if (myrows - 1 > term.t_mrow) myrows = term.t_mrow;
+ 	    if (mycols > term.t_mcol) mycols = term.t_mcol;
+ 	    newsize (TRUE, myrows);
+ 	    newwidth (TRUE, mycols);
+ 	}
+     }
+     update (TRUE);
+     signal (SIGWINCH, window_changed);
+ }
+ #endif
+ 
  tcapopen()
  
  {
***************
*** 91,108 ****
                  exit(1);
          }
  
!        if ((term.t_nrow=(short)tgetnum("li")-1) == -1){
!                puts("termcap entry incomplete (lines)");
!                exit(1);
!        }
  	term.t_mrow =  term.t_nrow;
  
!        if ((term.t_ncol=(short)tgetnum("co")) == -1){
!                puts("Termcap entry incomplete (columns)");
!                exit(1);
!        }
  	term.t_mcol = term.t_ncol;
  
          p = tcapbuf;
          t = tgetstr("pc", &p);
          if(t)
--- 123,187 ----
                  exit(1);
          }
  
! #if BSD && FOLLOW_WINDOW_SIZE
! 
! 	term.t_mrow = WINDOW_MAX_ROWS;	/* max size that the screen can attain */
! 	term.t_mcol = WINDOW_MAX_COLS;
! 
! /* Prefer the screen dimensions as the kernel believes */
! /* If this has silly entries (0) then use termcap-specified sizes */
! 
! 	{	struct winsize wininfo;
! 		int window_size_sensible = FALSE;
! 
! 		if (ioctl (1, TIOCGWINSZ, &wininfo) == 0)
! 		{
! 			if (wininfo.ws_row > 0 && wininfo.ws_col > 0)
! 			{
! 				term.t_nrow = wininfo.ws_row - 1;
! 				term.t_ncol = wininfo.ws_col - 1;
! 				window_size_sensible = TRUE;
! 			}
! 		}
! 
! 		if (!window_size_sensible)
! 		{
! 			/* Try for termcap's window size */
! 			if ((term.t_nrow=(short)tgetnum("li")-1) == -1)
! 			{
! 				puts("termcap entry incomplete (lines)");
! 				exit(1);
! 			}
! 		
! 			if ((term.t_ncol=(short)tgetnum("co")) == -1)
! 			{
! 				puts("Termcap entry incomplete (columns)");
! 				exit(1);
! 			}
! 		}
! 	}
! 
! 	if (term.t_nrow > term.t_mrow) term.t_nrow = term.t_mrow;
! 	if (term.t_ncol > term.t_mcol) term.t_ncol = term.t_mcol;
! 
! 	signal (SIGWINCH, window_changed);
! 
! #else
! 
! 	if ((term.t_nrow=(short)tgetnum("li")-1) == -1){
! 		puts("termcap entry incomplete (lines)");
! 		exit(1);
! 	}
  	term.t_mrow =  term.t_nrow;
  
! 	if ((term.t_ncol=(short)tgetnum("co")) == -1){
! 		puts("Termcap entry incomplete (columns)");
! 		exit(1);
! 	}
  	term.t_mcol = term.t_ncol;
  
+ #endif
+ 		
          p = tcapbuf;
          t = tgetstr("pc", &p);
          if(t)
---------------- CUT HERE ----------------
-- 
				Steve Hunt	steve@acorn.co.uk
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads