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.

85 lines
3.0 KiB

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