@@ -2559,6 +2559,22 @@ For each named
25592559returns the pathname, primitive, lambda, or code fragment which
25602560would be run if the program appeared as the first word of a command.
25612561.TP
2562+ .Cr " %write-history \fI input \fP "
2563+ Called at the end of
2564+ .Cr %parse
2565+ to write the
2566+ .I input
2567+ to the file given in
2568+ .Cr $history ,
2569+ if such a file exists and can be written.
2570+ Also appends the
2571+ .I input
2572+ to the in-memory history log if
2573+ .I readline
2574+ support is compiled in.
2575+ (For more on this, see
2576+ .Cr max-history-length .)
2577+ .TP
25622578.Cr " %writeto \fI var output cmd \fP "
25632579Runs
25642580.I cmd
@@ -2752,43 +2768,37 @@ writeto %writeto
27522768.ft R
27532769.De
27542770.PP
2755- The primitives
2756- .Cr resetterminal ,
2757- .Cr sethistory ,
2758- and
2759- .Cr writehistory
2760- are if
2771+ The following primitives in particular are included if
27612772.I es
27622773is compiled with support for the
27632774.I readline
2764- library.
2765- It is used in the implementation of settor functions of the
2775+ library:
2776+ .ta 2i
2777+ .Ds
2778+ .ft \*( Cf
2779+ resetterminal sethistory
2780+ setmaxhistorylength writehistory
2781+ .ft R
2782+ .De
2783+ .PP
2784+ .Cr sethistory
2785+ and
2786+ .Cr setmaxhistorylength
2787+ are used as settor functions for the
2788+ .Cr history
2789+ and
2790+ .Cr max-history-length
2791+ variables.
2792+ .Cr resetterminal
2793+ is used in the settor functions for the
27662794.Cr TERM
27672795and
27682796.Cr TERMCAP
2769- variables to notify the line editing packages that the terminal
2770- configuration has changed.
2771- .Cr sethistory
2772- is used in the
2773- .Cr set-history
2774- settor function to signal to line editing packages which history file is
2775- being used.
2797+ variables.
27762798.Cr writehistory
2777- is used in the
2799+ is used as the initial implementation of the
27782800.Cr %write-history
2779- function to log a new line to the line editing packages' internal
2780- command log, and write to the
2781- .Cr history
2782- file if that variable is set via the
2783- .Cr sethistory
2784- primitive.
2785- .Cr setmaxhistorylength
2786- is used as the settor function for the
2787- .Cr max-history-length
2788- variable, which signals to the
2789- .I readline
2790- library how much of the history file should be read into the in-memory
2791- history log.
2801+ function.
27922802.PP
27932803Several primitives are not directly associated with other function.
27942804They are:
0 commit comments