-
-
Notifications
You must be signed in to change notification settings - Fork 247
Make three font-lock faces customizable #466
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,26 @@ | |
"Face used to font-lock Clojure character literals." | ||
:package-version '(clojure-mode . "3.0.0")) | ||
|
||
(defface clojure-interop-method-face | ||
'((t (:inherit font-lock-preprocessor-face))) | ||
"Face used to font-lock interop method names (camelCase)." | ||
:package-version '(clojure-mode . "3.0.0")) | ||
|
||
(defface clojure-global-constant-face | ||
'((t (:inherit font-lock-constant-face))) | ||
"Face used to font-lock the Clojure global constants: nil, true, false." | ||
:package-version '(clojure-mode . "3.0.0")) | ||
|
||
(defface clojure-def-symbol-face | ||
'((t (:inherit font-lock-keyword-face))) | ||
"Face used to font-lock the symbols `def`, `defn`, and all detected variants (be them from clojure.core or not)." | ||
:package-version '(clojure-mode . "3.0.0")) | ||
|
||
(defface clojure-lambda-arg-face | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why they can't be font-locked as variables, as this is what they are. That seems like an odd decision to me. And I don't think we use the variable face for anything but them. |
||
'((t (:inherit font-lock-variable-name-face))) | ||
"Face used to font-lock the function literal args: %, %&, %1 and so on." | ||
:package-version '(clojure-mode . "3.0.0")) | ||
|
||
(defcustom clojure-indent-style :always-align | ||
"Indentation style to use for function forms and macro forms. | ||
There are two cases of interest configured by this variable. | ||
|
@@ -754,7 +774,7 @@ any number of matches of `clojure--sym-forbidden-rest-chars'.")) | |
;; Possibly type or metadata | ||
"\\(?:#?^\\(?:{[^}]*}\\|\\sw+\\)[ \r\n\t]*\\)*" | ||
"\\(\\sw+\\)?") | ||
(1 font-lock-keyword-face) | ||
(1 'clojure-def-symbol-face) | ||
(2 font-lock-variable-name-face nil t)) | ||
;; Type definition | ||
(,(concat "(\\(?:clojure.core/\\)?\\(" | ||
|
@@ -767,7 +787,7 @@ any number of matches of `clojure--sym-forbidden-rest-chars'.")) | |
;; Possibly type or metadata | ||
"\\(?:#?^\\(?:{[^}]*}\\|\\sw+\\)[ \r\n\t]*\\)*" | ||
"\\(\\sw+\\)?") | ||
(1 font-lock-keyword-face) | ||
(1 'clojure-def-symbol-face) | ||
(2 font-lock-type-face nil t)) | ||
;; Function definition (anything that starts with def and is not | ||
;; listed above) | ||
|
@@ -780,7 +800,7 @@ any number of matches of `clojure--sym-forbidden-rest-chars'.")) | |
;; Possibly type or metadata | ||
"\\(?:#?^\\(?:{[^}]*}\\|\\sw+\\)[ \r\n\t]*\\)*" | ||
"\\(\\sw+\\)?") | ||
(1 font-lock-keyword-face) | ||
(1 'clojure-def-symbol-face) | ||
(2 font-lock-function-name-face nil t)) | ||
;; (fn name? args ...) | ||
(,(concat "(\\(?:clojure.core/\\)?\\(fn\\)[ \t]+" | ||
|
@@ -791,7 +811,7 @@ any number of matches of `clojure--sym-forbidden-rest-chars'.")) | |
(1 font-lock-keyword-face) | ||
(2 font-lock-function-name-face nil t)) | ||
;; lambda arguments - %, %&, %1, %2, etc | ||
("\\<%[&1-9]?" (0 font-lock-variable-name-face)) | ||
("\\<%[&1-9]?" (0 'clojure-lambda-arg-face)) | ||
;; Special forms | ||
(,(concat | ||
"(" | ||
|
@@ -848,7 +868,7 @@ any number of matches of `clojure--sym-forbidden-rest-chars'.")) | |
(regexp-opt | ||
'("true" "false" "nil") t) | ||
"\\>") | ||
0 font-lock-constant-face) | ||
0 'clojure-global-constant-face) | ||
;; Character literals - \1, \a, \newline, \u0000 | ||
("\\\\\\([[:punct:]]\\|[a-z0-9]+\\>\\)" 0 'clojure-character-face) | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm don't like this idea. There's nothing special about definitions that warrants a different face for them.