Function: majutsu-bookmark--conflict-targets

majutsu-bookmark--conflict-targets is a natively compiled function defined in majutsu-bookmark.el.

Signature

(majutsu-bookmark--conflict-targets ENTRY COMPILED)

Documentation

Return conflict target rows for ENTRY, or :invalid.

Each target row is a cons of its full commit id and rendered heading. Return nil when ENTRY has no conflict target data.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-bookmark.el
(defun majutsu-bookmark--conflict-targets (entry compiled)
  "Return conflict target rows for ENTRY, or `:invalid'.
Each target row is a cons of its full commit id and rendered heading.
Return nil when ENTRY has no conflict target data."
  (let* ((body (majutsu-row-render-body entry compiled t))
         (removed (majutsu-row-column entry 'removed-target-ids))
         (added (majutsu-row-column entry 'added-target-ids))
         (ids (append removed added))
         (lines (and body
                     (not (string-empty-p body))
                     (majutsu-row-split-by-separator body "\n"))))
    (cond
     ((and (null ids) (null lines)) nil)
     ((and (= (length ids) (length lines))
           (cl-loop for line in lines
                    for index from 0
                    for marker = (if (< index (length removed))
                                     "  - "
                                   "  + ")
                    always (string-prefix-p
                            marker (substring-no-properties line))))
      (cl-mapcar #'cons ids lines))
     (t :invalid))))