Add Racket module (#1321)

This commit is contained in:
Xiongfei Shi 2021-03-14 00:58:10 +08:00 committed by GitHub
parent 32341fe8e9
commit 548178a3b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 0 deletions

View file

@ -76,6 +76,7 @@ The following programming languages have enhanced support in Prelude:
- Org Mode - Org Mode
- Perl - Perl
- [Python](modules/python.md) - [Python](modules/python.md)
- Racket
- [Ruby](modules/ruby.md) - [Ruby](modules/ruby.md)
- Rust - Rust
- Scala - Scala

52
modules/prelude-racket.el Normal file
View file

@ -0,0 +1,52 @@
;;; prelude-racket.el --- Emacs Prelude: Racket programming support.
;;
;; Copyright © 2011-2021 Bozhidar Batsov
;;
;; Author: Xiongfei Shi <xiongfei.shi@icloud.com>
;; 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

View file

@ -83,6 +83,7 @@
;; (require 'prelude-ocaml) ;; (require 'prelude-ocaml)
(require 'prelude-perl) (require 'prelude-perl)
;; (require 'prelude-python) ;; (require 'prelude-python)
;; (require 'prelude-racket)
;; (require 'prelude-ruby) ;; (require 'prelude-ruby)
;; (require 'prelude-rust) ;; (require 'prelude-rust)
;; (require 'prelude-scala) ;; (require 'prelude-scala)