











| author | Arash Esbati <arash@gnu.org> | 2026-09-11 22:56:10 +0200 |
|---|---|---|
| committer | Arash Esbati <arash@gnu.org> | 2026-09-11 22:56:10 +0200 |
| commit | f91429c7c54206c1347db3f08feb572942e0a712 (patch) | |
| tree | 921b514a7a732ab2ef73247cfa8bba9545c59c7b | |
| parent | 7a460dcfbfcab9e1dbe862f090df5fb708b84c8e (diff) | |
* latex.el (LaTeX-what-macro): Improve macro recognition.externals/auctex
| -rw-r--r-- | latex.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/latex.el b/latex.el
index 460bf936c0d..c5b0a022a9f 100644
--- a/latex.el
+++ b/latex.el
@@ -7750,7 +7750,17 @@ this point. If nil, limit to the previous 15 lines."
;; (setq env-or-mac-start (point))
(when (and (memql (following-char) ;; '(?\[ ?\{ ?\( ?<)
(LaTeX-completion-macro-delimiters 'open))
- (re-search-backward "\\\\[*+a-zA-Z]+\\=" nil t))
+ ;; Deal with spaces between macro name and argument
+ ;; in `docTeX-mode':
+ (when (derived-mode-p 'docTeX-mode)
+ (skip-chars-backward "[ ]"))
+ (re-search-backward (concat (regexp-quote TeX-esc)
+ "["
+ "-*+a-zA-Z@"
+ (when (derived-mode-p 'docTeX-mode)
+ ":_")
+ "]+\\=")
+ nil t))
(setq cmd (TeX-match-buffer 0))
(when (looking-at "\\\\begin{\\([^}]+\\)}")
(setq cmd (TeX-match-buffer 1))
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。