1.2.0 permalink Arrow_down_16x16



  • (eval-for-emacs form buffer-package id)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source swank/core.clj:235 top

(defn eval-for-emacs [form buffer-package id]
   (binding [*current-package* buffer-package
             *pending-continuations* (cons id *pending-continuations*)]
     (if-let [f (slime-fn (first form))]
       (let [form (cons f (rest form))
             result (doall-seq (eval-in-emacs-package form))]
         (run-hook *pre-reply-hook*)
         (send-to-emacs `(:return ~(thread-name (current-thread))
                                  (:ok ~result) ~id)))
       ;; swank function not defined, abort
       (send-to-emacs `(:return ~(thread-name (current-thread)) (:abort) ~id))))
   (catch Throwable t
     ;; Thread/interrupted clears this thread's interrupted status; if
     ;; Thread.stop was called on us it may be set and will cause an
     ;; InterruptedException in one of the send-to-emacs calls below

     ;; (.printStackTrace t #^java.io.PrintWriter *err*)

      (debug-quit-exception? t)
        (send-to-emacs `(:return ~(thread-name (current-thread)) (:abort) ~id))
        (if-not (zero? *sldb-level*)
          (throw t)))

      (debug-abort-exception? t)
        (send-to-emacs `(:return ~(thread-name (current-thread)) (:abort) ~id))
        (if-not (zero? *sldb-level*)
          (throw *debug-abort-exception*)))

      (debug-continue-exception? t)
        (send-to-emacs `(:return ~(thread-name (current-thread)) (:abort) ~id))
        (throw t))

        (set! *e t)
          (if *debug-swank-clojure* t (.getCause t))
         ;; reply with abort
         (finally (send-to-emacs `(:return ~(thread-name (current-thread)) (:abort) ~id)))))))))
Vars in swank.core/eval-for-emacs: *e binding cond defn if-let if-not let zero? concat list seq
Used in 0 other vars

Comments top

No comments for eval-for-emacs. Log in to add a comment.