Arash Esbati <[email protected]> writes:
> I think we can also adjust `LaTeX-verbatim-p' to handle the FIXME.
> AUCTeX doesn't parse files for \MakeShortVerb, it looks at the chars
> defined in `LaTeX-shortvrb-chars' for delimiters. We could do something
> like this in `LaTeX-verbatim-p' (addition starts with (when
> LaTeX-shortvrb-chars ...):
Sorry, there was a thinko in my last message, next try:
--8<---------------cut here---------------start------------->8---
(defun LaTeX-verbatim-p (&optional pos)
"Return non-nil if position POS is in a verbatim-like construct."
(when pos (goto-char pos))
(save-match-data
(or (when (fboundp 'font-latex-faces-present-p)
(font-latex-faces-present-p 'font-latex-verbatim-face))
(member (LaTeX-current-verbatim-macro)
(LaTeX-verbatim-macros-with-delims))
(member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces))
(member (LaTeX-current-environment) (LaTeX-verbatim-environments))
(when LaTeX-shortvrb-chars
(let* ((strings (mapcar #'string LaTeX-shortvrb-chars))
(regexp (mapconcat #'regexp-quote strings "\\|"))
(p (point))
(match (save-excursion
(re-search-forward regexp (line-end-position) t))))
(and match
(save-excursion
(cl-oddp (how-many regexp (line-beginning-position) p)))
(save-excursion
(cl-evenp (how-many regexp (line-beginning-position)
match)))))))))
--8<---------------cut here---------------end--------------->8---
Best, Arash
_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex