Sublime Forum

Get the Content of the Search Panel

#1

Hi,

I’m currently trying to extend my Sublemacs - github.com/grundprinzip/sublemacspro - Plugin with more features and was asked if I could use Emacs’ possibility to perform completions as well in the search box. While it is easy to trigger a command as long as the search panel was opened via the show_panel command it seems there is no way of getting or setting the content of this specific kind of input panel or even launching the show_panel command with specific hooks.

Since I don’t want to rewrite the already existing search functionality, building an own search box is not my desired solution (especially since you don’t get all the nice buttons).

Does anybody have an idea how to solve this issue?

Thanks
Martin

0 Likes

#2

I’ve had limited success with the input panel myself. Basically in the on_change below you want to make the panel do stuff like add more text right? I wanted to make it disappear, wasn’t sure how to do that…
show_input_panel(caption, initial_text, on_done, on_change, on_cancel)

Another way to get around this might be to have a “mode” the way the Vintage plugin does (you can write to the status bar maybe?) You can literally bind the alphabet to the mode, I’m doing that for the plugin I’m working on.

0 Likes