Klimi's new dotfiles with stow.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

36 řádky
1.3 KiB

před 5 roky
  1. (eval-and-compile
  2. (require 'slime))
  3. (define-slime-contrib slime-buffer-streams
  4. "Lisp streams that output to an emacs buffer"
  5. (:authors "Ed Langley <el-github@elangley.org>")
  6. (:license "GPL")
  7. (:swank-dependencies swank-buffer-streams))
  8. (defslimefun slime-make-buffer-stream-target (thread name)
  9. (message "making target %s" name)
  10. (slime-buffer-streams--get-target-marker name)
  11. `(:stream-target-created ,thread ,name))
  12. (defun slime-buffer-streams--get-target-name (target)
  13. (format "*slime-target %s*" target))
  14. (defvar-local slime-buffer-stream-target nil)
  15. ;; TODO: tell backend that the buffer has been closed, so it can close
  16. ;; the stream
  17. (defun slime-buffer-streams--cleanup-markers ()
  18. (when slime-buffer-stream-target
  19. (message "Removing target: %s" slime-buffer-stream-target)
  20. (remhash slime-buffer-stream-target slime-output-target-to-marker)))
  21. (defun slime-buffer-streams--get-target-marker (target)
  22. (or (gethash target slime-output-target-to-marker)
  23. (with-current-buffer
  24. (generate-new-buffer (slime-buffer-streams--get-target-name target))
  25. (setq slime-buffer-stream-target target)
  26. (add-hook 'kill-buffer-hook 'slime-buffer-streams--cleanup-markers)
  27. (setf (gethash target slime-output-target-to-marker)
  28. (point-marker)))))
  29. (provide 'slime-buffer-streams)