diff --git a/doc/index.md b/doc/index.md index 7da9d34..6111730 100644 --- a/doc/index.md +++ b/doc/index.md @@ -76,6 +76,7 @@ The following programming languages have enhanced support in Prelude: - Org Mode - Perl - [Python](modules/python.md) +- Racket - [Ruby](modules/ruby.md) - Rust - Scala diff --git a/modules/prelude-racket.el b/modules/prelude-racket.el new file mode 100644 index 0000000..44a1299 --- /dev/null +++ b/modules/prelude-racket.el @@ -0,0 +1,52 @@ +;;; prelude-racket.el --- Emacs Prelude: Racket programming support. +;; +;; Copyright © 2011-2021 Bozhidar Batsov +;; +;; Author: Xiongfei Shi +;; URL: https://github.com/bbatsov/prelude + +;; This file is not part of GNU Emacs. + +;;; Commentary: + +;; Basic configuration for Racket programming. + +;;; License: + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License +;; as published by the Free Software Foundation; either version 3 +;; of the License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(prelude-require-packages '(racket-mode)) +(require 'prelude-lisp) + +(with-eval-after-load 'racket-mode + (define-key racket-mode-map (kbd "M-RET") 'racket-run) + (define-key racket-mode-map (kbd "M-.") 'racket-repl-visit-definition)) + +(add-hook 'racket-mode-hook #'racket-unicode-input-method-enable) +(add-hook 'racket-repl-mode-hook #'racket-unicode-input-method-enable) + +(add-hook 'racket-mode-hook (lambda () (run-hooks 'prelude-lisp-coding-hook))) +(add-hook 'racket-mode-hook (lambda () (setq-local whitespace-line-column 102))) + +(add-to-list 'auto-mode-alist '("\\.rkt$" . racket-mode)) +(add-to-list 'auto-mode-alist '("\\.rkt?\\'" . racket-mode)) +(add-to-list 'auto-mode-alist '("\\.rkt\\'" . racket-mode)) + +(provide 'prelude-racket) + +;;; prelude-racket ends here diff --git a/sample/prelude-modules.el b/sample/prelude-modules.el index 8f1aa23..6cf8d1c 100644 --- a/sample/prelude-modules.el +++ b/sample/prelude-modules.el @@ -83,6 +83,7 @@ ;; (require 'prelude-ocaml) (require 'prelude-perl) ;; (require 'prelude-python) +;; (require 'prelude-racket) ;; (require 'prelude-ruby) ;; (require 'prelude-rust) ;; (require 'prelude-scala)