Skip to content

Commit

Permalink
dump
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed May 2, 2024
1 parent 6a8f5e2 commit 29a1dca
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions lisp/forge-topic.el
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,9 @@ can be selected from the start."
;;; Insert

(defun forge--insert-topics (type heading topics)
;; (setq magit-section-inhibit-markers t)
;; (setq magit-section-insert-in-reverse t)
;; (setq magit-section-preserve-visibility t)
(when topics
(let ((width (apply #'max (--map (length (oref it slug)) topics))))
(magit-insert-section ((eval type) nil t)
Expand All @@ -771,26 +774,28 @@ can be selected from the start."
'magit-section-heading)
(magit--propertize-face (format "(%s)" (length topics))
'magit-section-child-count)))
(magit-insert-section-body
(dolist (topic topics)
(forge--insert-topic topic width))
(insert ?\n)
(magit-make-margin-overlay nil t))))))
;;(magit-insert-section-body
(dolist (topic topics)
(forge--insert-topic topic width))
(insert ?\n)
(magit-make-margin-overlay nil t)))))

(defun forge--insert-topic (topic &optional width)
(magit-insert-section ((eval (oref topic closql-table)) topic t)
(insert (forge--format-topic-line topic (or width 5)))
(magit-insert-section ((eval (oref topic closql-table)) topic 'hide)
(insert (forge--format-topic-line toopic (or width 5)))
;; TODO cache
(forge--insert-topic-marks topic t)
(forge--insert-topic-labels topic t)
(insert "\n")
(magit-log-format-author-margin
(oref topic author)
(format-time-string "%s" (parse-iso8601-time-string (oref topic created)))
t)
(when (and (slot-exists-p topic 'merged)
(not (oref topic merged)))
(magit-insert-heading)
(forge--insert-pullreq-commits topic))))
;; (magit-log-format-author-margin
;; (oref topic author)
;; (format-time-string "%s" (parse-iso8601-time-string (oref topic created)))
;; t)
;; (when (and (slot-exists-p topic 'merged)
;; (not (oref topic merged)))
;; (magit-insert-heading)
;; (forge--insert-pullreq-commits topic))
))

(defun forge--insert-topic-labels (topic &optional separate)
(and-let* ((labels (closql--iref topic 'labels)))
Expand Down

0 comments on commit 29a1dca

Please sign in to comment.