1
- ; ;; clojure-mode.el --- Major mode for Clojure code
1
+ ; ;; clojure-mode.el --- Major mode for Clojure code -*- lexical-binding : t ; -*-
2
2
3
3
; ; Copyright © 2007-2014 Jeffrey Chu, Lennart Staflin, Phil Hagelberg
4
4
; ; Copyright © 2013-2014 Bozhidar Batsov
10
10
; ; URL: http://github.com/clojure-emacs/clojure-mode
11
11
; ; Version: 3.0.0-cvs
12
12
; ; Keywords: languages clojure clojurescript lisp
13
+ ; ; Package-Requires: ((emacs "24.1"))
13
14
14
15
; ; This file is not part of GNU Emacs.
15
16
@@ -216,10 +217,6 @@ describing the last `clojure-load-file' or `clojure-compile-file' command.")
216
217
(interactive )
217
218
(message " clojure-mode (version %s ) " clojure-mode-version))
218
219
219
- ; ; For compatibility with Emacs < 24, derive conditionally
220
- (defalias 'clojure-parent-mode
221
- (if (fboundp 'prog-mode ) 'prog-mode 'fundamental-mode ))
222
-
223
220
(defun clojure-space-for-delimiter-p (endp delim )
224
221
" Prevent paredit from inserting useless spaces.
225
222
See `paredit-space-for-delimiter-predicates' for the meaning of
@@ -274,7 +271,7 @@ ENDP and DELIMITER."
274
271
'clojure-no-space-after-tag )))
275
272
276
273
;;;### autoload
277
- (define-derived-mode clojure-mode clojure-parent -mode " Clojure"
274
+ (define-derived-mode clojure-mode prog -mode " Clojure"
278
275
" Major mode for editing Clojure code.
279
276
280
277
\\ {clojure-mode-map}"
@@ -290,8 +287,6 @@ ENDP and DELIMITER."
290
287
" \\ (\\ (^\\ |[^\\\\ \n ]\\ )\\ (\\\\\\\\\\ )*\\ )\\ (;+\\ |#|\\ ) *" )
291
288
(setq-local indent-line-function 'clojure-indent-line )
292
289
(setq-local lisp-indent-function 'clojure-indent-function )
293
- (when (< emacs-major-version 24 )
294
- (setq-local forward-sexp-function 'clojure-forward-sexp ))
295
290
(setq-local lisp-doc-string-elt-property 'clojure-doc-string-elt )
296
291
(setq-local inferior-lisp-program clojure-inf-lisp-command)
297
292
(setq-local parse-sexp-ignore-comments t )
@@ -613,27 +608,6 @@ point) to check."
613
608
614
609
615
610
616
- (defun clojure-forward-sexp (n )
617
- " Move forward across one balanced Clojure expression (sexp).
618
-
619
- It treats record literals like #user.Foo[1] and #user.Foo{:size 1}
620
- as a single sexp so that CIDER will send them properly.
621
-
622
- This behavior may not be intuitive when the user presses C-M-f, but
623
- since these are single objects this behavior is okay."
624
- (let ((dir (if (> n 0 ) 1 -1 ))
625
- (forward-sexp-function nil )) ; force the built-in version
626
- (while (not (zerop n))
627
- (forward-sexp dir)
628
- (when (save-excursion ; move back to see if we're in a record literal
629
- (and
630
- (condition-case nil
631
- (progn (backward-sexp ) 't )
632
- ('scan-error nil ))
633
- (looking-at " #\\ w" )))
634
- (forward-sexp dir)) ; if so, jump over it
635
- (setq n (- n dir)))))
636
-
637
611
(defun clojure-indent-line ()
638
612
" Indent current line as Clojure code."
639
613
(if (clojure-in-docstring-p)
0 commit comments