Function: gptel-highlight-mode
gptel-highlight-mode is an interactive and natively compiled function
defined in gptel.el.
Signature
(gptel-highlight-mode &optional ARG)
Documentation
Visually highlight LLM respones regions.
Highlighting is via fringe or margin markers, and optionally a response
face. See gptel-highlight-methods for highlighting methods, and
gptel-response-highlight and gptel-response-fringe-highlight for the
faces.
This minor mode can be used anywhere in Emacs, and not just gptel chat buffers.
This is a minor mode. If called interactively, toggle the
Gptel-Highlight mode mode. If the prefix argument is positive, enable
the mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate the variable gptel-highlight-mode(var)/gptel-highlight-mode(fun).
The mode's hook is called both when the mode is enabled and when it is disabled.
Key Bindings
This command is not in any keymaps.
Source Code
;; Defined in /nix/store/q3r7g81pvghw7a523kjk2k2zih3pfk8z-emacs-packages-deps/share/emacs/site-lisp/elpa/gptel-20261002.545/gptel.el
(define-minor-mode gptel-highlight-mode
"Visually highlight LLM respones regions.
Highlighting is via fringe or margin markers, and optionally a response
face. See `gptel-highlight-methods' for highlighting methods, and
`gptel-response-highlight' and `gptel-response-fringe-highlight' for the
faces.
This minor mode can be used anywhere in Emacs, and not just gptel chat
buffers."
:lighter nil
:global nil
(cond
(gptel-highlight-mode
(when (memq 'margin gptel-highlight-methods)
(setq left-margin-width (1+ left-margin-width))
(if-let* ((win (get-buffer-window (current-buffer))))
(set-window-buffer win (current-buffer))))
(jit-lock-register #'gptel-highlight--update)
(gptel-highlight--update (point-min) (point-max)))
(t (when (memq 'margin gptel-highlight-methods)
(setq left-margin-width (max (1- left-margin-width) 0))
(if-let* ((win (get-buffer-window (current-buffer))))
(set-window-buffer win (current-buffer))))
(jit-lock-unregister #'gptel-highlight--update)
(without-restriction
(remove-overlays nil nil 'gptel-highlight t)))))