Function: majutsu-annotate-addition

majutsu-annotate-addition is an interactive and natively compiled function defined in majutsu-annotate.el.

Signature

(majutsu-annotate-addition &optional REVISION)

Documentation

Annotate the current file showing when each line was added.

With prefix argument, prompt for REVISION.

If already annotating with the same type, and point is on a chunk that has a parent revision, then recursively annotate the parent.

Key Bindings

majutsu-annotate-read-only-mode-map b majutsu-blob-mode-map b

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-annotate.el
;;;###autoload
(defun majutsu-annotate-addition (&optional revision)
  "Annotate the current file showing when each line was added.
With prefix argument, prompt for REVISION.

If already annotating with the same type, and point is on a chunk
that has a parent revision, then recursively annotate the parent."
  (interactive
   (list (and current-prefix-arg
              (majutsu-read-revset "Annotate from revision"))))
  (majutsu-annotate--pre-assert)
  (if (and majutsu-annotate-mode
           (when-let* ((chunk (majutsu-annotate-chunk-at (point)))
                       (prev-rev (majutsu-annotate-chunk-prev-rev chunk)))
             ;; Recursive blame - visit parent and re-annotate
             (let ((style majutsu-annotate--style))
               (majutsu-annotate-visit-other-file)
               (setq-local majutsu-annotate--style style)
               (setq-local majutsu-annotate-recursive-p t)
               (redisplay)
               ;; Now run annotation in the new buffer
               (majutsu-annotate--run nil)
               t)))
      nil  ; Already handled recursive case
    (majutsu-annotate--run revision)))