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

some-> & some->> not fontlocked #622

Closed
boxxxie opened this issue Jul 13, 2022 · 10 comments
Closed

some-> & some->> not fontlocked #622

boxxxie opened this issue Jul 13, 2022 · 10 comments

Comments

@boxxxie
Copy link
Contributor

boxxxie commented Jul 13, 2022

clojure-mode version

clojure-mode (version 5.14.0)

my work around

(defvar clojure-core-macros
  `((,(concat
       "(\\(?:clojure.core/\\)?"
       (regexp-opt
        '(
          "some->"
          "some->>"
          ) t)
       "\\>")
     1 font-lock-keyword-face)))
@bbatsov
Copy link
Member

bbatsov commented Jul 13, 2022

Such font-locking lives in a separate package these days https://github.com/clojure-emacs/clojure-mode#font-locking as the expectation is that most people are using CIDER which has better dynamic font-locking.

@bbatsov bbatsov closed this as completed Jul 13, 2022
@vemv
Copy link
Member

vemv commented Jul 13, 2022

It sounds worthwhile and cheap to support clojure.core macros though. Would be friendly to clojure-lsp users, for instance, I reckon.

wdyt?

@bbatsov
Copy link
Member

bbatsov commented Jul 13, 2022

@vemv Yeah, probably those we can add back to the main package. I was wondering what to do with the extra package as I guess most people don't realize that it exists.

@bbatsov
Copy link
Member

bbatsov commented Jul 13, 2022

Looking at the code we've definitely messed up something as some macros are in the main package and some in the secondary.

@bbatsov bbatsov reopened this Jul 13, 2022
@bbatsov
Copy link
Member

bbatsov commented Jul 13, 2022

I guess we'll need to check how many of the things that are listed as clojure.core built-ins in the extra package are actually macros and move them to clojure-mode. I'll reopen this ticket.

@boxxxie
Copy link
Contributor Author

boxxxie commented Jul 13, 2022

point me to where i should look in the .el file, and i can compile a list of the missing macros from clojure.core

@bbatsov
Copy link
Member

bbatsov commented Jul 13, 2022

@boxxxie
Copy link
Contributor Author

boxxxie commented Jul 13, 2022

#{
 gen-class
  while
  import
  pvalues
  bound-fn
  vswap!
  with-loading-context
  delay
  gen-interface
  with-bindings
  deftype
  with-precision
  lazy-seq
  let
  defstruct
  areduce
  definline
  future
  fn
  definterface
  some->>
  amap
  extend-type
  defmethod
  time
  memfn
  extend-protocol
  reify
  defonce
  defn-
  defprotocol
  sync
  assert
  proxy-super
  loop
  with-out-str
  with-in-str
  some->
  proxy
  locking
  defmulti
  io!
  lazy-cat
  comment
  defrecord
  refer-clojure
}

that is the difference of all the clojure.core (including loads from other files) non private macros and the list that you pointed me to
here is the union in the same format as in the .el file

'("when-first" "cond->>" "gen-class" "while" "doall" "import" "pvalues" "bound-fn" "vswap!" "dosync"
 "with-loading-context" ".." "delay" "gen-interface" "with-bindings" "dorun" "if-not" "doseq" "deftype" "when-let"
 "if-some" "with-precision" "lazy-seq" "let" "->" "defstruct" "doto" "areduce" "definline" "future" "fn" "definterface"
 "as->" "when-not" "when" "some->>" "in-ns" "ns" "amap" "declare" "or" "extend-type" "defmethod" "time" "memfn"
 "extend-protocol" "cond->" "dotimes" "reify" "with-open" "defonce" "defn-" "defprotocol" "sync" "assert" "letfn"
 "proxy-super" "loop" "with-out-str" "condp" "cond" "with-in-str" "some->" "for" "binding" "with-local-vars" "proxy"
 "with-redefs" "locking" "defmulti" "if-let" "case" "io!" "lazy-cat" "comment" "defrecord" "with-redefs-fn" "and"
 "when-some" "->>" "refer-clojure" )

@boxxxie
Copy link
Contributor Author

boxxxie commented Jul 13, 2022

macros i left out are from pprint_base.clj cl_format.clj template.clj core_proxy.clj tap.clj test.clj shell.clj junit.clj repl.clj genclass.clj main.clj

@vemv
Copy link
Member

vemv commented Jul 19, 2022

Released as clojure-mode 5.15.0, which will be available within a couple hours

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

No branches or pull requests

3 participants