我的GNU Emacs 24.3.1的安装“有帮助”将单词“lambda”(在python-mode中)和“fn”(在clojure-mode中)转换为希腊符号λ。我确信这让一些人高兴,但我不是其中之一。 :)
那里的任何Emacs黑客都知道如何关闭这个不需要的功能吗?
我在init.el
尝试了以下内容,但无济于事:
(defconst keywords-to-remove (lambda fn))
(font-lock-remove-keywords 'clojure-mode keywords-to-remove)
(font-lock-remove-keywords 'lisp-mode keywords-to-remove)
(font-lock-remove-keywords 'python-mode keywords-to-remove)
以下是我init.el
的当前内容:
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(defvar my-packages '(starter-kit
starter-kit-lisp
starter-kit-bindings
auto-complete
slime
ac-slime
rainbow-delimiters
clojure-mode
nrepl))
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
(global-set-key (kbd "<C-tab>") 'next-multiframe-window)
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)
(setq ac-delay 0.2) ;; eclipse uses 500ms
(add-to-list 'load-path "~/.emacs.d/ac-slime")
(require 'ac-slime)
(add-hook 'slime-mode-hook 'set-up-slime-ac)
(add-hook 'slime-repl-mode-hook 'set-up-slime-ac)
(setq default-truncate-lines t)
(defun indent-buffer ()
"Indents an entire buffer using the default intenting scheme."
(interactive)
(save-excursion
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max))))
(require 'rainbow-delimiters)
(global-rainbow-delimiters-mode)
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
(color-theme-ld-dark)))
(add-to-list 'auto-mode-alist '("\\.cljs\\'" . clojure-mode))
;; Allow input to be sent to somewhere other than inferior-lisp
;;
;; This is a total hack: we're hardcoding the name of the shell buffer
(defun shell-send-input (input)
"Send INPUT into the *shell* buffer and leave it visible."
(save-selected-window
(switch-to-buffer-other-window "*shell*")
(goto-char (point-max))
(insert input)
(comint-send-input)))
(defun defun-at-point ()
"Return the text of the defun at point."
(apply #'buffer-substring-no-properties
(region-for-defun-at-point)))
(defun region-for-defun-at-point ()
"Return the start and end position of defun at point."
(save-excursion
(save-match-data
(end-of-defun)
(let ((end (point)))
(beginning-of-defun)
(list (point) end)))))
(defun expression-preceding-point ()
"Return the expression preceding point as a string."
(buffer-substring-no-properties
(save-excursion (backward-sexp) (point))
(point)))
(defun shell-eval-last-expression ()
"Send the expression preceding point to the *shell* buffer."
(interactive)
(shell-send-input (expression-preceding-point)))
(defun shell-eval-defun ()
"Send the current toplevel expression to the *shell* buffer."
(interactive)
(shell-send-input (defun-at-point)))
(add-hook 'clojure-mode-hook
(lambda ()
(define-key clojure-mode-map (kbd "C-c e") 'shell-eval-last-expression)
(define-key clojure-mode-map (kbd "C-c x") 'shell-eval-defun)))
答案 0 :(得分:3)
Emacs-24.4有一个新的全局次要模式prettify-symbols-mode
,旨在控制这一点。我建议您联系主要模式的维护人员,并要求他们在定义时尝试遵守这种次要模式。
答案 1 :(得分:3)
如果您使用starter-kit,那么您还可以使用以下命令关闭esk-pretty-lambdas功能:
(remove-hook 'prog-mode-hook 'esk-pretty-lambdas)
在你的dot emacs或init文件中。