Bad-ptr / persp-mode.el

named perspectives(set of buffers/window configs) for emacs
402 stars 44 forks source link

Provide old name as initial input to interactive rename of perspective #127

Closed joelnoomi closed 2 years ago

joelnoomi commented 2 years ago

When renaming a perspective, I often find the new name to be just a slightly modified version of the old name. Currently, I have to type out the whole new name whereas it would have been more convenient to simply edit the old name.

I suggest the old name be provided as initial input in the (read-string) call at: https://github.com/Bad-ptr/persp-mode.el/blob/298df111f081b5925f0aa0126a1b8d334117e0a2/persp-mode.el#L2870

That is:

        (unless new-name
          (setq new-name
                (read-string
                 (concat "New name for the " old-name " perspective: ") old-name)))

In case I want to start over and type the new name all the way from scratch, it is easy enough to kill the initial input with something like C-a k or M-backspace.

What do you think? Is there perhaps a (reasonable) way of achieving this behavior without modifying persp-mode.el that I have overlooked?

Bad-ptr commented 2 years ago

What do you think?

I agree with you. It will be a good addition.