mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-22 07:09:47 +00:00
org-lint: Add checker for $...$ LaTeX fragments
* lisp/org-lint.el (org-lint-LaTeX-$): New checker warning about semi-obsolete $...$ LaTeX fragment syntax. Link: https://orgmode.org/list/86ileukojk.fsf@lan
This commit is contained in:
parent
ab85c1b958
commit
cfe5e01e14
@ -1251,6 +1251,14 @@ Use \"export %s\" instead"
|
||||
(format "Bullet counter \"%s\" is not the same with item position %d. Consider adding manual [@%d] counter."
|
||||
bullet (car (last true-number)) bullet-number))))))))
|
||||
|
||||
(defun org-lint-LaTeX-$ (ast)
|
||||
"Report semi-obsolete $...$ LaTeX fragments."
|
||||
(org-element-map ast 'latex-fragment
|
||||
(lambda (fragment)
|
||||
(and (string-match-p "^[$][^$]" (org-element-property :value fragment))
|
||||
(list (org-element-property :begin fragment)
|
||||
"Potentially confusing LaTeX fragment format. Prefer using more reliable \\(...\\)")))))
|
||||
|
||||
|
||||
;;; Checkers declaration
|
||||
|
||||
@ -1479,6 +1487,11 @@ Use \"export %s\" instead"
|
||||
#'org-lint-item-number
|
||||
:categories '(plain-list))
|
||||
|
||||
(org-lint-add-checker 'LaTeX-$
|
||||
"Report potentially confusing $...$ LaTeX markup."
|
||||
#'org-lint-LaTeX-$
|
||||
:categories '(markup))
|
||||
|
||||
(provide 'org-lint)
|
||||
|
||||
;; Local variables:
|
||||
|
Loading…
Reference in New Issue
Block a user