-
-
Notifications
You must be signed in to change notification settings - Fork 247
Fixed font-locking for def* with support of special chars #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -7,6 +7,10 @@ | |||
* [#302](https://github.com/clojure-emacs/clojure-mode/pull/302): Add new sexp navigation commands. `clojure-forward-logical-sexp` and `clojure-backward-logical-sexp` consider `^hints` and `#reader.macros` to be part of the sexp that follows them. | |||
* [#303](https://github.com/clojure-emacs/clojure-mode/issues/303): Handle `boot` projects in `clojure-expected-ns`. | |||
|
|||
### Bugs fixed | |||
|
|||
* Fix font-locking for def with special chars such: `defn*`, `defspecial!` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
such as
This sentence should end with with a .
.
The commit message should say "Handle properly def* symbols, containing special chars" or something like it. We don't use past tense for commit message titles. |
@@ -380,7 +380,7 @@ Called by `imenu--generic-function'." | |||
(2 font-lock-type-face nil t)) | |||
;; Function definition (anything that starts with def and is not | |||
;; listed above) | |||
(,(concat "(\\(?:[a-z\.-]+/\\)?\\(def\[a-z\-\]*-?\\)" | |||
(,(concat "(\\(?:[a-z\.-]+/\\)?\\(def[^ \r\n\t]*\\)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the same as using [:space:]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really... I'm using ^
for exclusion.
So I'm saying take anything that starts with a def
and it is followed by anything which is NOT a blank 0 or more times. So to be fair should be something like [^[:space:]]
.
Since different regex engines use different character classes ([:space:]
, [:blank:]
, [:s:]
, \s
) I wasn't sure about the correct one for elisp and I took reference from line 387 and 389 (just below) where the expanded form it is used.
Fixed font-locking for def* with support of special chars
👍 Thanks! |
changed the regex to match "def" + anything until the first space " " (or blank),
this support font locking for things like
defabc*
,defyyy!
, etc.