Skip to content
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

Highlight methods in some forms #21

Merged
merged 1 commit into from
Sep 15, 2023
Merged

Conversation

rrudakov
Copy link
Contributor

Resolve #20.

  • Methods for deftype, definterface, defrecord, reify and defprotocol are highlighted with font-lock-function-name-face.

I've also changed some existing queries (I can revert it if those are undesirable):

  • I think clojure-ts--definition-symbol-regexp is quite greedy. It highlights everything following a symbol prefixed with def with font-lock-function-name-face. As a result deftype, defprotocol etc were highlighted as functions, now types are highlighted with font-lock-type-face to be consistent with clojure-mode.
  • Namespace name is highlighted with font-lock-type-face to be consistent with clojure-mode.

Images:

  • Before:
image
  • After:
image
  • clojure-mode
image

Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):

  • The commits are consistent with our contribution guidelines.
  • You've added tests (if possible) to cover your change(s). Bugfix, indentation, and font-lock tests are extremely important! (there are no tests, but I've updated test clojure source).
  • You've run M-x checkdoc and fixed any warnings in the code you've written.
  • You've updated the changelog (if adding/changing user-visible functionality).
  • You've updated the readme (if adding/changing user-visible functionality).

Thanks!

@dannyfreeman
Copy link
Contributor

Going to have a look at this soon, thank you

@dannyfreeman
Copy link
Contributor

This seems good. I was unaware you could use things like :match deeper inside of queries closer to the thing being matched.

I am going to pull it next time I am free at the computer to actually test it out. Once that checks out I will merge. Thanks again for helping out.

At some point later I'm going to go through all the regular expression for matching different things and organize them into nicer lists that the user can extend to address #15

@dannyfreeman dannyfreeman merged commit b96d85d into clojure-emacs:main Sep 15, 2023
@rrudakov
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better font-locking in method definitions
2 participants