[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#56160: 13.1.3; fill breaks verbatim macros not followed with spaces
From: |
Arash Esbati |
Subject: |
bug#56160: 13.1.3; fill breaks verbatim macros not followed with spaces |
Date: |
Thu, 30 Jun 2022 17:41:21 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 |
Arash Esbati <arash@gnu.org> 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