Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions chatgpt-shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,20 @@ Note: in all cases responses are written to the shell to keep context."
(const :tag "Shell" shell))
:group 'chatgpt)

(defcustom chatgpt-shell-before-command-functions nil
"Abnormal hook (i.e. with parameters) invoked before each command.

This is useful if you'd like to automatically handle or suggest things
prior to execution.

For example:

\(add-hook `chatgpt-shell-before-command-functions'
(lambda (command)
(message \"Command: %s\" command)))"
:type 'hook
:group 'shell-maker)

(defcustom chatgpt-shell-after-command-functions nil
"Abnormal hook (i.e. with parameters) invoked after each command.

Expand Down Expand Up @@ -780,6 +794,7 @@ See `shell-maker-welcome-message' as an example."
(unless (and (boundp 'shell-maker-version)
(version<= "0.79.1" shell-maker-version))
(error "Please update 'shell-maker' to v0.79.1 or newer"))
(run-hook-with-args 'chatgpt-shell-before-command-functions command)
(funcall handler
:model model
:command (if chatgpt-shell-include-local-file-link-content
Expand Down