X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/93c531f0aa714e4c4edb9f4494fd21e13631b81c..f5f00c2b27027408c9a16415d6e9ddec1839524d:/gtk/gtk.lisp diff --git a/gtk/gtk.lisp b/gtk/gtk.lisp index fc9d2ca..1cacb45 100644 --- a/gtk/gtk.lisp +++ b/gtk/gtk.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtk.lisp,v 1.87 2008/01/02 15:57:57 espen Exp $ +;; $Id: gtk.lisp,v 1.89 2008/01/11 14:44:28 espen Exp $ (in-package "GTK") @@ -129,15 +129,19 @@ #?-(or (featurep :cmu) (sbcl< 1 0 6)) ;; When running in Slime we need to hook into the Swank server ;; to handle events asynchronously. - (if (find-package "SWANK") - (let ((read-from-emacs (symbol-function (find-symbol "READ-FROM-EMACS" "SWANK"))) - (stream (funcall (find-symbol "CONNECTION.SOCKET-IO" "SWANK") (symbol-value (find-symbol "*EMACS-CONNECTION*" "SWANK"))))) - (setf (symbol-function (find-symbol "READ-FROM-EMACS" "SWANK")) - #'(lambda () - (loop - (case (socket-status (cons stream :input) 0 *event-poll-interval*) - ((:input :eof) (return (funcall read-from-emacs))) - (otherwise (main-iterate-all))))))) + (unless (and + (find-package "SWANK") + (let ((connection (symbol-value (find-symbol "*EMACS-CONNECTION*" "SWANK")))) + (when connection + (let ((read-from-emacs (symbol-function (find-symbol "READ-FROM-EMACS" "SWANK"))) + (stream (funcall (find-symbol "CONNECTION.SOCKET-IO" "SWANK") connection))) + (setf (symbol-function (find-symbol "READ-FROM-EMACS" "SWANK")) + #'(lambda () + (loop + (case (socket-status (cons stream :input) 0 + *event-poll-interval*) + ((:input :eof) (return (funcall read-from-emacs))) + (otherwise (main-iterate-all)))))))))) #-(and clisp readline) (warn "Asynchronous event handling not supported on this platform. An explicit main loop has to be started.")) @@ -706,10 +710,13 @@ ;;; Color selection -(defbinding (color-selection-is-adjusting-p - "gtk_color_selection_is_adjusting") () boolean +(defbinding color-selection-is-adjusting-p () boolean (colorsel color-selection)) +(defbinding (color-selection-previous-color + "gtk_color_selection_get_previous_color") () nil + (colorsel color-selection) + ((make-instance 'gdk:color) gdk:color :in/return)) ;;; Color selection dialog -- no functions