I have the following elisp:
(require 'widget)
(eval-when-compile
(require 'wid-edit))
(defun testit ()
(interactive)
(switch-to-buffer "*Widget Test*")
(widget-insert "Test field: ")
(widget-create 'editable-field
:size 25
:notify (lambda (widget &rest ignore)
(message (widget-value widget))))
(use-local-map widget-keymap)
(widget-setup))
It creates a text widget in a new Emacs buffer. I intend it to show the value of the widget in the minibuffer on each change, but it doesn’t seem ever to call the :notify function. Why not?
It appears that it didn’t work because I had unknowingly messed up widget.el and needed to reload the package. Restarting Emacs did the trick.