简体   繁体   中英

How can I evaluate something in Emacs init.el file?

Every time I open .clj file, I have to run

M-x cider-jack-in

to enable Clojure auto-completion in code file.

Can I make Emacs automatically run the command when it starts?

Try this:

(require 'cider)
(defun maybe-cider-jack-in ()
  (unless (ignore-errors
            (nrepl-current-connection-buffer))
    (cider-jack-in)))

(add-hook 'clojure-mode-hook 'maybe-cider-jack-in) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM