dotemacs

My Emacs configuration
git clone git://git.entf.net/dotemacs
Log | Files | Refs | LICENSE

sly-retro.el (791B)


      1 ;; -*- lexical-binding: t; -*-
      2 (require 'sly)
      3 
      4 (define-sly-contrib sly-retro
      5   "Enable SLIME to connect to a SLY-started SLYNK"
      6   (:slynk-dependencies slynk/retro)
      7   (:on-load (setq sly-net-send-translator #'sly-retro-slynk-to-swank))
      8   (:on-unload (setq sly-net-send-translator nil)))
      9 
     10 (defun sly-retro-slynk-to-swank (sexp)
     11   (cond ((and sexp
     12               (symbolp sexp)
     13               (string-match "^slynk\\(.*\\)$" (symbol-name sexp)))
     14          (intern (format "swank%s" (match-string 1 (symbol-name sexp)))))
     15         ((and sexp (listp sexp))
     16          (cl-loop for (x . rest) on sexp
     17                   append (list (sly-retro-slynk-to-swank x)) into foo
     18                   finally (return (append foo (sly-retro-slynk-to-swank rest)))))
     19         (t
     20          sexp)))
     21 
     22 (provide 'sly-retro)