Mercurial > hg > xemacs-beta
comparison lisp/wid-edit.el @ 5473:ac37a5f7e5be
Merge with trunk.
author | Mats Lidell <matsl@xemacs.org> |
---|---|
date | Thu, 17 Mar 2011 23:42:59 +0100 |
parents | 308d34e9f07d f00192e1cd49 |
children | 7a81b4d98d2d |
comparison
equal
deleted
inserted
replaced
5472:e79980ee5efe | 5473:ac37a5f7e5be |
---|---|
2483 (let* ((external (widget-value widget)) | 2483 (let* ((external (widget-value widget)) |
2484 (internal (widget-apply old :value-to-internal external))) | 2484 (internal (widget-apply old :value-to-internal external))) |
2485 (widget-put old :value internal))) | 2485 (widget-put old :value internal))) |
2486 ;; Find new choice. | 2486 ;; Find new choice. |
2487 (setq current | 2487 (setq current |
2488 (cond ((= (length args) 0) | 2488 (cond ((eql (length args) 0) |
2489 nil) | 2489 nil) |
2490 ((= (length args) 1) | 2490 ((eql (length args) 1) |
2491 (nth 0 args)) | 2491 (nth 0 args)) |
2492 ((and widget-choice-toggle | 2492 ((and widget-choice-toggle |
2493 (= (length args) 2) | 2493 (eql (length args) 2) |
2494 (memq old args)) | 2494 (memq old args)) |
2495 (if (eq old (nth 0 args)) | 2495 (if (eq old (nth 0 args)) |
2496 (nth 1 args) | 2496 (nth 1 args) |
2497 (nth 0 args))) | 2497 (nth 0 args))) |
2498 (t | 2498 (t |
3635 ;; Read file from minibuffer. | 3635 ;; Read file from minibuffer. |
3636 (let ((answer (completing-read (concat prompt ": ") obarray | 3636 (let ((answer (completing-read (concat prompt ": ") obarray |
3637 (widget-get widget :prompt-match) | 3637 (widget-get widget :prompt-match) |
3638 nil initial history))) | 3638 nil initial history))) |
3639 (if (and (stringp answer) | 3639 (if (and (stringp answer) |
3640 (not (zerop (length answer)))) | 3640 (not (eql (length answer) 0))) |
3641 answer | 3641 answer |
3642 (error "No value")))) | 3642 (error "No value")))) |
3643 | 3643 |
3644 (defvar widget-function-prompt-value-history nil | 3644 (defvar widget-function-prompt-value-history nil |
3645 "History of input to `widget-function-prompt-value'.") | 3645 "History of input to `widget-function-prompt-value'.") |
4027 | 4027 |
4028 (defun widget-color-action (widget &optional event) | 4028 (defun widget-color-action (widget &optional event) |
4029 "Prompt for a color." | 4029 "Prompt for a color." |
4030 (let* ((tag (widget-apply widget :menu-tag-get)) | 4030 (let* ((tag (widget-apply widget :menu-tag-get)) |
4031 (answer (read-color (concat tag ": ")))) | 4031 (answer (read-color (concat tag ": ")))) |
4032 (unless (zerop (length answer)) | 4032 (unless (eql (length answer) 0) |
4033 (widget-value-set widget answer) | 4033 (widget-value-set widget answer) |
4034 (widget-setup) | 4034 (widget-setup) |
4035 (widget-apply widget :notify widget event)))) | 4035 (widget-apply widget :notify widget event)))) |
4036 | 4036 |
4037 (defun widget-color-notify (widget child &optional event) | 4037 (defun widget-color-notify (widget child &optional event) |