emacs setup for both clojure and common lisp with slime-fancy (slime-autodoc)

后端 未结 3 509
一向
一向 2020-12-24 09:39

I set up emacs for both clojure and common lisp, but I want also (slime-setup \'(slime-fancy)) for common lisp. If I add that line to init.el, clojure won\'t work: it gives

3条回答
  •  隐瞒了意图╮
    2020-12-24 10:04

    Here is a solution. (using hooks)
    That is ugly but quite convenient.

    (add-hook 'slime-connected-hook
              (lambda ()
                (if (string= (slime-lisp-implementation-type) "Clojure")
                    (setq slime-use-autodoc-mode nil)
                  (setq slime-use-autodoc-mode t))
                ))
    
    (add-hook 'slime-mode-hook
              (lambda ()
                (if (eq major-mode 'clojure-mode)
                      (slime-autodoc-mode 0)
                    (slime-autodoc-mode 1))))
    

    Update If the problem still exists on the slime-repl buffer, try the following code:

    (add-hook 'slime-repl-mode-hook
              (lambda ()
                (if (string= (slime-lisp-implementation-type) "Clojure")
                    (progn (setq slime-use-autodoc-mode nil)
                           (slime-autodoc-mode 0))
                  (progn (setq slime-use-autodoc-mode t)
                         (slime-autodoc-mode 1)))))
    

提交回复
热议问题