branch: elpa/telephone-line
commit cdbe1a6be5da083b3abae73ee91bd19d62140192
Merge: cbaf1b8134 14d2abdbe0
Author: Daniel Bordak <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #62 from anandpiyer/master
Added segments for window number and projectile.
---
telephone-line-segments.el | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/telephone-line-segments.el b/telephone-line-segments.el
index b1322f83da..1622cfe342 100644
--- a/telephone-line-segments.el
+++ b/telephone-line-segments.el
@@ -98,6 +98,25 @@ mouse-3: Toggle minor modes"
(when (boundp 'erc-modified-channels-object)
(string-trim erc-modified-channels-object)))
+(telephone-line-defsegment telephone-line-window-number-segment (&optional
in-unicode)
+ (when (bound-and-true-p winum-mode)
+ (if in-unicode
+ (propertize (format "%c" (+ 9311 (winum-get-number))) 'face
`winum-face)
+ (winum-get-number-string))))
+
+(telephone-line-defsegment telephone-line-projectile-segment ()
+ (if (and (fboundp 'projectile-project-name)
+ (projectile-project-name))
+ (propertize (format "[%s]" (concat (projectile-project-name)))
+ 'face '(:inherit)
+ 'display '(raise 0.0)
+ 'help-echo "Switch project"
+ 'mouse-face '(:box 1)
+ 'local-map (make-mode-line-mouse-map
+ 'mouse-1 (lambda ()
+ (interactive)
+ (projectile-switch-project))))))
+
(telephone-line-defsegment* telephone-line-evil-tag-segment ()
(when (bound-and-true-p evil-mode)
(let ((tag (cond