0

This is a follow-up on Creating buttons/input fields.

I learned that forms (or rather its elements) in Emacs are called widgets and I am now experimenting on how I can get the best result for what I like to build.

Since some editable-field values shall be used with some (external) commands and evaluated to fill other fields, I wonder if one could limit the :notify property (or something similar) to only trigger when exiting the field (e.g. when pressing TAB or RET) rather than on every single character change. This is to reduce the amount the attached command is run to once when I am done with the field.

2
  • I don't see a way to hook into notify for this. TAB and RET don't seem to trigger an event for an editable-field that runs the :notify function. I wonder if the way to do it would be to advise widget-field-activate, widget-forward, and widget-backward so that before they run, they could run an update function (probably not the one for notify though? Commented Aug 12, 2021 at 23:52
  • As long as there are alternatives, which can trigger upon exiting a widget, it does not need to specifically run commands through :notify inside a specific widget. Though I think it is dedicated for that pupose. An example of a command I want to run is to use a name to find the login in an LDAP tree. For obvious reasons I do not want to spam LDAP with unfinished names to find the login, but have it only search for it once I am done entering the name. Of course, I can introduce a button to manually search for it, but would prefer an automated solution.
    – Phoenix
    Commented Aug 13, 2021 at 5:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.