Coder Social home page Coder Social logo

Comments (5)

mrunhap avatar mrunhap commented on August 16, 2024 1

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)))

from telephone-line.

mrunhap avatar mrunhap commented on August 16, 2024 1

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 :)

from telephone-line.

trev-dev avatar trev-dev commented on August 16, 2024

Maybe you should! Thanks for sharing :)

from telephone-line.

trev-dev avatar trev-dev commented on August 16, 2024

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?

from telephone-line.

trev-dev avatar trev-dev commented on August 16, 2024

#127 Here it is.

from telephone-line.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.