开发者

Why is clojure-mode replacing fn with some curly f character?

I've just started using emacs starter kit & clojure-mode. Now, when I type or paste '(fn' into a buffer in clojure mode, the 'fn' characters get replaced in the window with a slightly curly lower case f. The buffer is saved correctly, but it's extremely annoying, especially as I discovered the feature the hard way - puzzling over someone's 'impossible' code snippet and editing it 开发者_C百科down to a one-liner before light dawned. Any idea why it does this, or more importantly, how to switch it off?


It can be turned off by adding the following line to your init.el after loading starter-kit-lisp.

(remove-hook 'clojure-mode-hook 'esk-pretty-fn)

Then re-load Emacs for it to take effect.


Sorry to answer my own question. It's in starter-kit-lisp.el. Look for the line starting (eval-after-load 'clojure-mode.


In emacs live you can disable this behaviour with the following:

In ~/.emacs.d/packs/live/clojure-pack/config/clojure-conf.el comment these lines:

;;(eval-after-load 'clojure-mode
;;  '(font-lock-add-keywords
;;    'clojure-mode `(("(\\(fn\\)[\[[:space:]]"
;;                     (0 (progn (compose-region (match-beginning 1)
;;                                               (match-end 1) "λ")
;;                               nil))))))
;;
;;(eval-after-load 'clojure-mode
;;  '(font-lock-add-keywords
;;    'clojure-mode `(("\\(#\\)("
;;                     (0 (progn (compose-region (match-beginning 1)
;;                                               (match-end 1) "ƒ")
;;                               nil))))))
;;
;;(eval-after-load 'clojure-mode
;;  '(font-lock-add-keywords
;;    'clojure-mode `(("\\(#\\){"
;;                     (0 (progn (compose-region (match-beginning 1)
;;                                               (match-end 1) "∈")
;;                               nil))))))

Restart emacs and there are no more fancy symbols.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜