9.4 Top-level History

Sweep top-level buffers provide a history of previous user inputs, similarly to other comint-mode derivatives such as shell-mode. To insert the last input from the history at the prompt, use M-p (comint-previous-input). See (emacs)Shell History, for a full description of history related commands.

User Option: sweeprolog-top-level-min-history-length

Minimum input length to record in the history of Sweep top-levels.

User Option: sweeprolog-top-level-persistent-history

How to persist input history for top-levels across Emacs sessions.

The Sweep top-level history only records inputs whose length is at least sweeprolog-top-level-min-history-length characters. This user option is set to 3 by default, and should generally be set to at least 2 to keep the history from being clobbered with single-character inputs, which are common in the top-level interaction, for example ; as used to invoke backtracking.

Sweep can optionally persist top-level input history. The user option sweeprolog-top-level-persistent-history controls if and where top-levels store their persistent history: when this option is non-nil, Sweep top-level buffers that you create read their input history from a persistent history file, and write their history back to it when you delete them. If this option is a string, it is treated as a file name, and top-level buffers use that file to persistent their input history. If it’s a function, it is called with no arguments and should return either a file name for the persistent history, or nil to disable persistent history for that top-level buffer. The file name that this user option specifies can be either absolute or relative, in which case it is expanded relative to the default directory of the top-level buffer (see (emacs)File Names). This option can also be a list of the form (project rel def), in which case the persistent history file that a top-level buffer uses depends on the current project of the of that buffer (see (emacs)Projects). If there is no current project, the top-level persistent history file is def. Otherwise, the history file is rel relative to the project’s root directory. You can leave def nil or omit it entirely to disable persistent history for top-levels that are not associated with any project. By default, this option is set to nil which says not to keep persistent top-level history.