Function: magit-todos-mode

magit-todos-mode is an interactive and natively compiled function defined in magit-todos.el.

Signature

(magit-todos-mode &optional ARG)

Documentation

Show list of to-do items in Magit status buffer for tracked files in repo.

This is a global minor mode. If called interactively, toggle the Magit-Todos 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 (default-value \=magit-todos-mode)'.

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/xy37aj9089qvbs5clw0qszpi3hrh3mxx-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-todos-20250928.1611/magit-todos.el
;;;; Commands

;;;###autoload
(define-minor-mode magit-todos-mode
  "Show list of to-do items in Magit status buffer for tracked files in repo."
  :require 'magit-todos
  :group 'magit-todos
  :global t
  (if magit-todos-mode
      (progn
        (transient-append-suffix #'magit-status-jump
          '(0 -1) '[("T" "Todos" magit-todos-jump-to-todos)
                    ("l" "List todos" magit-todos-list)])
        (magit-add-section-hook 'magit-status-sections-hook
                                #'magit-todos--insert-todos
                                nil
                                'append)
        (add-hook 'magit-status-mode-hook #'magit-todos--add-to-status-buffer-kill-hook 'append))
    ;; Disable mode
    (transient-remove-suffix #'magit-status-jump '(0 -1))
    (remove-hook 'magit-status-sections-hook #'magit-todos--insert-todos)
    (remove-hook 'magit-status-mode-hook #'magit-todos--add-to-status-buffer-kill-hook)))