comparison lisp/custom/widget.el @ 18:d95e72db5c07 r19-15b92

Import from CVS: tag r19-15b92
author cvs
date Mon, 13 Aug 2007 08:49:43 +0200
parents
children 859a2309aef8
comparison
equal deleted inserted replaced
17:4579af9d8826 18:d95e72db5c07
1 ;;; widget.el --- a library of user interface components.
2 ;;
3 ;; Copyright (C) 1996 Free Software Foundation, Inc.
4 ;;
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Keywords: help, extensions, faces, hypermedia
7 ;; Version: 1.24
8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
9
10 ;;; Commentary:
11 ;;
12 ;; If you want to use this code, please visit the URL above.
13 ;;
14 ;; This file only contain the code needed to define new widget types.
15 ;; Everything else is autoloaded from `widget-edit.el'.
16
17 ;;; Code:
18
19 (eval-when-compile (require 'cl))
20
21 (defmacro define-widget-keywords (&rest keys)
22 (`
23 (eval-and-compile
24 (let ((keywords (quote (, keys))))
25 (while keywords
26 (or (boundp (car keywords))
27 (set (car keywords) (car keywords)))
28 (setq keywords (cdr keywords)))))))
29
30 (define-widget-keywords :valid-regexp
31 :secret :sample-face :sample-face-get :case-fold :widget-doc
32 :create :convert-widget :format :value-create :offset :extra-offset
33 :tag :doc :from :to :args :value :value-from :value-to :action
34 :value-set :value-delete :match :parent :delete :menu-tag-get
35 :value-get :choice :void :menu-tag :on :off :on-type :off-type
36 :notify :entry-format :button :children :buttons :insert-before
37 :delete-at :format-handler :widget :value-pos :value-to-internal
38 :indent :size :value-to-external :validate :error :directory
39 :must-match :type-error :value-inline :inline :match-inline :greedy
40 :button-face-get :button-face :value-face :keymap :entry-from
41 :entry-to :help-echo :documentation-property :hide-front-space
42 :hide-rear-space)
43
44 ;; These autoloads should be deleted when the file is added to Emacs.
45 (autoload 'widget-create "widget-edit")
46 (autoload 'widget-insert "widget-edit")
47
48 ;;;###autoload
49 (defun define-widget (name class doc &rest args)
50 "Define a new widget type named NAME from CLASS.
51
52 NAME and CLASS should both be symbols, CLASS should be one of the
53 existing widget types, or nil to create the widget from scratch.
54
55 After the new widget has been defined, the following two calls will
56 create identical widgets:
57
58 * (widget-create NAME)
59
60 * (apply 'widget-create CLASS ARGS)
61
62 The third argument DOC is a documentation string for the widget."
63 (put name 'widget-type (cons class args))
64 (put name 'widget-documentation doc))
65
66 ;;; The End.
67
68 (provide 'widget)
69
70 ;; widget.el ends here