Emacs config utilizing prelude as a base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.9 KiB

  1. ;;; prelude-common-lisp.el --- Emacs Prelude: lisp-mode and SLIME config.
  2. ;;
  3. ;; Copyright © 2011-2021 Bozhidar Batsov
  4. ;;
  5. ;; Author: Bozhidar Batsov <bozhidar@batsov.com>
  6. ;; URL: https://github.com/bbatsov/prelude
  7. ;; This file is not part of GNU Emacs.
  8. ;;; Commentary:
  9. ;; Configuration for lisp-mode and SLIME.
  10. ;;; License:
  11. ;; This program is free software; you can redistribute it and/or
  12. ;; modify it under the terms of the GNU General Public License
  13. ;; as published by the Free Software Foundation; either version 3
  14. ;; of the License, or (at your option) any later version.
  15. ;;
  16. ;; This program is distributed in the hope that it will be useful,
  17. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;; GNU General Public License for more details.
  20. ;;
  21. ;; You should have received a copy of the GNU General Public License
  22. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  23. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  24. ;; Boston, MA 02110-1301, USA.
  25. ;;; Code:
  26. (require 'prelude-lisp)
  27. (prelude-require-package 'slime)
  28. ;; the SBCL configuration file is in Common Lisp
  29. (add-to-list 'auto-mode-alist '("\\.sbclrc\\'" . lisp-mode))
  30. ;; Open files with .cl extension in lisp-mode
  31. (add-to-list 'auto-mode-alist '("\\.cl\\'" . lisp-mode))
  32. (add-hook 'lisp-mode-hook (lambda () (run-hooks 'prelude-lisp-coding-hook)))
  33. (with-eval-after-load "slime"
  34. ;; a list of alternative Common Lisp implementations that can be
  35. ;; used with SLIME. Note that their presence render
  36. ;; inferior-lisp-program useless. This variable holds a list of
  37. ;; programs and if you invoke SLIME with a negative prefix
  38. ;; argument, M-- M-x slime, you can select a program from that list.
  39. (setq slime-lisp-implementations
  40. '((ccl ("ccl"))
  41. (clisp ("clisp" "-q"))
  42. (cmucl ("cmucl" "-quiet"))
  43. (sbcl ("sbcl" "--noinform") :coding-system utf-8-unix)))
  44. ;; select the default value from slime-lisp-implementations
  45. (if (and (eq system-type 'darwin)
  46. (executable-find "ccl"))
  47. ;; default to Clozure CL on macOS
  48. (setq slime-default-lisp 'ccl)
  49. ;; default to SBCL on Linux and Windows
  50. (setq slime-default-lisp 'sbcl))
  51. ;; Add fancy slime contribs
  52. (setq slime-contribs '(slime-fancy slime-cl-indent))
  53. (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol
  54. slime-fuzzy-completion-in-place t
  55. slime-enable-evaluate-in-emacs t
  56. slime-autodoc-use-multiline-p t)
  57. ;; rainbow-delimeters messes up colors in slime-repl, and doesn't seem to work
  58. ;; anyway, so we won't use prelude-lisp-coding-defaults.
  59. (add-hook 'slime-repl-mode-hook (lambda ()
  60. (smartparens-strict-mode +1)
  61. (whitespace-mode -1)))
  62. (define-key slime-mode-map (kbd "C-c C-s") 'slime-selector))
  63. (provide 'prelude-common-lisp)
  64. ;;; prelude-common-lisp.el ends here