Skip to content

Missing font-locking #474

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
manuel-uberti opened this issue Mar 14, 2018 · 22 comments
Closed

Missing font-locking #474

manuel-uberti opened this issue Mar 14, 2018 · 22 comments

Comments

@manuel-uberti
Copy link
Contributor

manuel-uberti commented Mar 14, 2018

Expected behavior

Clojure own functions/forms correctly highlighted.

Actual behavior

As of now, if, let, loop and recur (for instance) are correctly highlighted, but select-keys, map,
get-in and concat (the first ones I catch) are not.

screenshot

Steps to reproduce the problem

  • open a .clj file with clojure-mode installed
  • write (map inc [1 2 3])

Environment & Version information

clojure-mode version information

clojure-mode (version 5.7.0-snapshot)

Emacs version

GNU Emacs 27.0.50 (build 1, x86_64-debian-linux-gnu, GTK+ Version 3.18.9) of 2018-03-14

Operating system

Ubuntu 16.04

@manuel-uberti
Copy link
Contributor Author

manuel-uberti commented Mar 14, 2018

screenshot

Namespaces in :require have problems as well.

@bbatsov
Copy link
Member

bbatsov commented Mar 14, 2018

This is some regression from #462

@Bost Mind checking what went wrong?

@Olical
Copy link

Olical commented Mar 14, 2018

And namespaced keywords only highlight the second colon, the first is left white.

screenshot_2018-03-14_10-36-45

@Bost
Copy link
Contributor

Bost commented Mar 14, 2018

@Olical the highlighting of namespaced keywords is a regression from #462 indeed. (I'll fix it)

@manuel-uberti @bbatsov font-locking of select-keys map get-in concat hasn't changed since 5.6.1. Anyway it can be easily changed by applying this patch:

index 073e287..0d28c63 100644
--- a/clojure-mode.el
+++ b/clojure-mode.el
@@ -789,6 +789,7 @@ any number of matches of `clojure--sym-forbidden-rest-chars'."))
          "("
          (regexp-opt
           '("def" "do" "if" "let" "let*" "var" "fn" "fn*" "loop" "loop*"
+            "select-keys" "map" "get-in" "concat"
             "recur" "throw" "try" "catch" "finally"
             "set!" "new" "."
             "monitor-enter" "monitor-exit" "quote") t)

@manuel-uberti
Copy link
Contributor Author

I see, but even assoc, assoc-in, contains? are not highlighted now. Should every function/macro/form be added then?

@manuel-uberti
Copy link
Contributor Author

Also, user-defined macros are not highlighted either.

screenshot

@bbatsov
Copy link
Member

bbatsov commented Mar 14, 2018

Those are getting highlighted by CIDER, not clojure-mode. Perhaps @Bost's changes to the font-locking regexps affected CIDER's font-locking.

@bbatsov
Copy link
Member

bbatsov commented Mar 14, 2018

@manuel-uberti @bbatsov font-locking of select-keys map get-in concat hasn't changed since 5.6.1. Anyway it can be easily changed by applying this patch:

@Bost Seems I was unclear. Sorry about this. Have you tried whether the dynamic font-locking in CIDER was affected by your changes?

@manuel-uberti
Copy link
Contributor Author

manuel-uberti commented Mar 14, 2018

Those are getting highlighted by CIDER, not clojure-mode. Perhaps @Bost's changes to the font-locking regexps affected CIDER's font-locking.

FWIW, the screenshot with test-macro comes from a .clj file with CIDER jacked-in.

@manuel-uberti
Copy link
Contributor Author

@Bost is there anything I can do to help fixing this?

@Bost
Copy link
Contributor

Bost commented Mar 17, 2018

@Bost Seems I was unclear. Sorry about this. Have you tried whether the dynamic font-locking in CIDER was affected by your changes?

Uhm, how that works? I mean I copy-pasted the content of clojure-mode/test.clj to cider-scratch and it looks fine (Changes from my latest PR #475 were included).

@Bost
Copy link
Contributor

Bost commented Mar 17, 2018

Unfortunately the spacemacs//find-ert-test-buffer doesn't work for my any more so I let the travis do the testing for me. That' why you see here the PR retries. But now everything looks fine, so please have a look.

@bbatsov
Copy link
Member

bbatsov commented Mar 17, 2018

@Bost
Copy link
Contributor

Bost commented Mar 21, 2018

@bbatsov I can't get the dynamic-syntax-highlighting working... hmm.
I compile my emacs from the source. I tried branches origin/emacs-26, origin/emacs-25, clojure-mode master and also 5.6.1 and I also tried to run .src/emacs --no-init-file and then installed cider and clojure-mode from melpa-stable. And nothing... :neckbeard:

@bbatsov
Copy link
Member

bbatsov commented Mar 21, 2018

Seems to work just fine for me with the old version of clojure-mode. I just start CIDER and it's there. For you there's 0 difference before and after?

@bbatsov
Copy link
Member

bbatsov commented Mar 21, 2018

Btw, I wonder if your color theme makes it harder to spot the differences or something. Also - which CIDER are you using?

@Bost
Copy link
Contributor

Bost commented Mar 21, 2018

I was launching emacs with --no-init-file and using melpa-stable (and then M-x cider-jack-in and M-x cider-scratch) so I was using defaults pretty much everywhere.... but(!) the dynamic-syntax-highlighting doesn't appear until you actually EVALUATE some sexp containing something dynamically highlightable!!! Grrr! :rage4: Ok. Now I can do the actual problem analysis...

@Bost
Copy link
Contributor

Bost commented Mar 21, 2018

... and now I'm confirming this issue is a regression from #462 indeed.

@bbatsov
Copy link
Member

bbatsov commented Mar 26, 2018

@Bost Any progress with solving it? Breaking the dynamic font-locking is much bigger than fixing ns font-locking, so without some solution for this soon I'll have to revert the previous commits.

@Bost
Copy link
Contributor

Bost commented Mar 26, 2018

I think it's better to revert it for the moment. (Although I'll be having some time this week to work on it.)

@Bost
Copy link
Contributor

Bost commented Mar 26, 2018

Huh, I think the dynamic syntax highlighting is fixed now. (It was easier than expected). Please have a look at the PR 475.
@bbatsov Regarding the revert of #462 - since the problem appears to be a simple one and I do have time, please consider postponing the decision until the next week. Thx.

@bbatsov
Copy link
Member

bbatsov commented Mar 27, 2018

Fixed in #475.

@bbatsov bbatsov closed this as completed Mar 27, 2018
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

No branches or pull requests

4 participants