Variable: gptel-highlight-mode

gptel-highlight-mode is a buffer-local variable defined in gptel.el.

Documentation

Non-nil if Gptel-Highlight mode is enabled.

Use the command gptel-highlight-mode(var)/gptel-highlight-mode(fun) to change this variable.

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)))))