115 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			115 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <HTML><HEAD><TITLE>Built-In Commands - history manual page</TITLE></HEAD><BODY>
 | |
| <DL>
 | |
| <DD><A HREF="history.htm#M2" NAME="L455">NAME</A>
 | |
| <DL><DD>history - Manipulate the history list</DL>
 | |
| <DD><A HREF="history.htm#M3" NAME="L456">SYNOPSIS</A>
 | |
| <DL>
 | |
| <DD><B>history </B>?<I>option</I>? ?<I>arg arg ...</I>?
 | |
| </DL>
 | |
| <DD><A HREF="history.htm#M4" NAME="L457">DESCRIPTION</A>
 | |
| <DL>
 | |
| </DL>
 | |
| <DL>
 | |
| <DD><A HREF="history.htm#M5" NAME="L458"><B>history</B></A>
 | |
| <DD><A HREF="history.htm#M6" NAME="L459"><B>history add</B><I> command </I>?<B>exec</B>?</A>
 | |
| <DD><A HREF="history.htm#M7" NAME="L460"><B>history change</B><I> newValue</I> ?<I>event</I>?</A>
 | |
| <DD><A HREF="history.htm#M8" NAME="L461"><B>history clear</B></A>
 | |
| <DD><A HREF="history.htm#M9" NAME="L462"><B>history event</B> ?<I>event</I>?</A>
 | |
| <DD><A HREF="history.htm#M10" NAME="L463"><B>history info </B>?<I>count</I>?</A>
 | |
| <DD><A HREF="history.htm#M11" NAME="L464"><B>history keep </B>?<I>count</I>?</A>
 | |
| <DD><A HREF="history.htm#M12" NAME="L465"><B>history nextid</B></A>
 | |
| <DD><A HREF="history.htm#M13" NAME="L466"><B>history redo </B>?<I>event</I>?</A>
 | |
| </DL>
 | |
| <DD><A HREF="history.htm#M14" NAME="L467">HISTORY REVISION</A>
 | |
| <DD><A HREF="history.htm#M15" NAME="L468">KEYWORDS</A>
 | |
| </DL><HR>
 | |
| <H3><A NAME="M2">NAME</A></H3>
 | |
| history - Manipulate the history list
 | |
| <H3><A NAME="M3">SYNOPSIS</A></H3>
 | |
| <B>history </B>?<I>option</I>? ?<I>arg arg ...</I>?<BR>
 | |
| <H3><A NAME="M4">DESCRIPTION</A></H3>
 | |
| The <B>history</B> command performs one of several operations related to
 | |
| recently-executed commands recorded in a history list.  Each of
 | |
| these recorded commands is referred to as an ``<A HREF="../TclCmd/event.htm">event</A>''.  When
 | |
| specifying an event to the <B>history</B> command, the following
 | |
| forms may be used:
 | |
| <P>
 | |
| <DL>
 | |
| <P><DT>[1]<DD>
 | |
| A number:  if positive, it refers to the event with
 | |
| that number (all events are numbered starting at 1).  If the number
 | |
| is negative, it selects an event relative to the current event
 | |
| (<B>-1</B> refers to the previous event, <B>-2</B> to the one before that, and
 | |
| so on).  Event <B>0</B> refers to the current event.
 | |
| <P><DT>[2]<DD>
 | |
| A string:  selects the most recent event that matches the string.
 | |
| An event is considered to match the string either if the string is
 | |
| the same as the first characters of the event, or if the string
 | |
| matches the event in the sense of the <B><A HREF="../TkCmd/string.htm">string match</A></B> command.
 | |
| <P></DL>
 | |
| <P>
 | |
| The <B>history</B> command can take any of the following forms:
 | |
| <P>
 | |
| <DL>
 | |
| <P><DT><A NAME="M5"><B>history</B></A><DD>
 | |
| Same
 | |
| as <B>history info</B>, described below.
 | |
| <P><DT><A NAME="M6"><B>history add</B><I> command </I>?<B>exec</B>?</A><DD>
 | |
| Adds the <I>command</I> argument to the history list as a new event.  If
 | |
| <B>exec</B> is specified (or abbreviated) then the command is also
 | |
| executed and its result is returned.  If <B>exec</B> isn't specified
 | |
| then an empty string is returned as result.
 | |
| <P><DT><A NAME="M7"><B>history change</B><I> newValue</I> ?<I>event</I>?</A><DD>
 | |
| Replaces the value recorded for an event with <I>newValue</I>.  <I>Event</I>
 | |
| specifies the event to replace, and
 | |
| defaults to the <I>current</I> event (not event <B>-1</B>).  This command
 | |
| is intended for use in commands that implement new forms of history
 | |
| substitution and wish to replace the current event (which invokes the
 | |
| substitution) with the command created through substitution.  The return
 | |
| value is an empty string.
 | |
| <P><DT><A NAME="M8"><B>history clear</B></A><DD>
 | |
| Erase the history list.  The current keep limit is retained.
 | |
| The history event numbers are reset.
 | |
| <P><DT><A NAME="M9"><B>history event</B> ?<I>event</I>?</A><DD>
 | |
| Returns the value of the event given by <I>event</I>.  <I>Event</I>
 | |
| defaults to <B>-1</B>.
 | |
| <P><DT><A NAME="M10"><B>history info </B>?<I>count</I>?</A><DD>
 | |
| Returns a formatted string (intended for humans to read) giving
 | |
| the event number and contents for each of the events in the history
 | |
| list except the current event.  If <I>count</I> is specified
 | |
| then only the most recent <I>count</I> events are returned.
 | |
| <P><DT><A NAME="M11"><B>history keep </B>?<I>count</I>?</A><DD>
 | |
| This command may be used to change the size of the history list to
 | |
| <I>count</I> events.  Initially, 20 events are retained in the history
 | |
| list.  If <I>count</I> is not specified, the current keep limit is returned.
 | |
| <P><DT><A NAME="M12"><B>history nextid</B></A><DD>
 | |
| Returns the number of the next event to be recorded
 | |
| in the history list.  It is useful for things like printing the
 | |
| event number in command-line prompts.
 | |
| <P><DT><A NAME="M13"><B>history redo </B>?<I>event</I>?</A><DD>
 | |
| Re-executes the command indicated by <I>event</I> and return its result.
 | |
| <I>Event</I> defaults to <B>-1</B>.  This command results in history
 | |
| revision:  see below for details.
 | |
| <P></DL>
 | |
| <H3><A NAME="M14">HISTORY REVISION</A></H3>
 | |
| Pre-8.0 Tcl had a complex history revision mechanism.
 | |
| The current mechanism is more limited, and the old
 | |
| history operations <B>substitute</B> and <B>words</B> have been removed.
 | |
| (As a consolation, the <B>clear</B> operation was added.)
 | |
| <P>
 | |
| The history option <B>redo</B> results in much simpler ``history revision''.
 | |
| When this option is invoked then the most recent event
 | |
| is modified to eliminate the history command and replace it with
 | |
| the result of the history command.
 | |
| If you want to redo an event without modifying history, then use
 | |
| the <B><A HREF="../TclCmd/event.htm">event</A></B> operation to retrieve some event,
 | |
| and the <B>add</B> operation to add it to history and execute it.
 | |
| 
 | |
| <H3><A NAME="M15">KEYWORDS</A></H3>
 | |
| <A href="../Keywords/E.htm#event">event</A>, <A href="../Keywords/H.htm#history">history</A>, <A href="../Keywords/R.htm#record">record</A>
 | |
| <HR><PRE>
 | |
| <A HREF="../copyright.htm">Copyright</A> © 1993 The Regents of the University of California.
 | |
| <A HREF="../copyright.htm">Copyright</A> © 1994-1997 Sun Microsystems, Inc.
 | |
| <A HREF="../copyright.htm">Copyright</A> © 1995-1997 Roger E. Critchlow Jr.</PRE>
 | |
| </BODY></HTML>
 | 
