Git Product home page Git Product logo

Comments (7)

sellout avatar sellout commented on July 17, 2024

Ah, since it doesn’t propertize text in the title, you probably also want to always treat persp-modestring-short as t if persp-show-modestring is 'frame-title. I use the short form anyway, so I didn’t notice initially.

from perspective-el.

sellout avatar sellout commented on July 17, 2024

Ok, my quick experiment is not so successful – it sets the title for all frames to whatever perspective the selected frame is in. But I’m sure there’s a way around that …

from perspective-el.

cmm avatar cmm commented on July 17, 2024

FWIW this seems to work for me:

(setq frame-title-format '("%b" (:eval (when-let ((persp (frame-parameter nil 'persp--curr))) (format " [%s]" (persp-name persp))))))

(but of course relying on non-public things is not ideal)

from perspective-el.

sellout avatar sellout commented on July 17, 2024

Thanks, @cmm, that looks like it works for me. I extracted it into a function:

(defun persp-frame-title ()
  (when-let ((persp (frame-parameter nil 'persp--curr)))
    (let ((open (nth 0 persp-modestring-dividers))
          (close (nth 1 persp-modestring-dividers)))
      (concat open persp close))))

(setq frame-title-format '((:eval (persp-frame-title)) " %b"))

It matches the existing rendering (e.g., using persp-modestring-dividers), but always treats it as the short modestring, since there’s no propertization in the frame title.

from perspective-el.

gcv avatar gcv commented on July 17, 2024

@sellout: Have you tried using (persp-current-name) in place of (frame-parameter nil 'persp--curr)?

I would merge in a PR that added persp-frame-title and included documentation about how to use it.

from perspective-el.

sellout avatar sellout commented on July 17, 2024

@sellout: Have you tried using (persp-current-name) in place of (frame-parameter nil 'persp--curr)?

I hadn’t. It looks like

(defun persp-frame-title ()
  (let ((open (nth 0 persp-modestring-dividers))
        (close (nth 1 persp-modestring-dividers)))
    (concat open (persp-current-name) close)))

works just as well.

I would merge in a PR that added persp-frame-title and included documentation about how to use it.

I think for a PR, adding (const :tag "Frame Title" frame-title) to persp-show-modestring would be the way to go. I’m happy to submit one (with @cmm tagged as co-author), unless @cmm would like to submit one themselves.

from perspective-el.

cmm avatar cmm commented on July 17, 2024

@sellout happy to have helped (I guess, not really sure?), feel free to go ahead :)

from perspective-el.

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.