summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2018-09-06 00:16:36 +0300
committerAlex Kost <alezost@gmail.com>2018-09-06 00:16:36 +0300
commitb24a186107dcd4cc85b63d5731cb0628145bcf5b (patch)
treebd232d494034f6830d46f610ba7b4ca0b0eefe12
parentAdd another system supported by Guix ("aarch64-linux") (diff)
downloademacs-build-farm-b24a186107dcd4cc85b63d5731cb0628145bcf5b.tar.gz
'build-farm-current-url' returns default URL as a fallback
* build-farm.el (build-farm-current-url): Return 'build-farm-url' if current buffer is not a "build-farm" buffer.
-rw-r--r--build-farm.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/build-farm.el b/build-farm.el
index 64f8514..5447a8b 100644
--- a/build-farm.el
+++ b/build-farm.el
@@ -207,7 +207,18 @@ If URL is nil, use variable `build-farm-url'."
(concat name "-" version))
(bui-define-current-args-accessors build-farm-current
- url search-type search-args)
+ url-1 search-type search-args)
+
+(defun build-farm-current-url ()
+ "Return build farm URL of the current buffer or default URL."
+ ;; This procedure may be called from non-"build-farm" buffers.
+ ;; Return `build-farm-url' in this case.
+ (let ((entry-type (bui-current-entry-type)))
+ (if (and entry-type
+ (string-match-p "\\`build-farm"
+ (symbol-name entry-type)))
+ (build-farm-current-url-1)
+ build-farm-url)))
(defun build-farm-current-url-type ()
"Return build farm type of the current buffer."