* lisp/textmodes/reftex.el (reftex-compile-variables): Consider %
when building the regexp for searching only in .dtx files.
(AUCTeX bug#59638)
reftex-section-levels))
;; Calculate the regular expressions
- (let* (
-; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
- (wbol "\\(^\\)%?[ \t]*") ; Need to keep the empty group because
- ; match numbers are hard coded
+ (let* (;; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
+ ;; Need to keep the empty group because match numbers are
+ ;; hard coded
+ (wbol (concat "\\(^\\)"
+ (when (string-suffix-p ".dtx" (buffer-file-name) t)
+ "%")
+ "[ \t]*"))
(label-re (concat "\\(?:"
(mapconcat #'identity reftex-label-regexps "\\|")
"\\)"))