Advertisement
IRCrpg

slime-config.el

Jan 3rd, 2023
2,375
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 7.37 KB | None | 0 0
  1. (unless (fboundp 'common-lisp-mode)
  2.     (defalias 'common-lisp-mode 'lisp-mode))
  3. (require 'slime)
  4.  
  5.  
  6. (defun slime-maybe-redirect-inferior-output ()
  7.    (when (slime-connected-p)
  8.      (slime-redirect-inferior-output)))
  9.  
  10. ;;; this is used to cause other threads to write output to the slime
  11. ;;; repl buffer, instead of to the inferior lisp buffer
  12. ;;(add-hook 'slime-mode-hook 'slime-maybe-redirect-inferior-output)
  13. (add-hook 'slime-mode-hook 'enable-paredit-mode)
  14.  
  15.  (require 'recentf)
  16.  (pushnew "Map_Sym.txt" recentf-exclude)
  17.  
  18. (slime-setup '(slime-fancy
  19.                slime-asdf
  20.                slime-tramp
  21.                slime-indentation
  22.                ;; included in slime-fancy
  23.                ;; slime-repl
  24.                ))
  25.  
  26. ;; populate SLIME-LISP-IMPLEMENTATIONS in a portable way
  27. (defmacro defslime-start (name mapping)
  28.   `(defun ,name ()
  29.      (interactive)
  30.      (let ((slime-default-lisp ,mapping))
  31.        (slime)
  32.        (slime-eval '(cl-user::smite)))))
  33.  
  34. (loop for name in '(mlisp alisp sbcl sbcl-cvs clozure cmucl abcl clisp ecl lispworks mkcl
  35.                           m1-allegro m1-smp-allegro)
  36.       for exe-var = (intern (concat (symbol-name name) "-executable"))
  37.       when (and (boundp exe-var) (eval exe-var))
  38.       unless (find name slime-lisp-implementations :key 'first)
  39.       do (push `(,name (,(eval exe-var)) ,@(when (member name '(mlisp alisp))
  40.                                              `(:env (list (concat "LD_LIBRARY_PATH=" (getenv "LDLPATH"))))))
  41.                slime-lisp-implementations)
  42.       (eval `(defun ,name ()
  43.                (interactive)
  44.                (let ((slime-default-lisp ',name))
  45.                  (slime)))))
  46. (setq slime-default-lisp 'sbcl)
  47.  
  48.  
  49. ;;; Running STRATUS
  50. ;; (push `(stratus-lisp ,(list alisp-executable
  51. ;;                             "-I"
  52. ;;                             (expand-file-name "~/stratus/stratus-trunk/code/bin/stratus.dxl")))
  53. ;;       slime-lisp-implementations)
  54.  
  55. ;; (push `(mission-lisp ,(list alisp-executable
  56. ;;                             "-I"
  57. ;;                             (expand-file-name "~/stratus/stratus-trunk/code/bin/mission.dxl")))
  58. ;;       slime-lisp-implementations)
  59.  
  60.  
  61. ;; (push `(stratus-sim ,(list alisp-executable
  62. ;;                             "-I"
  63. ;;                             (expand-file-name "~/stratus/stratus-trunk/code/bin/simulator.dxl")))
  64. ;;       slime-lisp-implementations)
  65.  
  66.  
  67. ;; (push `(mifde-lisp ,(list alisp-executable
  68. ;;                             "-I"
  69. ;;                             (expand-file-name "~/stratus/stratus-trunk/code/bin/mifd-experiments.dxl")))
  70. ;;       slime-lisp-implementations)
  71.  
  72. ;; (push `(qs-abcl ,(list (expand-file-name "~/prismatic/code/quiksilver/abcl/prism-abcl")
  73. ;;                        "--eval" "(qs)"))
  74. ;;       slime-lisp-implementations)
  75.  
  76. (push `(shop-sbcl ,(list sbcl-executable
  77.                          "--dynamic-space-size" "4000"))
  78.       slime-lisp-implementations)
  79.  
  80. (push `(yappr-sbcl ,(list sbcl-executable
  81.                           "--dynamic-space-size" "4000"
  82.                           "--userinit" "/Users/rpg/lisp/yappr3/yappr3-sbclrc"))
  83.       slime-lisp-implementations)
  84.  
  85. (defun yappr-sbcl ()
  86.   (interactive)
  87.   (let ((slime-default-lisp 'yappr-sbcl))
  88.     (slime)))
  89.  
  90.  
  91.  
  92. ;; (defun stratus-lisp ()
  93. ;;   (interactive)
  94. ;;   (let ((slime-default-lisp 'stratus-lisp))
  95. ;;     (slime)))
  96.  
  97. ;; (defun mission-lisp ()
  98. ;;   (interactive)
  99. ;;   (let ((slime-default-lisp 'mission-lisp))
  100. ;;     (slime)))
  101.  
  102.  
  103. ;; (defun stratus-sim ()
  104. ;;   (interactive)
  105. ;;   (let ((slime-default-lisp 'stratus-sim))
  106. ;;     (slime)))
  107.  
  108.  
  109. ;; (defun mifde-lisp ()
  110. ;;   (interactive)
  111. ;;   (let ((slime-default-lisp 'mifde-lisp))
  112. ;;     (slime)))
  113.  
  114. (defun shop-sbcl ()
  115.   (interactive)
  116.   (let ((slime-default-lisp 'shop-sbcl))
  117.     (slime)))
  118.  
  119.  
  120. ;; (setq lisp-simple-loop-indentation 1
  121. ;;       lisp-loop-keyword-indentation 6
  122. ;;       lisp-loop-forms-indentation 6)
  123.  
  124. ;;(slime-define-key (kbd "M-.") 'slime-edit-definition)
  125. ;;(slime-define-key (kbd "<return>") 'newline-and-indent)
  126. (define-key slime-mode-map (kbd "C-c l") 'slime-selector)
  127. (define-key slime-mode-map (kbd "<f3>") 'insert-section-comment)
  128. (define-key slime-mode-map (kbd "<f4>") 'insert-file-comment)
  129. (define-key slime-parent-map (kbd "<f6>") 'hyperspec-lookup)
  130. (define-key slime-mode-map (kbd "C-c c") 'slime-compile-defun)
  131. (define-key slime-mode-map (kbd "C-c ;") 'comment-region)
  132. ;; replicate Franz ELI behavior
  133. (define-key slime-mode-map (kbd "C-j") 'newline-and-indent)
  134. (define-key slime-mode-map (kbd "C-c a") 'slime-arglist)
  135. (define-key slime-mode-map (kbd "C-c t") 'slime-toggle-trace-fdefinition)
  136. (define-key slime-mode-map (kbd "C-c d") 'slime-documentation)
  137. (define-key slime-mode-map (kbd "C-c D") 'slime-documentation-lookup)
  138. (define-key slime-mode-map (kbd "C-x C-M-e") 'slime-eval-print-last-expression)
  139. (define-key slime-mode-map (kbd "C-c l") 'slime-selector)
  140. (define-key slime-repl-mode-map (kbd "C-c l") 'slime-selector)
  141. (define-key sldb-mode-map (kbd "C-c l") 'slime-selector)
  142.  
  143. (define-key slime-mode-map (kbd "C-c m") 'slime-macroexpand-1)
  144. ;;; try to get the slime context menu back from aquamacs
  145. (when (boundp 'osx-key-mode-map)
  146.   (define-key osx-key-mode-map [down-mouse-3] nil))
  147.  
  148. ;;(setq lisp-indent-function 'common-lisp-indent-function)
  149.  
  150. (autoload 'cl-template-populate-tempo-map "cl-templates"
  151.   "Install a substidiary keymap for tempo templates
  152. of CL forms.")
  153.  
  154. (defun slime-init-cl-templates ()
  155.   (let ((tempo-map (make-sparse-keymap "lisp-tempo-map")))
  156.     (let ((command
  157.            (define-prefix-command 'slime-cl-template nil
  158.              "Common Lisp Templates")))
  159.       (define-key slime-mode-map (kbd "C-c C-c") 'slime-cl-template)
  160.       (cl-template-populate-tempo-map slime-cl-template)
  161.       )))
  162.  
  163. (slime-init-cl-templates)
  164.  
  165. (add-hook 'lisp-mode-hook
  166.           '(lambda ()
  167.              ;;            (setq show-trailing-whitespace t)
  168.              (make-local-variable 'write-contents-hooks)
  169.              (add-hook 'write-contents-hooks 'kill-all-tabs-if-applicable)))
  170.  
  171. ;;;---------------------------------------------------------------------------
  172. ;;; Use fic mode and configure it...
  173. ;;;---------------------------------------------------------------------------
  174. (add-hook 'lisp-mode-hook
  175.           '(lambda ()
  176.              (fic-mode)
  177.              (make-variable-buffer-local 'fic-search-list-re)
  178.              (setq fic-search-list-re "\\<\\(BUG\\|FIXME\\|KLUDGE\\|TODO\\)")))
  179.  
  180. ;;;---------------------------------------------------------------------------
  181. ;;; Nicer display of docstrings
  182. ;;;---------------------------------------------------------------------------
  183. ;; (defun slime-describe-function (symbol-name)
  184. ;;   (interactive (list (slime-read-symbol-name "Describe symbol: ")))
  185. ;;   (when (not symbol-name)
  186. ;;     (error "No symbol given"))
  187. ;;   (slime-eval-describe `(swank:describe-function ,symbol-name)))
  188.  
  189. ;;;---------------------------------------------------------------------------
  190. ;;; New history behavior
  191. ;;;---------------------------------------------------------------------------
  192. (setq slime-repl-eli-history-behavior t)
  193. (define-key slime-repl-mode-map "\M-p" 'slime-repl-previous-input-nomatch)
  194. (define-key slime-repl-mode-map "\M-P" 'slime-repl-previous-input)
  195. (define-key slime-repl-mode-map "\M-n" 'slime-repl-next-input-nomatch)
  196. (define-key slime-repl-mode-map "\M-N" 'slime-repl-next-input)
  197.  
  198.  
  199. (provide 'slime-config)
  200.  
Advertisement
Comments
  • elizbthmiller
    1 year
    1. https://opensea.io/collection/kids-choice-awards-free-live-stream-2023
    2. https://opensea.io/collection/ufc-285-fight-live-coverage
    3. https://opensea.io/collection/ufc-285-watch-party-in-las-vegas-live
    4. https://opensea.io/collection/ufc-285-jon-jones-vs-cyril-gane-live-streaming
    5. https://opensea.io/collection/free-livestream-ufc-285
    6. https://opensea.io/collection/live-usa-powerlifting-at-the-arnold-sports-festiva
    7. https://opensea.io/collection/livestream-usa-powerlifting-arnold-sports-festiva
    8. https://opensea.io/collection/livestream-usa-powerlifting-oregon-state-champion
    9. https://opensea.io/collection/livestream-usa-powerlifting-oregon-state-champio
    10. https://opensea.io/collection/livestream-usa-powerlifting-womens-forida-open2023
    11. https://opensea.io/collection/livestream-usa-powerlifting-womens-forida-open
    12. https://opensea.io/collection/live-usa-powerlifting-wisconsin-highschool-champio
    13. https://opensea.io/collection/usa-powerlifting-wisconsin-highschool-championship
    14. https://opensea.io/collection/livestream-usa-powerlifting-pelican-state-open2023
    15. https://opensea.io/collection/livestream-usa-powerlifting-pelican-state-open
    16. https://opensea.io/collection/livestream-usa-powerlifting-china-spring-classic
    17. https://opensea.io/collection/livestreamin-usa-powerlifting-china-spring-classic
    18. https://opensea.io/collection/-live-strength-lab-open-usa-powerlifting-australia
    19. https://opensea.io/collection/live-strength-lab-open-usapowerlifting-australia
    20. https://opensea.io/collection/livestream-2023-ocb-albuquerque-natural
    21. https://opensea.io/collection/live-stream-2023-ocb-albuquerque-natural
    22. https://opensea.io/collection/livestream-ifbb-arnold-classic-usa-2023
    23. https://opensea.io/collection/live-stream-ifbb-arnold-classic-2023-usa
    24. https://opensea.io/collection/livestream-2023-arnold-sports-festival
    25. https://opensea.io/collection/live-stream-the-arnold-sports-festival-2023
    26. https://opensea.io/collection/livestream-2023-european-athletics-indoor-champion
    27. https://opensea.io/collection/live-european-athletics-indoor-champion-turkiye
    28. https://opensea.io/collection/livestream-2023-roma-ostia-half-marathon
    29. https://opensea.io/collection/live-stream-roma-ostia-half-marathon-2023
    30. https://opensea.io/collection/livestream-tokyo-marathon-2023
    31. https://opensea.io/collection/live-stream-2023-tokyo-marathon
    32. https://opensea.io/collection/livestream-macpac-motatapu-off-road-marathon-2023
    33. https://opensea.io/collection/live-stream-macpac-motatapu-off-road-marathon-2023
    34. https://opensea.io/collection/livestream-antalya-marathon-2023
    35. https://opensea.io/collection/livestream-2023-vias-verdes-marathon-girona
    36. https://opensea.io/collection/live-croatia-national-winter-throwing-championship
    37. https://opensea.io/collection/livestream-planica-nordic-world-ski-championships
    38. https://opensea.io/collection/livestream-slovenia-nordic-world-ski-championships
    39. https://opensea.io/collection/live-bakuriani-fis-snowboarding-world-championship
    40. https://opensea.io/collection/live-bakuriani-fis-freestyle-world-ski-championshi
    41. https://opensea.io/collection/livestream-world-junior-curling-championship-2023
    42. https://opensea.io/collection/livestream-world-junior-figure-skating-shampionshi
    43. https://opensea.io/collection/fig-artistic-gymnastics-world-cup-doha-2023
    44. https://opensea.io/collection/livestream-biathlon-ibu-cup-2023
    45. https://opensea.io/collection/livestream-equestrian-global-champions-tour
    46. https://opensea.io/collection/isu-world-single-distance-speed-skating-championsh
    47. https://opensea.io/collection/livestream-ibu-biathlon-world-cup
    48. https://opensea.io/collection/livestream-world-triathlon-championship-series
    49. https://opensea.io/collection/livestream-hsbc-womens-world-championship
    50. https://opensea.io/collection/livestream-2023-arnold-palmer-invitational
    51. https://opensea.io/collection/livestream-hsbc-world-rugby-sevens-series
    52. https://opensea.io/collection/livestream-vancouver-hsbc-world-rugby-seven-series
    53. https://opensea.io/collection/livestream-fencing-world-cup-2023
    54. https://opensea.io/collection/livestream-f1-bahrain-grand-prix
    55. https://opensea.io/collection/free-live-f1-bahrain-grand-prix-2023
    56. https://opensea.io/collection/livestream-uci-cycling-strade-bianchel-2023
    57. https://opensea.io/collection/uci-cycling-strade-bianchel-live-stream-2023
    58. https://opensea.io/collection/livestream-uci-cycling-paris-nice
    59.  
    60.  
    61.  
    62.  
Add Comment
Please, Sign In to add comment
Advertisement