Hi all,

I noticed that `TeX-local-master-p' doesn't work in Texinfo mode because
it hard-codes comment prefix as "%". Due to this inconsistency, in
texinfo document buffer, the menu item Texinfo->Multifile/Parsing->Set
master file (C-c _) isn't grayed out even when it has valid
"TeX-master:" entry in Local Variables section.

Now that all emacsens supported by AUCTeX have
`file-local-variables-alist', how about the attached patch? It fixes
bug#33227[1] also.
[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33227

Best,
Ikumi Keita

diff --git a/tex.el b/tex.el
index 12d401dd..ca6eb1bb 100644
--- a/tex.el
+++ b/tex.el
@@ -2488,11 +2488,7 @@ Get `major-mode' from master file and enable it."
 (defun TeX-local-master-p ()
   "Return non-nil if there is a `TeX-master' entry in local variables spec.
 Return nil otherwise."
-  (save-excursion
-    ;; XXX: Checking -*- line necessary as well?
-    (goto-char (point-max))
-    (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move)
-    (re-search-forward "^%+ *TeX-master:" nil t)))
+  (assq 'TeX-master file-local-variables-alist))
 
 ;;; Style Paths
 

Reply via email to