Commit 2279960b authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-read-number-string: New function

parent 661d58b2
......@@ -385,7 +385,7 @@ without prompting."
"--committer-date-is-author-date")
(?D "Use committer date as author date" "--ignore-date"))
:options '((?p "Remove leading slashes from paths" "-p"
magit-popup-read-number))
magit-read-number-string))
:actions '((?m "Apply maildir" magit-am-apply-maildir)
(?w "Apply patches" magit-am-apply-patches)
(?a "Apply plain patch" magit-patch-apply-popup))
......
......@@ -704,6 +704,14 @@ ACTION is a member of option `magit-slow-confirm'."
(replace-regexp-in-string
"-" " " (concat (upcase (substring prompt 0 1)) (substring prompt 1)))))
(defun magit-read-number-string (prompt &optional default)
"Like `read-number' but return value is a string.
DEFAULT may be a number or a numeric string."
(number-to-string
(read-number prompt (if (stringp default)
(string-to-number default)
default))))
;;; Debug Utilities
;;;###autoload
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment