]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/wid-edit.el (widget-color--choose-action): Use a closure
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 7 Jul 2017 21:02:27 +0000 (17:02 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 7 Jul 2017 21:02:27 +0000 (17:02 -0400)
lisp/wid-edit.el

index ca402c18e536e05263ae00d22acb6b10efc24752..a1b8ed28cae2b999b39108ee9e4521f8c2d4f73d 100644 (file)
@@ -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