[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/telephone-line 7a0ba06db8 2/2: Merge pull request #127 fro
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/telephone-line 7a0ba06db8 2/2: Merge pull request #127 from trev-dev/master |
Date: |
Sun, 13 Mar 2022 18:58:46 -0400 (EDT) |
branch: elpa/telephone-line
commit 7a0ba06db860dfe9a9ca012c2750b13deec385c6
Merge: aa7b1ec159 aef373fd76
Author: Daniel Bordak <daniel.bordak@dbordak.com>
Commit: GitHub <noreply@github.com>
Merge pull request #127 from trev-dev/master
Add a segment for Project.el
---
telephone-line-segments.el | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/telephone-line-segments.el b/telephone-line-segments.el
index 32d5bf2d3d..520c6e515f 100644
--- a/telephone-line-segments.el
+++ b/telephone-line-segments.el
@@ -208,6 +208,26 @@ If it doesn't exist, create and cache it."
(interactive)
(projectile-switch-project))))))
+(defcustom telephone-line-project-custom-name nil
+ "A custom directory-local name for a project.el project."
+ :type 'string
+ :group 'telephone-line)
+
+(telephone-line-defsegment telephone-line-project-segment ()
+ "Displays the project name, according to project.el"
+ (if (project-current)
+ (propertize (if (stringp telephone-line-project-custom-name)
+ telephone-line-project-custom-name
+ (file-name-nondirectory
+ (directory-file-name
+ (project-root (project-current)))))
+ 'face 'telephone-line-projectile
+ 'display '(raise 0.0)
+ 'help-echo "Switch project"
+ 'mouse-face '(:box 1)
+ 'local-map (make-mode-line-mouse-map
+ 'mouse-1 #'project-switch-project))))
+
(defun telephone-line--truncate-dir (dir)
"Truncate DIR, respecting word boundaries."
(if (string= dir "~")
@@ -268,7 +288,7 @@ Configure the face group telephone-line-evil to change the
colors per-mode."
"Wraps `flymake-mode' mode-line information in a telephone-line segment."
(when (bound-and-true-p flymake-mode)
(telephone-line-raw
- (if (boundp flymake--mode-line-format)
+ (if (boundp flymake--mode-line-format)
flymake--mode-line-format
flymake-mode-line-format) t)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] elpa/telephone-line 7a0ba06db8 2/2: Merge pull request #127 from trev-dev/master,
ELPA Syncer <=