mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2026-11-23 06:38:57 +01:00
highlight punctuation errors in latex mode
This commit is contained in:
@@ -2,17 +2,33 @@
|
|||||||
|
|
||||||
(setopt text-mode-ispell-word-completion nil)
|
(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
|
(use-package latex
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
|
||||||
:mode
|
:mode
|
||||||
("\\.tex\\'" . latex-mode)
|
("\\.tex\\'" . latex-mode))
|
||||||
|
|
||||||
:config)
|
|
||||||
|
|
||||||
(add-hook 'latex-mode-hook
|
(add-hook 'latex-mode-hook
|
||||||
(lambda ()
|
(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)
|
(provide 'init-latex)
|
||||||
|
|||||||
Reference in New Issue
Block a user