summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2018-08-13 18:16:52 +0300
committerAlex Kost <alezost@gmail.com>2018-08-13 18:16:52 +0300
commitd2ee21129c306d99ada403bc68893ca968bd699b (patch)
tree858b360c6734b50064de4fbaf173a09272e58b49
parentREADME: Fix org markup (diff)
downloademacs-build-farm-d2ee21129c306d99ada403bc68893ca968bd699b.tar.gz
popup: Use variable names instead of their descriptions
* build-farm-popup.el (build-farm-popup-option-value): Replace with... (build-farm-popup-variable-value): ... this. (build-farm-popup-format-url): Use it. (build-farm-popup-format-number-of-builds): Use it.
-rw-r--r--build-farm-popup.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/build-farm-popup.el b/build-farm-popup.el
index 7f0bf95..5cd8309 100644
--- a/build-farm-popup.el
+++ b/build-farm-popup.el
@@ -74,22 +74,22 @@ See `completing-read' for PROMPT and INITIAL-INPUT."
:project)
prompt initial-input))
-(defun build-farm-popup-option-value (string &optional description)
- "Return STRING formatted for popup buffer.
-DESCRIPTION is appended to the resulting string."
- (concat description
- (propertize (concat "\"" string "\"")
+(defun build-farm-popup-variable-value (var-name)
+ "Return string formatted for popup buffer.
+String is made of variable VAR-NAME and its value."
+ (concat (propertize (symbol-name var-name)
+ 'face font-lock-variable-name-face)
+ " "
+ (propertize (prin1-to-string (symbol-value var-name))
'face 'magit-popup-option-value)))
(defun build-farm-popup-format-url ()
"Return URL string, formatted for '\\[build-farm]'."
- (build-farm-popup-option-value build-farm-url "URL "))
+ (build-farm-popup-variable-value 'build-farm-url))
(defun build-farm-popup-format-number-of-builds ()
"Return number of builds, formatted for '\\[build-farm-build-popup]'."
- (build-farm-popup-option-value
- (number-to-string build-farm-number-of-builds)
- "Number of builds "))
+ (build-farm-popup-variable-value 'build-farm-number-of-builds))
(defun build-farm-popup-build-args ()
"Return arguments of the current build popup buffer."