Closed mrunhap closed 2 years ago
I'm not good at emacs lisp, but this works for me, maybe I should send a PR
(defun +project-name ()
(file-name-nondirectory (directory-file-name (project-root (project-current)))))
(telephone-line-defsegment my--project-segment ()
(propertize (+project-name)
'face 'telephone-line-projectile
'display '(raise 0.0)
'help-echo "Switch project"
'local-map (make-mode-line-mouse-map
'mouse-1 (lambda ()
(interactive)
(project-switch-project)))))
(telephone-line-defsegment* my-project-buffer-segment ()
""
(if (and (buffer-file-name)
(project-current))
(list ""
(funcall (my--project-segment) 'telephone-line-unimportant)
(propertize
(if-let ((rel-path (file-relative-name (file-truename (buffer-file-name))
(+project-name))))
(telephone-line--truncate-path rel-path -1)) ;; TODO need my own version
'help-echo (buffer-file-name)))
(telephone-line-raw mode-line-buffer-identification t)))
Maybe you should! Thanks for sharing :)
I see there is a projectile segment but didn't have project.el support.
I'm not good at emacs lisp, but this works for me, maybe I should send a PR
I used your example as the baseline for my project.el segment, which I like quite a lot. Have you submitted your PR? If not, would you mind if I went ahead and submitted mine?
I see there is a projectile segment but didn't have project.el support.
I'm not good at emacs lisp, but this works for me, maybe I should send a PR
I used your example as the baseline for my project.el segment, which I like quite a lot. Have you submitted your PR? If not, would you mind if I went ahead and submitted mine?
Yes it's ok, just send your PR :)
I see there is a projectile segment but didn't have project.el support.