Function: magit--imenu-index-name

magit--imenu-index-name is a byte-compiled function defined in magit-section.el.

Signature

(magit--imenu-index-name SECTION)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-section-20260330.1102/magit-section.el
(defun magit--imenu-index-name (section)
  (let ((heading (buffer-substring-no-properties
                  (oref section start)
                  (1- (or (oref section content)
                          (oref section end))))))
    (save-match-data
      (cond
        ((and (magit-section-match [commit logbuf] section)
              (string-match "[^ ]+\\([ *|]*\\).+" heading))
         (replace-match " " t t heading 1))
        ((magit-section-match
          '([branch local branchbuf] [tag tags branchbuf]) section)
         (oref section value))
        ((magit-section-match [branch remote branchbuf] section)
         (concat (oref (oref section parent) value) "/"
                 (oref section value)))
        ((string-match " ([0-9]+)\\'" heading)
         (substring heading 0 (match-beginning 0)))
        (heading)))))