如何指示Emacs自动大写模式自动小写任何后面的单词,例如或者是?

问题描述 投票:0回答:2

Emacs auto-capitalize-mode错误解释单词i.e.e.g.来表示句子的结尾,因此错误地将跟随它们的任何单词大写。

有没有人有一个可以通过输入egie来调用的函数,它会插入字符e.g.i.e.然后自动小写下一个输入的单词?

奖励:做同样的事情......对于省略号。

emacs org-mode capitalization capitalize
2个回答
2
投票

将其添加到.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省略号的缩写魔术。由你决定。


0
投票

来自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 .').

我用它,这是一个舒适的方法。

© www.soinside.com 2019 - 2024. All rights reserved.