This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-03
Channels
so cider seems to be locking up my emacs completely every now and then. I'm having a hard time figuring out what exactly causes it. It might be when I'm printing a lot of lines. I have to restart Emacs completely and am not sure how to gather more information to seek help from you folks on the matter. any advice?
I may have found one suggestion to use for debugging: "`M-x toggle-debug-on-quit` then hit C-g
if it hangs and it will print a backtrace. Sound good?
long lines are the bane of emacs. It should try to limit printing extremely long lines automatically. If you do find yourself with some big output you can check the ,
(comma) menu at the repl prompt and there is an option to clear the repl output and it should speed back up
I found these problems mostly disappeared when I set the CIDER pretty print variable to true (sorry can’t remember exact name - you should be able to find it in the CIDER custom group)
Now that you mention that I was hoping somebody could look at my cider config portion of my init.el and see if I'm doing something really dumb in there. I think I copy and pasted it when first trying to roll my own config.
(use-package clojure-mode
:mode (("\\.clj\\'" . clojure-mode)
("\\.cljs\\'" . clojure-mode)
("\\.cljc\\'" . clojure-mode)
("\\.edn\\'" . clojure-mode))
:config
(add-hook 'clojure-mode-hook #'paredit-mode)
(setq clojure-verify-major-mode nil))
(use-package cider
:init
(add-hook 'cider-mode-hook #'clj-refactor-mode)
:diminish subword-mode
:config
(add-hook 'cider-repl-mode-hook #'paredit-mode)
(setq nrepl-log-messages t
cider-repl-use-clojure-font-lock t
cider-font-lock-dynamically '(macro core function var)
nrepl-hide-special-buffers t
cider-repl-scroll-on-output nil
cider-overlays-use-font-lock t
cider-invert-insert-eval-p t
cider-switch-to-repl-after-insert-p nil)
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
(cider-repl-toggle-pretty-printing))
(use-package cider-eval-sexp-fu)
(use-package clj-refactor
:diminish clj-refactor-mode
:config (cljr-add-keybindings-with-prefix "C-c C-m"))
(use-package clojure-mode-extra-font-locking)
(use-package flycheck-joker)
you are putting cljc and cljs files into clojure-mode rather than clojurec-mode
and clojurescript-mode
it seems
i would turn off the nrepl message logging. unless you are investigating bugs it is just output you don't need
also i did you insert and repl functions. I made those changes so its nice to see people using them 🙂
I'll turn off that logging. what about the font-lock-dynamically and pretty printing stuff? I saw mentions of those in some of the cider locking issues on github so maybe should take that off or it's in there to help?
you ca nremember those if you find yourself slowing down. this is usually felt in a larger text buffer when adding characters can take a bit longer
(progn
(add-to-list 'auto-mode-alist
'("\\.\\(clj\\|dtm\\|edn\\)\\'" . clojure-mode))
(add-to-list 'auto-mode-alist '("\\.cljc\\'" . clojurec-mode))
(add-to-list 'auto-mode-alist '("\\.cljs\\'" . clojurescript-mode))
;; boot build scripts are Clojure source files
(add-to-list 'auto-mode-alist '("\\(?:build\\|profile\\)\\.boot\\'" . clojure-mode)))
and what about these packages:
(use-package cider-eval-sexp-fu)
(use-package clj-refactor
:diminish clj-refactor-mode
:config (cljr-add-keybindings-with-prefix "C-c C-m"))
(use-package clojure-mode-extra-font-locking)
thanks for your help, I've been wanting to clean this up and keep it as minimal as possible.
new and improved:
(use-package clojure-mode
:config
(add-hook 'clojure-mode-hook #'paredit-mode)
(setq clojure-verify-major-mode nil))
(use-package cider
:config
(add-hook 'cider-repl-mode-hook #'paredit-mode)
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return))
(use-package flycheck-joker)