1mNAME0m
       history - Manipulate the history list

1mSYNOPSIS0m
       1mhistory 22m?4moption24m? ?4marg24m 4marg24m 4m...24m?


1mDESCRIPTION0m
       The  1mhistory  22mcommand  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 ``event''.  When specifying an
       event to the 1mhistory 22mcommand, the following forms may be used:

       [1]    A number:  if positive, it refers to the event with that  number
              (all events are numbered starting at 1).  If the number is nega-
              tive, it selects an event relative  to  the  current  event  (1m-10m
              refers  to the previous event, 1m-2 22mto the one before that, and so
              on).  Event 1m0 22mrefers to the current event.

       [2]    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 1mstring match0m
              command.

       The 1mhistory 22mcommand can take any of the following forms:

       1mhistory0m
              Same as 1mhistory info22m, described below.

       1mhistory add 4m22mcommand24m ?1mexec22m?
              Adds the 4mcommand24m argument to the history list as  a  new  event.
              If  1mexec  22mis specified (or abbreviated) then the command is also
              executed and its result is returned.  If  1mexec  22misn't  specified
              then an empty string is returned as result.

       1mhistory change 4m22mnewValue24m ?4mevent24m?
              Replaces  the  value recorded for an event with 4mnewValue24m.  4mEvent0m
              specifies the event to replace,  and  defaults  to  the  4mcurrent0m
              event  (not event 1m-122m).  This command is intended for use in com-
              mands 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.

       1mhistory clear0m
              Erase  the  history  list.   The current keep limit is retained.
              The history event numbers are reset.

       1mhistory event 22m?4mevent24m?
              Returns the value of the event given by 4mevent24m.   4mEvent24m  defaults
              to 1m-122m.

       1mhistory info 22m?4mcount24m?
              Returns  a formatted string (intended for humans to read) giving
              the event number and contents for each of the events in the his-
              tory  list except the current event.  If 4mcount24m is specified then
              only the most recent 4mcount24m events are returned.

       1mhistory keep 22m?4mcount24m?
              This command may be used to change the size of the history  list
              to  4mcount24m  events.   Initially,  20  events  are retained in the
              history list.  If 4mcount24m is not specified, the current keep limit
              is returned.

       1mhistory nextid0m
              Returns  the number of the next event to be recorded in the his-
              tory list.  It is useful for things like printing the event num-
              ber in command-line prompts.

       1mhistory redo 22m?4mevent24m?
              Re-executes  the  command  indicated  by  4mevent24m  and  return its
              result.  4mEvent24m defaults to 1m-122m.  This command results in  history
              revision:  see below for details.

1mHISTORY REVISION0m
       Pre-8.0  Tcl  had  a  complex  history revision mechanism.  The current
       mechanism is more limited, and the old  history  operations  1msubstitute0m
       and  1mwords  22mhave  been removed.  (As a consolation, the 1mclear 22moperation
       was added.)

       The history option 1mredo 22mresults 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 his-
       tory, then use the 1mevent 22moperation to retrieve some event, and the  1madd0m
       operation to add it to history and execute it.


1mKEYWORDS0m
