From a474ebf152c4a175997f8be591248ec0b80c938d Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Tue, 9 Jan 2024 15:16:54 -0800 Subject: [PATCH] Add a rebase indicator for eshell --- init.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index d37b111..d752f02 100644 --- a/init.el +++ b/init.el @@ -840,11 +840,16 @@ Take directly from doom-modeline." ("trm" "trash-rm $*") ("rm" "echo 'rm: I''m unsafe! Don''t use me.'; false") ("\\rm" "eshell/rm"))) + (defvar my/eshell-bm-auto-ls t + "Weather or not to run ls after `eshell/bm'") (defun eshell/bm (&optional name) "Change to directory of bookmark NAME. If no name is given, list all bookmarks instead." (if name - (eshell/cd (bookmark-get-filename name)) + (progn + (eshell/cd (bookmark-get-filename name)) + (when my/eshell-bm-auto-ls + (eshell/ls))) (eshell-print (string-join (bookmark-all-names) " ")))) (defun my/-replace-home-with-tilda (path) (let ((home (getenv "HOME"))) @@ -930,7 +935,9 @@ If no name is given, list all bookmarks instead." (let ((git-dir (expand-file-name ".git" (vc-git-root default-directory)))) (cond ((file-exists-p (expand-file-name "REVERT_HEAD" git-dir)) - "REVERTING")))) + "REVERTING") + ((file-exists-p (expand-file-name "rebase-merge" git-dir)) + "REBASING")))) (defun my/-eshell-prompt-git-status () "Get git status for `my/-eshell-prompt-function'" (let ((branch (car (vc-git-branches))) @@ -942,7 +949,7 @@ If no name is given, list all bookmarks instead." (propertize (concat " [" state "]") 'face '(:foreground "red"))) (when operation (concat " (" (propertize operation 'face - '(:weight 'bold :foreground "yellow")) ")"))))) + '(:inherit 'bold :foreground "yellow")) ")"))))) (defun my/-eshell-prompt-vc-status () "Get vc status for `my/-eshell-prompt-function'." (if-let (backend (vc-responsible-backend default-directory t))