diff options
| author | Richard M. Stallman | 2002-07-23 19:20:53 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-07-23 19:20:53 +0000 |
| commit | ab6a36685e9e503485e6cff1533f81eb22c072c9 (patch) | |
| tree | d6e17bfba26eea2af01d63c05adaaa44aba6bdb6 | |
| parent | 608dc4173fde54c1441b1d8762550deb72dcf761 (diff) | |
| download | emacs-ab6a36685e9e503485e6cff1533f81eb22c072c9.tar.gz emacs-ab6a36685e9e503485e6cff1533f81eb22c072c9.zip | |
(widget-convert): Handle an argument that's a keyword.
Recognize explicit :args specification.
| -rw-r--r-- | lisp/wid-edit.el | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 3fcb58d78f0..65c2c6fb28b 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -722,18 +722,32 @@ The optional ARGS are additional keyword arguments." | |||
| 722 | (list type) | 722 | (list type) |
| 723 | (copy-sequence type))) | 723 | (copy-sequence type))) |
| 724 | (current widget) | 724 | (current widget) |
| 725 | done | ||
| 725 | (keys args)) | 726 | (keys args)) |
| 726 | ;; First set the :args keyword. | 727 | ;; First set the :args keyword. |
| 727 | (while (cdr current) ;Look in the type. | 728 | (while (cdr current) ;Look in the type. |
| 728 | (if (keywordp (car (cdr current))) | 729 | (if (and (keywordp (cadr current)) |
| 729 | (setq current (cdr (cdr current))) | 730 | ;; If the last element is a keyword, |
| 731 | ;; it is still the :args element, | ||
| 732 | ;; even though it is a keyword. | ||
| 733 | (cddr current)) | ||
| 734 | (if (eq (cadr current) :args) | ||
| 735 | ;; If :args is explicitly specified, obey it. | ||
| 736 | (setq current nil) | ||
| 737 | ;; Some other irrelevant keyword. | ||
| 738 | (setq current (cdr (cdr current)))) | ||
| 730 | (setcdr current (list :args (cdr current))) | 739 | (setcdr current (list :args (cdr current))) |
| 731 | (setq current nil))) | 740 | (setq current nil))) |
| 732 | (while args ;Look in the args. | 741 | (while (and args (not done)) ;Look in ARGS. |
| 733 | (if (keywordp (nth 0 args)) | 742 | (cond ((eq (car args) :args) |
| 734 | (setq args (nthcdr 2 args)) | 743 | ;; Handle explicit specification of :args. |
| 735 | (widget-put widget :args args) | 744 | (setq args (cadr args) |
| 736 | (setq args nil))) | 745 | done t)) |
| 746 | ((keywordp (car args)) | ||
| 747 | (setq args (cddr args))) | ||
| 748 | (t (setq done t)))) | ||
| 749 | (when done | ||
| 750 | (widget-put widget :args args)) | ||
| 737 | ;; Then Convert the widget. | 751 | ;; Then Convert the widget. |
| 738 | (setq type widget) | 752 | (setq type widget) |
| 739 | (while type | 753 | (while type |