Function: magit-current-blame-chunk

magit-current-blame-chunk is a byte-compiled function defined in magit-blame.el.

Signature

(magit-current-blame-chunk &optional TYPE NOERROR)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-blame.el
(defun magit-current-blame-chunk (&optional type noerror)
  (or (and (not (and type (not (eq type magit-blame-type))))
           (magit-blame-chunk-at (point)))
      (and type
           (let ((rev magit-buffer-revision)
                 (file (and (not (derived-mode-p 'dired-mode))
                            (magit-file-relative-name
                             nil (not magit-buffer-file-name))))
                 (line (format "%d,+1" (line-number-at-pos))))
             (cond (file
                    (with-temp-buffer
                      (magit-with-toplevel
                        (magit-git-insert
                         "blame" "--porcelain"
                         (if (memq magit-blame-type '(final removal))
                             (cons "--reverse" (magit-blame-arguments))
                           (magit-blame-arguments))
                         "-L" line rev "--" file)
                        (goto-char (point-min))
                        (cond ((not (eobp))
                               (car (magit-blame--parse-chunk type)))
                              ((not noerror)
                               (error "Cannot get blame chunk at eob"))))))
                   ((not noerror)
                    (error "Buffer does not visit a tracked file")))))))