Function: majutsu-annotate--run

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

Signature

(majutsu-annotate--run REVISION)

Documentation

Run annotation for REVISION.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-annotate.el
(defun majutsu-annotate--run (revision)
  "Run annotation for REVISION."
  (let* ((root (majutsu-toplevel))
         (file (or (and (bound-and-true-p majutsu-buffer-blob-path)
                        majutsu-buffer-blob-path)
                   (file-relative-name buffer-file-name root)))
         (rev (or revision
                  (and (bound-and-true-p majutsu-buffer-blob-revision)
                       majutsu-buffer-blob-revision)
                  "@"))
         (default-directory root))
    (message "Annotating...")
    (let ((output (with-temp-buffer
                    (majutsu--with-no-color
                      (majutsu-jj-insert "file" "annotate"
                                         "-r" rev
                                         "-T" majutsu-annotate--template
                                         file))
                    (buffer-string))))
      (when (string-empty-p output)
        (user-error "No annotation output"))
      (unless majutsu-annotate-mode
        (majutsu-annotate-mode 1))
      (setq majutsu-annotate-cache (make-hash-table :test #'equal))
      (majutsu-annotate--remove-overlays)
      (let ((chunks (majutsu-annotate--parse-output output)))
        (majutsu-annotate--make-overlays chunks)
        (when majutsu-annotate-read-only
          (majutsu-annotate-read-only-mode 1))
        (message "Annotating...done")))))