mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2026-11-22 14:18:58 +01:00
highlight punctuation errors in latex mode
This commit is contained in:
@@ -2,17 +2,33 @@
|
||||
|
||||
(setopt text-mode-ispell-word-completion nil)
|
||||
|
||||
(defface punctuation-error-face
|
||||
'((t (:foreground "Red")))
|
||||
"red"
|
||||
:group 'latex)
|
||||
|
||||
(defun tvd-latex-punctuation()
|
||||
"Highlight german speech punctuation errors. See https://korrektur.de/woertliche-rede-zeichensetzung.
|
||||
|
||||
The following errors are highlighted:
|
||||
- a dot following closing quotes, as: ``done''.
|
||||
- a dot before the closing quote if followed by a comma, as: ``boo.'', sagte er.
|
||||
- an uppercase word following an opening quote after a comma, as: ... said, ``Doch.''"
|
||||
(interactive)
|
||||
(highlight-regexp "''\\." 'punctuation-error-face)
|
||||
(highlight-regexp "\\.''," 'punctuation-error-face)
|
||||
(highlight-regexp ", ``[A-Z]" 'punctuation-error-face))
|
||||
|
||||
(use-package latex
|
||||
:ensure nil
|
||||
|
||||
:mode
|
||||
("\\.tex\\'" . latex-mode)
|
||||
|
||||
:config)
|
||||
("\\.tex\\'" . latex-mode))
|
||||
|
||||
(add-hook 'latex-mode-hook
|
||||
(lambda ()
|
||||
(add-hook 'completion-at-point-functions #'dabbrev-capf 20 t)))
|
||||
(add-hook 'completion-at-point-functions #'dabbrev-capf 20 t)
|
||||
(tvd-latex-punctuation)))
|
||||
|
||||
|
||||
(provide 'init-latex)
|
||||
|
||||
Reference in New Issue
Block a user