aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/elisp/eshell-prompt.el
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-05-08 23:58:32 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-05-08 23:58:32 +0100
commit3c39e59cd50b58797d14b0f2630abf9f98d4302d (patch)
tree033341b3eff32375f0adae822202c91ae66dea32 /Emacs/.config/emacs/elisp/eshell-prompt.el
parentc94f66c143c9ee9d5fbdee15fe4ba2b8cbdcad56 (diff)
downloaddotfiles-3c39e59cd50b58797d14b0f2630abf9f98d4302d.tar.gz
dotfiles-3c39e59cd50b58797d14b0f2630abf9f98d4302d.tar.bz2
dotfiles-3c39e59cd50b58797d14b0f2630abf9f98d4302d.zip
Switch to thread-last for +eshell-prompt/--git-status
Diffstat (limited to 'Emacs/.config/emacs/elisp/eshell-prompt.el')
-rw-r--r--Emacs/.config/emacs/elisp/eshell-prompt.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/Emacs/.config/emacs/elisp/eshell-prompt.el b/Emacs/.config/emacs/elisp/eshell-prompt.el
index ecd03c3..d0a4e91 100644
--- a/Emacs/.config/emacs/elisp/eshell-prompt.el
+++ b/Emacs/.config/emacs/elisp/eshell-prompt.el
@@ -82,9 +82,11 @@ number of files affected are returned in red."
(defun +eshell-prompt/--git-status ()
"Returns a completely formatted string of
form (BRANCH-NAME<CHANGES>[REMOTE-STATUS])."
- (let ((git-branch (shell-command-to-string "git branch")))
- (if (or (string= git-branch "")
- (not (string= "*" (substring git-branch 0 1))))
+ (let ((git-branch (thread-last
+ (split-string (shell-command-to-string "git branch") "\n")
+ (cl-remove-if (lambda (s) (= (length s) 0)))
+ (cl-find-if (lambda (s) (string= "*" (substring s 0 1)))))))
+ (if (null git-branch)
""
(format
"(%s<%s>[%s])"