From 2fcdb953634909703dbbc99269782c09df971505 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 7 Jul 2017 17:02:27 -0400 Subject: [PATCH] * lisp/wid-edit.el (widget-color--choose-action): Use a closure --- lisp/wid-edit.el | 20 +++++++++++--------- 1 file 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: (defun widget-color--choose-action (widget &optional _event) (list-colors-display nil nil - `(lambda (color) - (when (buffer-live-p ,(current-buffer)) - (widget-value-set ',(widget-get widget :parent) color) - (let* ((buf (get-buffer "*Colors*")) - (win (get-buffer-window buf 0))) - (if win - (quit-window nil win) - (bury-buffer buf))) - (pop-to-buffer ,(current-buffer)))))) + (let ((cbuf ,(current-buffer)) + (wp (widget-get widget :parent))) + (lambda (color) + (when (buffer-live-p cbuf) + (widget-value-set wp color) + (let* ((buf (get-buffer "*Colors*")) + (win (get-buffer-window buf 0))) + (if win + (quit-window nil win) + (bury-buffer buf))) + (pop-to-buffer cbuf)))))) (defun widget-color-sample-face-get (widget) (let* ((value (condition-case nil -- 2.39.5