<commit_before>;;; lang/clojure/config.el -*- lexical-binding: t; -*-

;; `clojure-mode'
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)


(def-package! clj-refactor
  :after clojure-mode)

(def-package! cider
  ;; NOTE: if you don't have an org directory set (the dir doesn't exist), cider
  ;; jack in won't work.
  :commands (cider-jack-in cider-jack-in-clojurescript)
  :hook (clojure-mode . cider-mode)
  :config
  (setq nrepl-hide-special-buffers t
        cider-stacktrace-default-filters '(tooling dup)
        cider-prompt-save-file-on-load nil
        cider-repl-use-clojure-font-lock t)
  (set-popup-rule! "^\\*cider-repl" :quit nil :select nil)
  (set-repl-handler! 'clojure-mode #'+clojure/repl)
  (set-eval-handler! 'clojure-mode #'cider-eval-region)
  (set-lookup-handlers! 'clojure-mode
    :definition #'cider-browse-ns-find-at-point
    :documentation #'cider-browse-ns-doc-at-point)

  (map! :map cider-mode-map
        :localleader
        :n  "'"  #'cider-jack-in
        :n  "\"" #'cider-jack-in-clojurescript
        :n  "B"  #'cider-switch-to-repl-buffer
        :n  "b"  #'cider-eval-buffer
        :n  "n"  #'cider-repl-set-ns
        :n  "j"  #'cider-find-var
        :n  "d"  #'cider-doc
        :n  "c"  #'cider-repl-clear-buffer
        :n  "p"  #'cider-eval-sexp-at-point
        :n  "r"  #'cider-eval-region))<commit_msg>Refactor lang/clojure & fix clojure handlers<commit_after>;;; lang/clojure/config.el -*- lexical-binding: t; -*-

;; `clojure-mode'
(after! clojure-mode
  (add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)

  (def-package! cider
    ;; NOTE: if you don't have an org directory set (the dir doesn't exist),
    ;; cider jack in won't work.
    :commands (cider-jack-in cider-jack-in-clojurescript)
    :hook (clojure-mode . cider-mode)
    :init
    (set-popup-rule! "^\\*cider-repl" :quit nil :select nil)
    (set-repl-handler! 'clojure-mode #'+clojure/repl)
    (set-eval-handler! 'clojure-mode #'cider-eval-region)
    (set-lookup-handlers! 'clojure-mode
      :definition #'cider-browse-ns-find-at-point
      :documentation #'cider-browse-ns-doc-at-point)
    :config
    (setq nrepl-hide-special-buffers t
          cider-stacktrace-default-filters '(tooling dup)
          cider-prompt-save-file-on-load nil
          cider-repl-use-clojure-font-lock t)
    (map! :map cider-mode-map
          :localleader
          :n  "'"  #'cider-jack-in
          :n  "\"" #'cider-jack-in-clojurescript
          :n  "B"  #'cider-switch-to-repl-buffer
          :n  "n"  #'cider-repl-set-ns
          :n  "j"  #'cider-find-var
          :n  "h"  #'cider-doc
          :n  "c"  #'cider-repl-clear-buffer
          :n  "p"  #'cider-eval-sexp-at-point)))


(def-package! clj-refactor
  :after clojure-mode)
{'fraction_non_alphanumeric': 0.16895803183791605, 'fraction_numerical': 0.0, 'mean_word_length': 2.5267857142857144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3285334', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1114, 'n_words': 198}