Function: majutsu-annotate-mode

majutsu-annotate-mode is a natively compiled function defined in majutsu-annotate.el.

Signature

(majutsu-annotate-mode &optional ARG)

Documentation

Display annotation information inline.

This is a minor mode. If called interactively, toggle the Majutsu-Annotate 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 majutsu-annotate-mode(var)/majutsu-annotate-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-annotate.el
;;; Modes

(define-minor-mode majutsu-annotate-mode
  "Display annotation information inline."
  :lighter majutsu-annotate-mode-lighter
  :interactive nil
  (cond (majutsu-annotate-mode
         (add-hook 'post-command-hook #'majutsu-annotate-goto-chunk-hook nil t)
         (add-hook 'read-only-mode-hook #'majutsu-annotate-toggle-read-only t t)
         (setq majutsu-annotate-buffer-read-only buffer-read-only)
         (when (or majutsu-annotate-read-only
                   (bound-and-true-p majutsu-buffer-blob-path))
           (read-only-mode 1))
         ;; Disable incompatible modes
         (dolist (mode majutsu-annotate-disable-modes)
           (when (and (boundp mode) (symbol-value mode))
             (funcall mode -1)
             (push mode majutsu-annotate-disabled-modes)))
         ;; Initialize style
         (setq majutsu-annotate-separator (majutsu-annotate--format-separator))
         (unless majutsu-annotate--style
           (setq majutsu-annotate--style (car majutsu-annotate-styles))))
        (t
         (remove-hook 'post-command-hook #'majutsu-annotate-goto-chunk-hook t)
         (remove-hook 'read-only-mode-hook #'majutsu-annotate-toggle-read-only t)
         (unless majutsu-annotate-buffer-read-only
           (read-only-mode -1))
         (majutsu-annotate-read-only-mode -1)
         ;; Re-enable disabled modes
         (dolist (mode majutsu-annotate-disabled-modes)
           (funcall mode 1))
         (kill-local-variable 'majutsu-annotate-disabled-modes)
         (kill-local-variable 'majutsu-annotate--style)
         (kill-local-variable 'majutsu-annotate-cache)
         (majutsu-annotate--remove-overlays))))