Function: shell-write-history-on-exit

shell-write-history-on-exit is a byte-compiled function defined in shell.el.gz.

Signature

(shell-write-history-on-exit PROCESS EVENT)

Documentation

Called when the shell process is stopped.

Writes the input history to a history file comint-input-ring-file-name using comint-write-input-ring and inserts a short message in the shell buffer.

This function is a sentinel watching the shell interpreter process. Sentinels will always get the two parameters PROCESS and EVENT.

Source Code

;; Defined in /usr/src/emacs/lisp/shell.el.gz
(defun shell-write-history-on-exit (process event)
  "Called when the shell process is stopped.

Writes the input history to a history file
`comint-input-ring-file-name' using `comint-write-input-ring'
and inserts a short message in the shell buffer.

This function is a sentinel watching the shell interpreter process.
Sentinels will always get the two parameters PROCESS and EVENT."
  ;; Write history.
  (comint-write-input-ring)
  (let ((buf (process-buffer process)))
    (when (buffer-live-p buf)
      (with-current-buffer buf
        (insert (format "\nProcess %s %s\n" process event))))))