202 |
"Choose an item from a list. |
"Choose an item from a list. |
203 |
|
|
204 |
First argument TITLE is the name of the list. |
First argument TITLE is the name of the list. |
205 |
Second argument ITEMS is an list whose members are either |
Second argument ITEMS is a list whose members are either |
206 |
(NAME . VALUE), to indicate selectable items, or just strings to |
(NAME . VALUE), to indicate selectable items, or just strings to |
207 |
indicate unselectable items. |
indicate unselectable items. |
208 |
Optional third argument EVENT is an input event. |
Optional third argument EVENT is an input event. |
301 |
(nreverse result))) |
(nreverse result))) |
302 |
|
|
303 |
;;; Widget text specifications. |
;;; Widget text specifications. |
304 |
;; |
;; |
305 |
;; These functions are for specifying text properties. |
;; These functions are for specifying text properties. |
306 |
|
|
307 |
(defvar widget-field-add-space t |
(defvar widget-field-add-space t |
333 |
(rear-sticky |
(rear-sticky |
334 |
(or (not widget-field-add-space) (widget-get widget :size)))) |
(or (not widget-field-add-space) (widget-get widget :size)))) |
335 |
(if (functionp help-echo) |
(if (functionp help-echo) |
336 |
(setq help-echo 'widget-mouse-help)) |
(setq help-echo 'widget-mouse-help)) |
337 |
(when (= (char-before to) ?\n) |
(when (= (char-before to) ?\n) |
338 |
;; When the last character in the field is a newline, we want to |
;; When the last character in the field is a newline, we want to |
339 |
;; give it a `field' char-property of `boundary', which helps the |
;; give it a `field' char-property of `boundary', which helps the |
509 |
|
|
510 |
(defun widget-default-get (widget) |
(defun widget-default-get (widget) |
511 |
"Extract the default external value of WIDGET." |
"Extract the default external value of WIDGET." |
512 |
(widget-apply widget :value-to-external |
(widget-apply widget :value-to-external |
513 |
(or (widget-get widget :value) |
(or (widget-get widget :value) |
514 |
(widget-apply widget :default-get)))) |
(widget-apply widget :default-get)))) |
515 |
|
|
892 |
(if (widget-event-point event) |
(if (widget-event-point event) |
893 |
(let* ((pos (widget-event-point event)) |
(let* ((pos (widget-event-point event)) |
894 |
(start (event-start event)) |
(start (event-start event)) |
895 |
(button (get-char-property |
(button (get-char-property |
896 |
pos 'button (and (windowp (posn-window start)) |
pos 'button (and (windowp (posn-window start)) |
897 |
(window-buffer (posn-window start)))))) |
(window-buffer (posn-window start)))))) |
898 |
(if button |
(if button |
1315 |
:indent nil |
:indent nil |
1316 |
:offset 0 |
:offset 0 |
1317 |
:format-handler 'widget-default-format-handler |
:format-handler 'widget-default-format-handler |
1318 |
:button-face-get 'widget-default-button-face-get |
:button-face-get 'widget-default-button-face-get |
1319 |
:sample-face-get 'widget-default-sample-face-get |
:sample-face-get 'widget-default-sample-face-get |
1320 |
:delete 'widget-default-delete |
:delete 'widget-default-delete |
1321 |
:copy 'identity |
:copy 'identity |
1322 |
:value-set 'widget-default-value-set |
:value-set 'widget-default-value-set |
1532 |
(or (widget-get widget :always-active) |
(or (widget-get widget :always-active) |
1533 |
(and (not (widget-get widget :inactive)) |
(and (not (widget-get widget :inactive)) |
1534 |
(let ((parent (widget-get widget :parent))) |
(let ((parent (widget-get widget :parent))) |
1535 |
(or (null parent) |
(or (null parent) |
1536 |
(widget-apply parent :active)))))) |
(widget-apply parent :active)))))) |
1537 |
|
|
1538 |
(defun widget-default-deactivate (widget) |
(defun widget-default-deactivate (widget) |
1726 |
(find-file (locate-library (widget-value widget)))) |
(find-file (locate-library (widget-value widget)))) |
1727 |
|
|
1728 |
;;; The `emacs-commentary-link' Widget. |
;;; The `emacs-commentary-link' Widget. |
1729 |
|
|
1730 |
(define-widget 'emacs-commentary-link 'link |
(define-widget 'emacs-commentary-link 'link |
1731 |
"A link to Commentary in an Emacs Lisp library file." |
"A link to Commentary in an Emacs Lisp library file." |
1732 |
:action 'widget-emacs-commentary-link-action) |
:action 'widget-emacs-commentary-link-action) |
1733 |
|
|
1734 |
(defun widget-emacs-commentary-link-action (widget &optional event) |
(defun widget-emacs-commentary-link-action (widget &optional event) |
1735 |
"Find the Commentary section of the Emacs file specified by WIDGET." |
"Find the Commentary section of the Emacs file specified by WIDGET." |
1736 |
(finder-commentary (widget-value widget))) |
(finder-commentary (widget-value widget))) |
3057 |
|
|
3058 |
(defvar widget-coding-system-prompt-value-history nil |
(defvar widget-coding-system-prompt-value-history nil |
3059 |
"History of input to `widget-coding-system-prompt-value'.") |
"History of input to `widget-coding-system-prompt-value'.") |
3060 |
|
|
3061 |
(define-widget 'coding-system 'symbol |
(define-widget 'coding-system 'symbol |
3062 |
"A MULE coding-system." |
"A MULE coding-system." |
3063 |
:format "%{%t%}: %v" |
:format "%{%t%}: %v" |
3422 |
|
|
3423 |
;;; The `color' Widget. |
;;; The `color' Widget. |
3424 |
|
|
3425 |
;; Fixme: match |
;; Fixme: match |
3426 |
(define-widget 'color 'editable-field |
(define-widget 'color 'editable-field |
3427 |
"Choose a color name (with sample)." |
"Choose a color name (with sample)." |
3428 |
:format "%t: %v (%{sample%})\n" |
:format "%t: %v (%{sample%})\n" |