[comp.emacs] 132 characters/line in emacs?

karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) (10/21/88)

dkw@osupyr.mast.ohio-state.edu (David Keith Wall) writes:
   I need to edit some files that contain more than eighty characters
   per line, but even if I switch the terminal to 132 char/line mode,
   emacs still gives me only 80 char/line, with the right-hand side
   of the screen left blank. I have examined the manual pages for
   emacs and they say nothing about screen width. Does anyone know of
   a way to force emacs to display 132 characters/line?

The terminal width used by emacs is dependent on the termcap
description for your terminal.  Check /etc/termcap to see if there is
a description for your terminal (probably with a name like vt100-w,
for `wide') which shows co#132 in it, for 132 columns.  Change your
terminal type to that name and start a fresh emacs.

--Karl
-=-
Peace, love, sunshine, grooviness, brotherhood, and daisies...

bob@allosaur.cis.ohio-state.edu (Bob Sutterfield) (10/21/88)

In article <973@osupyr.mast.ohio-state.edu>, dkw@osupyr.mast.ohio-state.edu (David Keith Wall) writes:
>Does anyone know of a way to force emacs to display 132
>characters/line?

I just grab the window and stretch it to cover more of the screen.  If
that isn't enough, try x-set-font and use a smaller font that can fit
more characters in the same acreage - sailr6 is good for that, if not
for readability.

You'll still be constrained by MScreenWidth and MScreenLength in
src/config.h.  The default is 300 for each.  If you need to look at
something bigger than that, you'll have to recompile Emacs.

(BTW, this is a good way to give gomoku a closer approximation to an
infinite playing field.)
-=-
Zippy sez,								--Bob
Hello.  Just walk along and try NOT to think about your
 INTESTINES being almost FORTY YARDS LONG!!

exodus@mfgfoc.uucp (Greg Onufer) (10/21/88)

From article <25249@tut.cis.ohio-state.edu>, by karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste):
> dkw@osupyr.mast.ohio-state.edu (David Keith Wall) writes:
>    I need to edit some files that contain more than eighty characters
>    per line, but even if I switch the terminal to 132 char/line mode,
>    emacs still gives me only 80 char/line, with the right-hand side
> 
> The terminal width used by emacs is dependent on the termcap
> description for your terminal.  Check /etc/termcap to see if there is
> a description for your terminal (probably with a name like vt100-w,
> for `wide') which shows co#132 in it, for 132 columns.  Change your
> terminal type to that name and start a fresh emacs.

Also, interactively (ie. no termcap changes, on the fly, etc):

	(set-screen-width 132)

Will set the width and redraw the screen.  You can obviously change back
in the middle of the editing session with nor problems.
Also works with the screen heigth.  No guarantees... just works with
18.52 on my Sun-2.

grout@cadillac.cad.mcc.COM (Steve Grout) (10/21/88)

Wall writes -
 > I need to edit some files that contain more than eighty characters
 > per line, but even if I switch the terminal to 132 char/line mode,
 > emacs still gives me only 80 char/line, with the right-hand side
 > of the screen left blank. I have examined the manual pages for
 > emacs and they say nothing about screen width. Does anyone know of
 > a way to force emacs to display 132 characters/line?

While there are large terminal settings in TERMCAP, one can also use the
command,
    % tset -s -I $TERM > {filename}
and capture an environment setup in a file.

Then merely edit the file so that the number of lines, "li:",
and number of columns, "co:", are as desired.

To force them to into place, do:
  % source {filename}
For a permanent solution, place the above 'source' command into
your $HOME/.login.

GNU-emacs will readily use your custom values.

A typical terminal setup file would look like:

------------------- begin 80 by 50 vt100 setup file listing: --------
# Use this to set up for using vt100 emulation with symbolics etc.
#
# To use, give the following command:    source {this file name}
#
# Stallman's TERMS note says gnu-emacs will not USE ^M, ^J, or ^H unless
# the following are specified: cr, do, and le.
# (E.g., it will not move down with ^J which
# the Symbolics Telnet vt100 emulator treats as a down-and-clear-line!) 
# --------------------------------------
# The following originally was the vt100 termcap entry.
# --------------------------------------
unset term
unsetenv TERM
unsetenv TERMCAP
set term=vt100
set noglob;
setenv TERM vt100 ;
setenv TERMCAP 'd0|vt100|vt100-am:bl=^G:co#80:li#50:cl=50\E[;H\E[2J:am:bs:km:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:sr=2*\EM:sf=2*\ED:vt#3:xn:sc=\E7:ue=2\E[m:md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[2
4;1H:rf=/usr/lib/tabset/vt100:rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:ta=^I:pt:rc=\E8:cs=\E[%i%d;%dr:';
unset noglob;
------------------- end included listing ----------------------

--Steve Grout

Steve Grout, MCC CAD Program | Box 200195, Austin, TX 78720
ARPA: grout@mcc.com          | Phone: [512] 338-3516
UUCP: {uunet,harvard,gatech,pyramid}!cs.utexas.edu!milano!cadillac!grout

andrew@jung.harlqn.uucp (Andrew Watson) (10/24/88)

To check what height/width gnu emacs is using for the screen:

ESC-ESC (screen-height)          -or-     ESC-ESC (screen-width)

To set it:

ESC-ESC (set-screen-height nn)   -or-     ESC-ESC (set-screen-width nn)

When I want to read wide listings I flip my VT-220 clone into 132-column mode
from the keyboard setup menu, then tell gnu about it this way.

Follow-up question: Is there an sequence I can transmit from the host to flip
the screen width on a 220? (ie: can I define an emacs command to do both parts
of the screen widening/shrinking?
--
			       Regards,

                                   Andrew.

+-----------------------------------------------------------------------------+
|     Andrew Watson, Harlequin Limited,              andrew@uk.co.harlqn      |
|     Barrington Hall, Barrington,                   Tel: +44 223 872522      |
|     Cambridge CB2 5RG, UK                          Fax: +44 223 872519      |
+-----------------------------------------------------------------------------+

julian@uhccux.uhcc.hawaii.edu (Julian Cowley) (10/29/88)

In article <ANDREW.88Oct24151734@jung.harlqn.uucp> andrew@jung.harlqn.uucp (Andrew Watson) writes:
>Follow-up question: Is there an sequence I can transmit from the host to flip
>the screen width on a 220? (ie: can I define an emacs command to do both parts
>of the screen widening/shrinking?

Yes, there is a function called (send-string-to-terminal STR), which
you can use to send the string STR to the terminal untranslated.  So,
have it send the escape codes to switch to 132- or 80-column mode on
your VT220 (you'll have to look the codes up in your terminal manual),
and place them in the following function in place of the strings
"WIDE" and "NORMAL" (use \e for escape):

(defvar screen-wide-flag nil
  "Flag indicating the screen is in wide-column mode, or nil if otherwise.")

(defun toggle-screen-width ()
  "Toggle the screen between 132/80-column mode."
  (interactive)
  (if (setq screen-wide-flag (not screen-wide-flag))
      (progn
	(send-string-to-terminal "WIDE") ; string to set terminal to wide
					 ; screen
	(set-screen-width 132))
    (send-string-to-terminal "NORMAL")	; string to set terminal back to
					; normal width
    (set-screen-width 80)))

You can place this in the relevant term/*.el files so that it gets
loaded automatically whenever you are using a terminal that can change
screen widths.  Just change the terminal dependent strings.

julian@uhccux.uhcc.hawaii.edu
uunet!ucsd!nosc!uhccux!julian
julian@uhccux.bitnet
"People who aren't amused don't talk."

moore@cygnusx1.cs.utk.edu (Keith Moore) (11/03/88)

In article <ANDREW.88Oct24151734@jung.harlqn.uucp> andrew@jung.harlqn.uucp (Andrew Watson) writes:
>Follow-up question: Is there an sequence I can transmit from the host to flip
>the screen width on a 220? (ie: can I define an emacs command to do both parts
>of the screen widening/shrinking?

[To which julian@uhccux.uhcc.hawaii.edu (Julian Cowley) replied
 (in article <2544@uhccux.uhcc.hawaii.edu>) with a suggestion
 that the (send-string-to-terminal STR) function be used to switch
 the terminal between the two modes, and giving an example Emacs
 lisp function to accomplish this.]

The only problem with this is that the padding delays for some terminals are 
different for 132 column mode than for 80 column mode.  You may have to use a 
termcap entry that assumes 132-column mode, and switch to 80 columns once you
are in emacs.

Keith Moore
UT Computer Science Dept.	Internet/CSnet: moore@utkcs2.cs.utk.edu
107 Ayres Hall, UT Campus	BITNET: moore@utkcs1
Knoxville Tennessee 37996-1301	Telephone: +1 615 974 0822
Keith Moore
UT Computer Science Dept.	Internet/CSnet: moore@utkcs2.cs.utk.edu
107 Ayres Hall, UT Campus	BITNET: moore@utkcs1
Knoxville Tennessee 37996-1301	Telephone: +1 615 974 0822

julian@uhccux.uhcc.hawaii.edu (Julian Cowley) (11/03/88)

In article <625@utkcs2.cs.utk.edu> moore@cygnusx1.cs.utk.edu (Keith Moore) writes:
>The only problem with this is that the padding delays for some terminals are 
>different for 132 column mode than for 80 column mode.  You may have to use a 
>termcap entry that assumes 132-column mode, and switch to 80 columns once you
>are in emacs.

This brings up one reason why you might want to read a new termcap
entry while in Emacs.  For instance, in addition to the above, you
could use it to debug termcap entries.  Of course, this would have to
be coded in C, but I don't think it would be too hard.

julian@uhccux.uhcc.hawaii.edu
uunet!ucsd!nosc!uhccux!julian
julian@uhccux.bitnet