wolray/symbol-overlay

Transient for symbol-overlay

hmelman opened this issue · 3 comments

For what it's worth, I've been very happily using this transient for symbol-overlay for a while. It could be bound to any key but I have a super- key configured and am binding this to s-. which I find nicely parallels M-..

(define-transient-command symbol-overlay-transient ()
  "Symbol Overlay transient"
  ["Symbol Overlay"
   ["Overlays"
    ("." "Add/Remove at point" symbol-overlay-put)
    ("k" "Remove All" symbol-overlay-remove-all)
    ]
   ["Move to Symbol"
    ("n" "Next" symbol-overlay-switch-forward)
    ("p" "Previous" symbol-overlay-switch-backward)
    ]
   ["Other"
    ("m" "Highlight symbol-at-point" symbol-overlay-mode)
    ]
   ]
  )
(global-set-key (kbd "s-.") 'symbol-overlay-transient)

Great - thanks for sharing! It's out of scope to add a depenency on transient to the library itself, but I'm sure others will stumble across this and find it helpful! I might link to this snippet from the README...

With Transient now added in the master branch of Emacs 28, is it possible this might be revisited in the future?

Yeah -command became -prefix. I'm still using the transient I had. I find the commands on the symbol-overlay-map overlay are way more convenient wouldn't want to lose them. I just use the transient to add/remove overlays and to navigate to an overlay when I'm not on one. Otherwise the overlay map is faster, you don't have to type the transient prefix for first/last/rename/etc.