Add project segment

This commit is contained in:
Jessie Hildebrandt 2023-12-10 08:08:46 -05:00
parent fdaeb1fddb
commit e0f6ba27a8

View File

@ -220,6 +220,7 @@ An optional key :padding may be provided, the value of which will be used as
((or (mood-line-segment-buffer-status)
(mood-line-segment-client)
" ") . " ")
((mood-line-segment-project) . "/")
((mood-line-segment-buffer-name) . " ")
((mood-line-segment-anzu) . " ")
((mood-line-segment-multiple-cursors) . " ")
@ -526,6 +527,21 @@ Modal editing modes checked, in order:
(propertize (mood-line--get-glyph :frame-client)
'face 'mood-line-frame-status-client)))
;; -------------------------------------------------------------------------- ;;
;;
;; Project segment
;;
;; -------------------------------------------------------------------------- ;;
(defun mood-line-segment-project ()
"Return project name from project.el or Projectile, if any."
(or
(and (fboundp 'project-name)
(project-current)
(project-name (project-current)))
(and (fboundp 'projectile-project-name)
(projectile-project-name))))
;; -------------------------------------------------------------------------- ;;
;;
;; anzu segment