\begindata{text,538374540}
\textdsversion{12}
\template{help}
\define{global
}
\chapter{Editing files and messages from within CUI

(Keyword: cui-edit)}


\section{How to access a text editor from \helptopic{CUI}

}
There are three CUI commands which display your current message or a file in a 
text editor.  


"View" inserts the message you are currently reading (or the one you specify 
by giving a number as in "view 13") into an editor so that you can page or 
scroll it both forward and backward.  You cannot, however, make any changes to 
a message that you read using "view."


"Editfile" at the CUI> prompt takes the name of a file and allows you to edit 
the file if you need to during the course of a CUI session.  "Editfile" is an 
expert level command.  Notice that if you are using CUI from a typescript, CUI 
will call an editor but will not insert the file you want to edit into it if 
the editor forks off a window.  Thus it is not a good idea to use "editfile" 
while on an Andrew workstation, unless you want to use an editor like "ex".


"Edit" at the CUI SEND> prompt creates a unique file in /tmp and inserts the 
message you are currently writing into a file, and then calls an editor on 
that file so that you can then make changes to it.  When you exit the editor, 
the file is then inserted back into the message so that the revised text is 
now the message.  On an Andrew workstation, this is not functional, for the 
same reason "editfile" is not functional; if you open a new window, the window 
will not communicate correctly with CUI.  If you are not on a workstation, in 
order for the edit command to work correctly, the editor CUI calls must be 
functional on the terminal you are using.  To make sure this CUI chooses the 
correct editor, see the section below.  


\section{How "view", "edit", and "editfile" choose which editor to use

}
The "view", "edit" and "editfile" commands choose which editor to use in the 
same way.  The editor that they choose depends on how you are accessing the 
Andrew workstation on which you are running CUI.


\description{If you are using the PC server, CUI will use the local (PC-based) 
editor of your choice when you edit a message or file.  You specify which 
editor you want to use by giving the command "set editor=B:e.exe" at the DOS 
prompt.  Replace the small "e" after the colon with the name of your editor. 
 This command assumes that you will have this editor on a diskette in the B 
drive.  If not, you can specify which drive you want to use.  This command can 
be added to the runcui.bat file; just change the sample line there to match 
the editor of your choice.  For more information, see the PC Guide to Reading 
Mail and Bulletin Boards.


If you are using an Andrew workstation, or are are logged in to Andrew via 
telnet or a dialup, CUI will use the editor specified in the EDITOR 
environment variable. By default, EDITOR is set to /usr/andrew/bin/edittext, 
which is useless and even potentially problematical if you use the "editfile" 
or "edit" command.  (If EDITOR is set to /usr/andrew/bin/edittext and someone 
is running the window manager on the machine to which you are telnetted, you 
will open an EditText window on their screen, but it will not have the message 
or file you want to edit in it.)  You can override the EDITOR environment 
variable temporarily by using the "set editor" command in CUI (it is an expert 
level command), or more permanently by changing the EDITOR default setting by 
editing your .login file.  You should add the following line to your .login 
(note the dot at the front of the name) in your home directory, before a 
session with CUI, to change the value of EDITOR:


	setenv EDITOR "/usr/local/bin/emacs"

 

}\section{Related Tools}


Select (highlight) one of the italicized names and choose "Show Help on 
Selected Word" from the pop-up menu to see the help document for:


\description{\italic{\leftindent{\helptopic{CUI}

\helptopic{cui-expert}}}\leftindent{                  Expert-level commands in 
CUI

\italic{\helptopic{cui-wizard}}                 Wizard-level commands in CUI 

\italic{\helptopic{cui-filtering}}                How to do header filtering

\italic{\helptopic{cui-classification}}       Classifying messages with CUI 

\italic{\helptopic{cui-customization}}      Customizing CUI via the .cuirc 
file

\italic{\helptopic{cui-preferences}}         Preferences that affect CUI

\italic{\helptopic{cui-quickref}}               Quick reference list of all 
CUI commands}}


\begindata{bp,537558784}
\enddata{bp,537558784}
\view{bpv,537558784,1549,0,0}
Copyright 1992 Carnegie Mellon University and IBM.  All rights reserved.

\smaller{\smaller{$Disclaimer: 

Permission to use, copy, modify, and distribute this software and its 

documentation for any purpose is hereby granted without fee, 

provided that the above copyright notice appear in all copies and that 

both that copyright notice, this permission notice, and the following 

disclaimer appear in supporting documentation, and that the names of 

IBM, Carnegie Mellon University, and other copyright holders, not be 

used in advertising or publicity pertaining to distribution of the software 

without specific, written prior permission.



IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 

DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 

ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 

SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 

BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 

DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 

WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 

ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 

OF THIS SOFTWARE.

 $

}}\enddata{text,538374540}
