Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!helios.ee.lbl.gov!nosc!humu!uhccux!julian From: julian@uhccux.uhcc.hawaii.edu (Julian Cowley) Newsgroups: comp.emacs Subject: Re: 132 characters/line in emacs? Summary: use send-string-to-terminal Message-ID: <2544@uhccux.uhcc.hawaii.edu> Date: 29 Oct 88 03:16:58 GMT References: <973@osupyr.mast.ohio-state.edu> <8810211439.AA29897@cadillac.cad.mcc.com> Reply-To: julian@uhccux.uhcc.hawaii.edu (Julian Cowley) Organization: University of Hawaii at Manoa Lines: 35 In article 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."