惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
小众软件
小众软件
博客园 - 叶小钗
宝玉的分享
宝玉的分享
博客园_首页
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
U
Unit 42
F
Fortinet All Blogs
IT之家
IT之家
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
酷 壳 – CoolShell
酷 壳 – CoolShell

elpa/gnu.git, branch externals/auctex

Release GNU AUCTeX 14.2.0 - elpa/gnu.git * latex.el (LaTeX-what-macro): Fix chars to skip backwards. - elpa/gnu.git * tex-ispell.el: Consolidate regexp for tabular environments. - elpa/gnu.git ; * latex.el (LaTeX-what-macro): Fix last change. - elpa/gnu.git * latex.el (LaTeX-what-macro): Improve macro recognition. - elpa/gnu.git Preserve `crm--choose-completion-string' - elpa/gnu.git - GNU ELPA Accept '-' as macro modifier - elpa/gnu.git Add new styles - elpa/gnu.git ; * tex-info.el (outline-heading-alist): Silence the compiler. - elpa/gnu.git Update style/simpleicons.el to package v16.29.0 - elpa/gnu.git Update NEWS.org for new preview feature - elpa/gnu.git Robustify check for escaped math switches/togglers - elpa/gnu.git Fix custom prompt with a default-value - elpa/gnu.git Fix prompt with a default-value - elpa/gnu.git Make `TeX-listify' an obsolete alias - elpa/gnu.git Fix 'syntax-propertize because of narrowing!' error - elpa/gnu.git Update style/ltx-talk.el to class v0.6.0 - elpa/gnu.git elpa/gnu.git - GNU ELPA elpa/gnu.git - GNU ELPA elpa/gnu.git - GNU ELPA elpa/gnu.git - GNU ELPA elpa/gnu.git - GNU ELPA ; Fix last change - elpa/gnu.git Add in-buffer completion for citation keys - elpa/gnu.git ; Adjust Copyright years - elpa/gnu.git Improve query of the optional float placement - elpa/gnu.git Sort predefined environment hooks - elpa/gnu.git Sort predefined hooks - elpa/gnu.git Allow additional properties for in-buffer completion - elpa/gnu.git Use ConTeXt Mark XL instead of LMTX - elpa/gnu.git
Return context for RefTeX also for macros - elpa/gnu.git
Arash Esbati · 2026-08-14 · via elpa/gnu.git, branch externals/auctex
authorArash Esbati <arash@gnu.org>2026-08-14 15:48:43 +0200
committerArash Esbati <arash@gnu.org>2026-08-14 15:48:43 +0200
commit3ad2a0a8e7349641685cdd0e81c3d11d56eedf65 (patch)
treedd84f15d7a9b06ab0b84ddb2106e49de98f436e3
parent5c3af8120cbd8612a3eebcb8422eb6fbe6967615 (diff)

* latex.el (LaTeX-keyval-caption-reftex-context-function): Deal also with LaTeX macros and not only with environments. Use `search-backward' since the search string is fixed.

-rw-r--r--latex.el26

1 files changed, 16 insertions, 10 deletions

diff --git a/latex.el b/latex.el
index 0c652ad3457..460bf936c0d 100644
--- a/latex.el
+++ b/latex.el

@@ -9653,18 +9653,24 @@ wrapped in \\(?:...\\)? then."

;; We are done. Just search until the next closing bracket

"[^]]*\\]"))

-(defun LaTeX-keyval-caption-reftex-context-function (env)

- "Extract and return a key=val caption context string for RefTeX in ENV.

-ENV is the name of current environment passed to this function by

-RefTeX. The context string is the value given to the caption key. If

-no caption key is found, an error is issued. See also the docstring of

-`reftex-label-alist' and its description for CONTEXT-METHOD."

- (let* ((envstart (save-excursion

- (re-search-backward (concat "\\\\begin{" env "}")

- nil t)))

+(defun LaTeX-keyval-caption-reftex-context-function (env-or-mac)

+ "Return a key=val caption context string for RefTeX in ENV-OR-MAC.

+ENV-OR-MAC is the name of current environment or macro passed to this

+function by RefTeX. The context string is the value given to the

+caption key. If no caption key is found, an error is issued. See also

+the docstring of `reftex-label-alist' and its description for

+CONTEXT-METHOD."

+ (let* ((start (save-excursion

+ (search-backward

+ ;; ENV-OR-MAC is a macro if it starts with `TeX-esc':

+ (if (string-match-p (concat "\\`" (regexp-quote TeX-esc))

+ env-or-mac)

+ env-or-mac

+ (concat "\\begin{" env-or-mac "}"))

+ nil t)))

(capt-key (save-excursion

(re-search-backward "\\<caption[ \t\n\r%]*=[ \t\n\r%]*"

- envstart t)))

+ start t)))

capt-start capt-end)

(if capt-key

(save-excursion