Skip to content

Commit 391a7bd

Browse files
yuhan0bbatsov
authored andcommitted
Allow ' quote in tail portion of symbols/keywords
Unlike other lisps, symbols like x' are syntatically valid in Clojure
1 parent b35e410 commit 391a7bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clojure-mode.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ Out-of-the box `clojure-mode' understands lein, boot, gradle,
333333
(modify-syntax-entry ?@ "'" table)
334334
(modify-syntax-entry ?? "_ p" table) ; ? is a prefix outside symbols
335335
(modify-syntax-entry ?# "_ p" table) ; # is allowed inside keywords (#399)
336+
(modify-syntax-entry ?' "_ p" table) ; ' is allowed anywhere but the start of symbols
336337

337338
;; Others
338339
(modify-syntax-entry ?\; "<" table) ; comment start
@@ -772,10 +773,10 @@ Called by `imenu--generic-function'."
772773
(goto-char start)))))
773774

774775
(eval-and-compile
775-
(defconst clojure--sym-forbidden-rest-chars "][\";\'@\\^`~\(\)\{\}\\,\s\t\n\r"
776+
(defconst clojure--sym-forbidden-rest-chars "][\";@\\^`~\(\)\{\}\\,\s\t\n\r"
776777
"A list of chars that a Clojure symbol cannot contain.
777778
See definition of 'macros': URL `http://git.io/vRGLD'.")
778-
(defconst clojure--sym-forbidden-1st-chars (concat clojure--sym-forbidden-rest-chars "0-9:")
779+
(defconst clojure--sym-forbidden-1st-chars (concat clojure--sym-forbidden-rest-chars "0-9:'")
779780
"A list of chars that a Clojure symbol cannot start with.
780781
See the for-loop: URL `http://git.io/vRGTj' lines: URL
781782
`http://git.io/vRGIh', URL `http://git.io/vRGLE' and value

0 commit comments

Comments
 (0)