Emacs auto-capitalize-mode错误解释单词i.e.
和e.g.
来表示句子的结尾,因此错误地将跟随它们的任何单词大写。
有没有人有一个可以通过输入eg
或ie
来调用的函数,它会插入字符e.g.
和i.e.
然后自动小写下一个输入的单词?
奖励:做同样的事情......对于省略号。
将其添加到.emacs:
(setq auto-capitalize-predicate
(lambda () (not (looking-back
"\\([Ee]\\.g\\|[Ii]\\.e\\)\\.[^.]*" (- (point) 20)))))
请记住,如果你的auto-capitalize-words变量设置为包含“I”,则ie in ie将被大写为I.e。
(setq auto-capitalize-words '())
这使它成为一无所获。
这是一个也处理省略号的版本:
(setq auto-capitalize-predicate
(lambda () (not (looking-back
"\\([Ee]\\.g\\|[Ii]\\.e\\|\\.\\.\\)\\.[^.]*" (- (point) 20)))))
但是你可能想要研究一些将三个句点变为unicode省略号的缩写魔术。由你决定。
来自auto-capitalize.el:
;; To prevent a word in the `auto-capitalize-words' list from being
;; capitalized or upcased in a particular context (e.g.
;; "GNU.emacs.sources"), insert the following whitespace or
;; punctuation character with `M-x quoted-insert' (e.g. `gnu C-q .').
我用它,这是一个舒适的方法。