[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/zuul 67165f7805 05/17: Add highlight of command
From: |
ELPA Syncer |
Subject: |
[elpa] externals/zuul 67165f7805 05/17: Add highlight of command |
Date: |
Tue, 30 Aug 2022 11:58:24 -0400 (EDT) |
branch: externals/zuul
commit 67165f780560592959be987868cb592e21ae45e6
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add highlight of command
---
zuul.el | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/zuul.el b/zuul.el
index cef94215f0..328f4afc90 100644
--- a/zuul.el
+++ b/zuul.el
@@ -298,12 +298,28 @@ Each entry in the list is a property list with the
following properties:
(erase-buffer)
(insert build-output)
(zuul-log-mode)
+ (zuul--highlight-cmd)
(setq zuul--current-build zuul--build)
(setq zuul--current-builds zuul--builds)
(goto-char (point-max))
(select-window
(display-buffer buffer
zuul-build-display-buffer-action))))))))))
+
+(defun zuul--highlight-cmd ()
+ "Highlight commands in build log."
+ (let ((property))
+ (save-excursion
+ (goto-char (point-min))
+ (while (setq property (text-property-search-forward 'zuul-task))
+ (save-excursion
+ (goto-char (prop-match-beginning property))
+ (search-forward "$")
+ (let* ((ov-prompt (make-overlay (prop-match-beginning property)
(point)))
+ (ov-input (make-overlay (point) (progn (end-of-line)
(point)))))
+ (overlay-put ov-prompt 'face 'comint-highlight-prompt)
+ (overlay-put ov-input 'face 'comint-highlight-input)))))))
+
(cl-defun zuul-get-builds (&key
change
project
@@ -765,19 +781,22 @@ Optionally provide extra parameters PARAMS, PARSER,
METHOD, BUFFER or HEADERS."
(defun zuul--build-host-output (host)
"Return the command and its output from the HOST."
- (pcase-let* ((`(,_hostname . ,data) host)
+ (pcase-let* ((`(,hostname . ,data) host)
(cmd (let-alist data .cmd))
(output (let-alist data .stdout))
(host-id (let-alist data .zuul_log_id))
(zuul--build-data `(,@zuul--build-data :host ,host)))
(when-let ((cmd-str
(when cmd
- (if (stringp cmd)
- cmd
- (mapconcat #'identity cmd " ")))))
+ (format "zuul@%s$ %s"
+ hostname
+ (if (stringp cmd)
+ cmd
+ (mapconcat #'identity cmd " "))))))
+ (zuul--propertize-face cmd-str 'bold-italic)
(if (or (null output) (string-empty-p output))
- (setq output (concat "$ " cmd-str "\n"))
- (setq output (concat "$ " cmd-str "\n" output "\n")))
+ (setq output (concat cmd-str "\n"))
+ (setq output (concat cmd-str "\n" output "\n")))
(put-text-property 0 (length output) 'zuul-playbook
zuul--build-playbook-id output)
(put-text-property 0 (length output) 'zuul-play zuul--build-play-id
output)
(put-text-property 0 (length output) 'zuul-task zuul--build-task-id
output)
- [elpa] branch externals/zuul created (now ad20c55828), ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 1ac0b6635e 06/17: Move zuul--highlight-cmd, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 67165f7805 05/17: Add highlight of command,
ELPA Syncer <=
- [elpa] externals/zuul 0003af3679 10/17: Add functions for anonymized screenshots, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 36fb6e7a13 15/17: Address feedback from package-lint, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul c3e69263ce 14/17: Update command section in README, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul b14fb97cc0 03/17: Replace keybinding for eldoc-mode, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul c15f79d769 07/17: Add previous/next command in build log, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 982b0eac12 09/17: Add faces for prompt and input in zuul build, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 83f68268cc 01/17: Add LICENSE file, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 58af096228 04/17: Update output to contain cmd as well, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul aecdb85b15 02/17: Add zuul.el, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul ad20c55828 17/17: Update required Emacs version, ELPA Syncer, 2022/08/30