fix setup/magit.el
[emacs-init.git] / nxhtml / nxhtml / wtest.el
1 (require 'wid-edit)
2 (require 'help-mode)
3
4 (defun test-widget-formats ()
5   (interactive)
6   (let ((widget-button-prefix "<<<<")
7         (widget-button-suffix ""))
8     (with-output-to-temp-buffer (help-buffer)
9       (with-current-buffer (help-buffer)
10         (set (make-local-variable 'widget-push-button-prefix) "")
11         (set (make-local-variable 'widget-push-button-suffix) "")
12         (set (make-local-variable 'widget-link-prefix) "")
13         (set (make-local-variable 'widget-link-suffix) "")
14
15         (widget-create 'push-button
16                        :action '(lambda (w &optional e) (message "1"))
17                        :button-face 'emacsw32-link-face
18                        :button-prefix ""
19                        :button-suffix ""
20                        "One"
21                        )
22         (widget-create 'push-button
23                        :action '(lambda (w &optional e) (message "2"))
24                        :format "%[%v%]"
25                        :value "two"
26                        )
27         (widget-create 'push-button
28                        :action '(lambda (w &optional e) (message "3"))
29                        :format "%[%v%]"
30                        :button-prefix ""
31                        :button-suffix ""
32                        "three"
33                        )
34         (widget-create 'push-button
35                        :action '(lambda (w &optional e) (message "4"))
36                        :format "%v"
37                        :button-prefix ""
38                        :button-suffix ""
39                        "four"
40                        )
41         (widget-create 'push-button
42                        :action '(lambda (w &optional e) (message "5"))
43                        :format "%{%v%}"
44                        :button-prefix ""
45                        :button-suffix ""
46                        "five"
47                        )
48         (widget-create 'push-button
49                        :action '(lambda (w &optional e) (message "6"))
50                        ;;:format "%[[%v]%]"
51                        :value "Six"
52                        ;;:value-create 'widget-browse-value-create
53                        :value-create (lambda (widget) (insert (widget-get widget :value)))
54                        )
55         (widget-setup)
56         ))))