Function: majutsu-workspace--format-entry

majutsu-workspace--format-entry is a natively compiled function defined in majutsu-workspace.el.

Signature

(majutsu-workspace--format-entry ENTRY NAME-WIDTH)

Documentation

Format workspace ENTRY for insertion, padding name to NAME-WIDTH.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-workspace.el
(defun majutsu-workspace--format-entry (entry name-width)
  "Format workspace ENTRY for insertion, padding name to NAME-WIDTH."
  (let* ((name (plist-get entry :name))
         (current (plist-get entry :current))
         (change-id (plist-get entry :change-id))
         (commit-id (plist-get entry :commit-id))
         (desc (plist-get entry :desc))
         (root (plist-get entry :root))
         (name-face (if current 'magit-branch-current 'magit-branch-local))
         (name-str (majutsu-workspace--with-fallback-face name name-face))
         (pad (make-string (max 0 (- name-width (string-width name))) ?\s))
         (marker (if current "@ " "  ")))
    (concat marker
            name-str pad
            " "
            (majutsu-workspace--with-fallback-face change-id 'magit-hash)
            " "
            (majutsu-workspace--with-fallback-face commit-id 'magit-hash)
            (when (and desc (not (string-empty-p desc)))
              (concat " " desc))
            " "
            (majutsu-workspace--display-root root))))