unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Add a widget for command functions?
@ 2009-10-12  1:17 Lennart Borgman
  2009-10-12 20:32 ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman @ 2009-10-12  1:17 UTC (permalink / raw)
  To: Emacs-Devel devel

Could a widget for command functions perhaps be added to Emacs?

(defvar widget-command-prompt-value-history nil
  "History of input to `widget-function-prompt-value'.")

(define-widget 'command 'restricted-sexp
  "A command function."
  :complete-function (lambda ()
                       (interactive)
                       (lisp-complete-symbol 'commandp))
  :prompt-value 'widget-field-prompt-value
  :prompt-internal 'widget-symbol-prompt-internal
  :prompt-match 'commandp
  :prompt-history 'widget-command-prompt-value-history
  :action 'widget-field-action
  :match-alternatives '(commandp)
  :validate (lambda (widget)
              (unless (commandp (widget-value widget))
                (widget-put widget :error (format "Invalid command: %S"
                                                  (widget-value widget)))
                widget))
  :value 'ignore
  :tag "Command")




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-12 20:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-12  1:17 Add a widget for command functions? Lennart Borgman
2009-10-12 20:32 ` Juri Linkov
2009-10-12 20:52   ` Lennart Borgman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).