From: Stefan Monnier Date: Fri, 7 Jul 2017 21:02:27 +0000 (-0400) Subject: * lisp/wid-edit.el (widget-color--choose-action): Use a closure X-Git-Tag: emacs-26.0.90~518^2~161 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2fcdb953634909703dbbc99269782c09df971505;p=emacs.git * lisp/wid-edit.el (widget-color--choose-action): Use a closure --- 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