<?xml version="1.0"?>
<paste-with-annotations>
  <paste>
    <number>
      <integer>50762</integer>
    </number>
    <user>
      <string>baggles</string>
    </user>
    <title>
      <string>yay! closures!</string>
    </title>
    <contents>
      <string>(defmacro make-scroll-button ((&amp;rest osd-button-keyargs) 
                              format-text variable-place
                              &amp;key (update-p t)
                              (wheel-delta-form 0.1)
                              minimum
                              maximum)
  `(let ((numeric-writer #'(lambda (new-value)
                             (if ,update-p
                                 (setf ,variable-place
                                       ,(cond 
                                         ((and minimum maximum)
                                          `(max ,minimum (min ,maximum new-value)))
                                         (minimum `(max ,minimum new-value))
                                         (maximum `(min ,maximum new-value))
                                         (t 'new-value)))
                                 ,variable-place))))
     (make-instance 'osd-numeric-input ,@osd-button-keyargs 
                    :text (if ,update-p (format nil ,format-text ,variable-place) &quot;-&quot;)
                    :writer numeric-writer
                    :text-updater #'(lambda () (if ,update-p (format nil ,format-text ,variable-place) &quot;-&quot;))
                    :middle-click
                    (lambda (self) 
                      (unwind-protect 
                           (setf (text-of self)
                                 (format nil ,format-text 
                                         (funcall numeric-writer
                                                  (+ ,variable-place (* ,wheel-delta-form 0.1)))))
                        (signal 'mouse-handled)))
                    :right-click
                    (lambda (self)
                      (unwind-protect
                           (setf (text-of self)
                                 (format nil ,format-text 
                                         (funcall numeric-writer
                                                  (- ,variable-place (* ,wheel-delta-form 0.1)))))
                        (signal 'mouse-handled)))
                    :wheel
                    (lambda (self zrel) 
                      (unwind-protect
                           (setf (text-of self)
                                 (format nil ,format-text 
                                         (funcall numeric-writer
                                                  (+ ,variable-place (* zrel ,wheel-delta-form)))))
                        (signal 'mouse-handled)))
                    ,@(osd-style :button)
                    :name ',(gensym &quot;OSD-CLAMPF-BUTTON-&quot;) ; have to give it a name so it sits in the hash table
                    )))</string>
    </contents>
    <universal-time>
      <integer>3403958597</integer>
    </universal-time>
    <channel>
      <string>#lispcafe</string>
    </channel>
    <colorization-mode>
      <string></string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <null/>
    </is-unicode>
  </paste>
</paste-with-annotations>