Function: magit-diff--modified-defuns-1

magit-diff--modified-defuns-1 is a byte-compiled function defined in magit-diff.el.

Signature

(magit-diff--modified-defuns-1 REV FILE LINES)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
(defun magit-diff--modified-defuns-1 (rev file lines)
  (with-current-buffer (magit-find-file-noselect rev file t t)
    (save-excursion
      (save-restriction
        (widen)
        (let (defuns)
          (while-let ((line (pop lines)))
            (goto-char (point-min))
            (forward-line line)
            (when-let ((def (which-function)))
              (cl-pushnew def defuns :test #'equal)
              (when-let ((end (condition-case nil (end-of-defun)
                                (:success (line-number-at-pos))
                                (error nil))))
                (while (and lines (> end (car lines)))
                  (pop lines)))))
          (nreverse defuns))))))