Skip to content

Commit bd0c5eb

Browse files
committed
forge--completing-read: Remove function
`magit-completing-read' now supports "" as a member of COLLECTION even when REQUIRE-MATCH is non-nil.
1 parent 627b329 commit bd0c5eb

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

lisp/forge-topic.el

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,11 @@ can be selected from the start."
713713
(read-string "Title: " (oref topic title)))
714714

715715
(defun forge-read-topic-milestone (&optional topic)
716-
(forge--completing-read
716+
(magit-completing-read
717717
"Milestone"
718-
(mapcar #'caddr (oref (forge-get-repository (or topic :tracked)) milestones))
718+
(cons ""
719+
(mapcar #'caddr
720+
(oref (forge-get-repository (or topic :tracked)) milestones)))
719721
nil t
720722
(and topic (forge--format-topic-milestone topic))))
721723

@@ -758,24 +760,6 @@ can be selected from the start."
758760
'confirm
759761
(mapconcat #'cadr value ","))))
760762

761-
(defun forge--completing-read ( prompt collection &optional
762-
predicate require-match initial-input
763-
hist def)
764-
;; NOTE Only required until `magit-completing-read' has been
765-
;; updated to allow empty input if require-match is t.
766-
(let ((reply (funcall magit-completing-read-function
767-
(concat prompt ": ")
768-
(if (and def (not (member def collection)))
769-
(cons def collection)
770-
collection)
771-
predicate
772-
require-match initial-input hist def)))
773-
(if (equal reply "")
774-
(if (and require-match (not (eq require-match t)))
775-
(user-error "Nothing selected")
776-
nil)
777-
reply)))
778-
779763
;;; Format
780764

781765
(cl-defmethod forge--format ((topic forge-topic) slot &optional spec)

0 commit comments

Comments
 (0)