diff options
| author | Stefan Monnier | 2017-07-07 17:02:27 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2017-07-07 17:02:27 -0400 |
| commit | 2fcdb953634909703dbbc99269782c09df971505 (patch) | |
| tree | 12b55b4f297a864e20ea4063907443202c22e78c | |
| parent | 21ecda1045f45ba8468a6d1d4519527a18797f27 (diff) | |
| download | emacs-2fcdb953634909703dbbc99269782c09df971505.tar.gz emacs-2fcdb953634909703dbbc99269782c09df971505.zip | |
* lisp/wid-edit.el (widget-color--choose-action): Use a closure
| -rw-r--r-- | lisp/wid-edit.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index ca402c18e53..a1b8ed28cae 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -3694,15 +3694,17 @@ example: | |||
| 3694 | (defun widget-color--choose-action (widget &optional _event) | 3694 | (defun widget-color--choose-action (widget &optional _event) |
| 3695 | (list-colors-display | 3695 | (list-colors-display |
| 3696 | nil nil | 3696 | nil nil |
| 3697 | `(lambda (color) | 3697 | (let ((cbuf ,(current-buffer)) |
| 3698 | (when (buffer-live-p ,(current-buffer)) | 3698 | (wp (widget-get widget :parent))) |
| 3699 | (widget-value-set ',(widget-get widget :parent) color) | 3699 | (lambda (color) |
| 3700 | (let* ((buf (get-buffer "*Colors*")) | 3700 | (when (buffer-live-p cbuf) |
| 3701 | (win (get-buffer-window buf 0))) | 3701 | (widget-value-set wp color) |
| 3702 | (if win | 3702 | (let* ((buf (get-buffer "*Colors*")) |
| 3703 | (quit-window nil win) | 3703 | (win (get-buffer-window buf 0))) |
| 3704 | (bury-buffer buf))) | 3704 | (if win |
| 3705 | (pop-to-buffer ,(current-buffer)))))) | 3705 | (quit-window nil win) |
| 3706 | (bury-buffer buf))) | ||
| 3707 | (pop-to-buffer cbuf)))))) | ||
| 3706 | 3708 | ||
| 3707 | (defun widget-color-sample-face-get (widget) | 3709 | (defun widget-color-sample-face-get (widget) |
| 3708 | (let* ((value (condition-case nil | 3710 | (let* ((value (condition-case nil |