GNU logs - #76615, boring messages


Message sent to bug-auctex@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#76615: 14.0.9; error with amsmath style hooks
Resent-From: "Paul D. Nelson" <ultrono@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Thu, 27 Feb 2025 18:31:02 +0000
Resent-Message-ID: <handler.76615.B.17406810044016 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 76615
X-GNU-PR-Package: auctex
X-GNU-PR-Keywords: 
To: 76615 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-auctex@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.17406810044016
          (code B ref -1); Thu, 27 Feb 2025 18:31:02 +0000
Received: (at submit) by debbugs.gnu.org; 27 Feb 2025 18:30:04 +0000
Received: from localhost ([127.0.0.1]:37667 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tnie2-000122-7W
	for submit <at> debbugs.gnu.org; Thu, 27 Feb 2025 13:30:03 -0500
Received: from lists.gnu.org ([2001:470:142::17]:59194)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ultrono@HIDDEN>) id 1tnid7-0000zm-Ho
 for submit <at> debbugs.gnu.org; Thu, 27 Feb 2025 13:29:06 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1tnid0-0000n7-6h
 for bug-auctex@HIDDEN; Thu, 27 Feb 2025 13:28:58 -0500
Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1tnicy-0000uM-7b
 for bug-auctex@HIDDEN; Thu, 27 Feb 2025 13:28:57 -0500
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5ded1395213so1924404a12.2
 for <bug-auctex@HIDDEN>; Thu, 27 Feb 2025 10:28:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740680934; x=1741285734; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=jpzAZsgbiZKwOOpf1batrBS08JqKAsXj55JavpZC0UI=;
 b=N0c7e1Q3QqV5ffwu75R7O2l0rqE8dK/lZ1QF4nJzy1EbCXv28FP2WlwgZWLWvudV4j
 7sKLdQqAJEOvUXBx8Y5tCS2AhBR+5KcmcZZfseQY+IhXbs9q5qugdFq6lVbzqku6zlx8
 0VzCEHg+sBvAJSz3feFa4xryX3XI87ljdpESTXvTV1Nt2FEjEOYZZULUB3TPqkVmCcQa
 cxGbeMub/iVH7KnNmsD7ZZZ2d+dQJ7kbe/qzvtXwpvoBQXRgfxsKAzRaAjQzZW2VADw5
 AWzEOaekRCMK5ZYeN+WH6bYIsbDL5q7ItWgDLBi9U5zsZPtltf+jPAWAAW+NGGbrvOqv
 /7yA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740680934; x=1741285734;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=jpzAZsgbiZKwOOpf1batrBS08JqKAsXj55JavpZC0UI=;
 b=rf6Vh9XcN+t2yTQEiBZEcqHozcF0dO44oJJDEUIWxRwpNHkJxzD/qS8tNjcDtTciIu
 4Nrrn/N7KlJR5PIgHzmfm9TFnhf0IV7gnIpYg/ZEH9i57WdwdWytEtFUYhUMqBO6j3mE
 Z2D+US9kql6Lg3v+fCqg3AHIRgCY9HEtgHr47fbZJPalEaIUp6wAkarBMns1ph18D1sR
 4BnhhBzxAn+AwXbMhTdZRVarxMvHwFbJqNSE1JkFOmOVzRGCQjMQkjza2mmKjuityOhe
 gCSxf19GMZWXm+daQc3HskP0tO5rGVtWft9Qoh0AjC5P791m5dPhQ+2CnP+ZVXGtfw3O
 VBTQ==
X-Gm-Message-State: AOJu0YyaB1Oetdzn3veWkE7+hUJEVr+F0Iqv3kyzgL+UMtp5U1+y1vT6
 neXpYIdUNqo58XoceilEocIxJ6ixoSgQhvCuqCz9Ivghci87w1mMNlf+mSMZvCA=
X-Gm-Gg: ASbGncvJXFh3D8xccDc04htDaZNV1WOFLUXY2fscFxvWsqRAPiKO2wTPylwPv84V9lT
 sZ3d2md/mHYJvIrL+h8UdIB/wKs676WGrzwfLvLqf5MCU3kPbxrx9wpw1wsci0Ow/VjFAOK9oTl
 Q9Ke+uGfT/xTh2xQUURBTAiQ8Urt0wYd5i+2KTQEuxbo7OV76GZOlL3WXltRdeFQS46Fmr4n48k
 fvEKxzyN7G3hQTGP9562kAfWd73qBVkJYBM9/aQc7WJ94cdb0Hgfmbahq9EFSRES1HPDNXI2H7P
 S6vPRuKfAzNGprc3LwBXRUo4Lb9W1qfGPnWaNTsWaMgPtjBPFoDZ
X-Google-Smtp-Source: AGHT+IE8RJGXkjMS1wES0v14yEikMMePBkPcfy3CMfWLmrT7SWb43ROE6vDwlRHDt4DtkIW5OLu5rw==
X-Received: by 2002:a05:6402:2790:b0:5e4:d229:ad3d with SMTP id
 4fb4d7f45d1cf-5e4d6afa4c4mr89470a12.16.1740680933861; 
 Thu, 27 Feb 2025 10:28:53 -0800 (PST)
Received: from localhost (users-1190.st.net.au.dk. [130.225.0.251])
 by smtp.gmail.com with UTF8SMTPSA id
 4fb4d7f45d1cf-5e4c3b6dbbbsm1466472a12.22.2025.02.27.10.28.51
 for <bug-auctex@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Feb 2025 10:28:52 -0800 (PST)
From: "Paul D. Nelson" <ultrono@HIDDEN>
Date: Thu, 27 Feb 2025 19:28:51 +0100
Message-ID: <uxsg7tcyf3nsws.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::531;
 envelope-from=ultrono@HIDDEN; helo=mail-ed1-x531.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi all,

Evaluating the following after Emacs -Q

(progn
  (package-initialize)
  (package-activate 'auctex)
  (add-hook 'LaTeX-mode-hook #'turn-on-reftex)
  (with-temp-buffer
    (LaTeX-mode)
    (TeX-run-style-hooks "amsmath")))

gives the backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil)
  reftex-TeX-master-file()
  reftex-tie-multifile-symbols()
  reftex-add-to-label-alist((AMSTeX))
  #f(compiled-function () #<bytecode 0x1528d667892913ee>)()
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_105>([TeX-style-hook #f(compiled-function () #<bytecode 0x1528d667892913ee>) 1])
  mapcar(#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_105> ([TeX-style-hook #f(compiled-function () #<bytecode 0x1528d667892913ee>) 1]))
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_106>("amsmath")
  TeX-run-style-hooks("amsmath")
  (progn (LaTeX-mode) (TeX-run-style-hooks "amsmath"))
  (unwind-protect (progn (LaTeX-mode) (TeX-run-style-hooks "amsmath")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (LaTeX-mode) (TeX-run-style-hooks "amsmath")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (LaTeX-mode) (TeX-run-style-hooks "amsmath")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (progn (package-initialize) (package-activate 'auctex) (add-hook 'LaTeX-mode-hook #'turn-on-reftex) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (LaTeX-mode) (TeX-run-style-hooks "amsmath")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
  eval((progn (package-initialize) (package-activate 'auctex) (add-hook 'LaTeX-mode-hook #'turn-on-reftex) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (LaTeX-mode) (TeX-run-style-hooks "amsmath")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) nil)
  elisp--eval-last-sexp(nil)
  #f(compiled-function () #<bytecode 0x1866e7a2d80a>)()
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)

I tried this on both the latest AUCTeX release and some earlier 14.0.4
that was lying around.

The issue arose when using log-edit-generate-changelog-from-diff for a
commit involving tex files.  I distilled it down to the above example.

It's clear what's happening -- reftex expects a master file, but it's a
non-file buffer.  I don't know enough about style hooks to diagnose why
reftex is being called in this manner in this situation.

Any suggestions would be welcome.

Thanks, best,

Paul



Emacs  : GNU Emacs 31.0.50 (build 2, aarch64-apple-darwin24.1.0, NS appkit-2575.20 Version 15.1.1 (Build 24B91))
 of 2025-02-27
Package: 14.0.9

current state:
==============
(setq
 window-system 'ns
 LaTeX-version "2e"
 TeX-style-path '("~/.emacs.d/auctex/" "/Users/au710211/.emacs.d/elpa/auctex-14.0.9/style"
		  "/Users/au710211/.emacs.d/auctex/auto" "/Users/au710211/.emacs.d/auctex/style" "auto" "style")
 TeX-auto-save nil
 TeX-parse-self nil
 TeX-master t
 TeX-command-list '(("TeX" "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %(output-dir) %t"
		     TeX-run-TeX nil (plain-TeX-mode AmSTeX-mode Texinfo-mode) :help "Run plain TeX")
		    ("LaTeX" "%`%l%(mode)%' %T" TeX-run-TeX nil (LaTeX-mode docTeX-mode) :help "Run LaTeX")
		    ("Makeinfo" "makeinfo %(extraopts) %(o-dir) %t" TeX-run-compile nil (Texinfo-mode) :help
		     "Run Makeinfo with Info output")
		    ("Makeinfo HTML" "makeinfo %(extraopts) %(o-dir) --html %t" TeX-run-compile nil (Texinfo-mode)
		     :help "Run Makeinfo with HTML output")
		    ("AmSTeX" "amstex %(PDFout) %`%(extraopts) %S%(mode)%' %(output-dir) %t" TeX-run-TeX nil
		     (AmSTeX-mode) :help "Run AMSTeX")
		    ("ConTeXt" "%(cntxcom) --once %(extraopts) %(execopts)%t" TeX-run-TeX nil (ConTeXt-mode) :help
		     "Run ConTeXt once")
		    ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t" TeX-run-TeX nil (ConTeXt-mode) :help
		     "Run ConTeXt until completion")
		    ("BibTeX" "bibtex %(O?aux)" TeX-run-BibTeX nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode ConTeXt-mode) :help
		     "Run BibTeX")
		    ("Biber" "biber %(output-dir) %s" TeX-run-Biber nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help "Run Biber")
		    ("Texindex" "texindex %s.??" TeX-run-command nil (Texinfo-mode) :help "Run Texindex")
		    ("Texi2dvi" "%(PDF)texi2dvi %t" TeX-run-command nil (Texinfo-mode) :help
		     "Run Texi2dvi or Texi2pdf")
		    ("View" "%V" TeX-run-discard-or-function t t :help "Run Viewer")
		    ("Print" "%p" TeX-run-command t t :help "Print the file")
		    ("Queue" "%q" TeX-run-background nil t :help "View the printer queue" :visible
		     TeX-queue-command)
		    ("File" "%(o?)dvips %d -o %f " TeX-run-dvips t
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help
		     "Generate PostScript file")
		    ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help
		     "Convert DVI file to PostScript")
		    ("Dvipdfmx" "dvipdfmx -o %(O?pdf) %d" TeX-run-dvipdfmx nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help
		     "Convert DVI file to PDF with dvipdfmx")
		    ("Ps2pdf" "ps2pdf %f %(O?pdf)" TeX-run-ps2pdf nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help
		     "Convert PostScript file to PDF")
		    ("LaTeXMk"
		     "latexmk %(latexmk-out) %(file-line-error) %(output-dir) %`%(extraopts) %S%(mode)%' %t"
		     TeX-run-TeX nil (LaTeX-mode docTeX-mode) :help "Run LaTeXMk")
		    ("Glossaries" "makeglossaries %(d-dir) %s" TeX-run-command nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help
		     "Run makeglossaries to create glossary file")
		    ("Index" "makeindex %(O?idx)" TeX-run-index nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help
		     "Run makeindex to create index file")
		    ("upMendex" "upmendex %(O?idx)" TeX-run-index t
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help
		     "Run upmendex to create index file")
		    ("Xindy" "texindy %s" TeX-run-command nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help
		     "Run xindy to create index file")
		    ("Check" "lacheck %s" TeX-run-compile nil (LaTeX-mode) :help "Check LaTeX file for correctness")
		    ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (LaTeX-mode) :help
		     "Check LaTeX file for common mistakes")
		    ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document")
		    ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files")
		    ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help
		     "Delete generated intermediate and output files")
		    ("Other" "" TeX-run-command t t :help "Run an arbitrary command"))
 )




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: "Paul D. Nelson" <ultrono@HIDDEN>
Subject: bug#76615: Acknowledgement (14.0.9; error with amsmath style hooks)
Message-ID: <handler.76615.B.17406810044016.ack <at> debbugs.gnu.org>
References: <uxsg7tcyf3nsws.fsf@HIDDEN>
X-Gnu-PR-Message: ack 76615
X-Gnu-PR-Package: auctex
Reply-To: 76615 <at> debbugs.gnu.org
Date: Thu, 27 Feb 2025 18:31:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-auctex@HIDDEN

If you wish to submit further information on this problem, please
send it to 76615 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
76615: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D76615
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-auctex@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#76615: 14.0.9; error with amsmath style hooks
Resent-From: Arash Esbati <arash@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Fri, 28 Feb 2025 07:53:02 +0000
Resent-Message-ID: <handler.76615.B76615.17407291369646 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 76615
X-GNU-PR-Package: auctex
X-GNU-PR-Keywords: 
To: "Paul D. Nelson" <ultrono@HIDDEN>
Cc: 76615 <at> debbugs.gnu.org
Received: via spool by 76615-submit <at> debbugs.gnu.org id=B76615.17407291369646
          (code B ref 76615); Fri, 28 Feb 2025 07:53:02 +0000
Received: (at 76615) by debbugs.gnu.org; 28 Feb 2025 07:52:16 +0000
Received: from localhost ([127.0.0.1]:44537 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tnvAN-0002VU-O5
	for submit <at> debbugs.gnu.org; Fri, 28 Feb 2025 02:52:16 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:44922)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <arash@HIDDEN>) id 1tnvAK-0002Uo-LM
 for 76615 <at> debbugs.gnu.org; Fri, 28 Feb 2025 02:52:13 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <arash@HIDDEN>)
 id 1tnvAF-0006iM-7O; Fri, 28 Feb 2025 02:52:07 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=lorg4s7pFd3tG3G8hdxPD1ncX7hmnekRriH7M1upJjY=; b=o934EVztxhiUFnzX/tsa
 HotDzaCIil/rViU0MqGqkcRq4N5/s7tk/NucHk9DsnuxSN/bKW/ptLT4wQF6rES9dpIPjciK7COwk
 CNdbwkV8a/5q0VviMmWWMtob39QuaXROJWhTR/ZeBHKIreD5Mnur3OTUlG865wjKaT9e/i1ebloK+
 wB1+OJKcx6N+L4lp2CZKSNHWLdSMg6MENhp9UvYpK52mPdZ+ztyFhR7RWZROGQGThG1sYzwFOiMMV
 nYHmT6gqyYvUtByDuXFENsweMLSqgBbywcv7NBzIpZC4RjXSnakv1/3dGOnu3pdE2OhyIAJFf42Qq
 KaXMR//aufPN7Q==;
From: Arash Esbati <arash@HIDDEN>
In-Reply-To: <uxsg7tcyf3nsws.fsf@HIDDEN>
References: <uxsg7tcyf3nsws.fsf@HIDDEN>
Date: Fri, 28 Feb 2025 08:52:02 +0100
Message-ID: <m21pvi8q1p.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Paul,

"Paul D. Nelson" <ultrono@HIDDEN> writes:

> Evaluating the following after Emacs -Q
>
> (progn
>   (package-initialize)
>   (package-activate 'auctex)
>   (add-hook 'LaTeX-mode-hook #'turn-on-reftex)
>   (with-temp-buffer
>     (LaTeX-mode)
>     (TeX-run-style-hooks "amsmath")))
>
> gives the backtrace:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   expand-file-name(nil)
>   reftex-TeX-master-file()
>   reftex-tie-multifile-symbols()
>   reftex-add-to-label-alist((AMSTeX))

I think this is because of this part of amsmath.el[1]:

   ;; RefTeX support: Tell RefTeX about amsmath environments.
   (when (fboundp 'reftex-add-to-label-alist)
     (reftex-add-to-label-alist '(AMSTeX)))

> The issue arose when using log-edit-generate-changelog-from-diff for a
> commit involving tex files.  I distilled it down to the above example.

I'd say the form above was in amsmath.el since forever :-)

HTH.  Best, Arash

Footnotes:
[1]  https://git.savannah.gnu.org/cgit/auctex.git/tree/style/amsmath.el#n165




Message sent to bug-auctex@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#76615: 14.0.9; error with amsmath style hooks
References: <uxsg7tcyf3nsws.fsf@HIDDEN>
Resent-From: "Paul D. Nelson" <ultrono@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Fri, 28 Feb 2025 15:23:04 +0000
Resent-Message-ID: <handler.76615.B76615.17407561275297 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 76615
X-GNU-PR-Package: auctex
X-GNU-PR-Keywords: 
To: Arash Esbati <arash@HIDDEN>
Cc: 76615 <at> debbugs.gnu.org
Received: via spool by 76615-submit <at> debbugs.gnu.org id=B76615.17407561275297
          (code B ref 76615); Fri, 28 Feb 2025 15:23:04 +0000
Received: (at 76615) by debbugs.gnu.org; 28 Feb 2025 15:22:07 +0000
Received: from localhost ([127.0.0.1]:50803 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1to2Bi-0001NM-Et
	for submit <at> debbugs.gnu.org; Fri, 28 Feb 2025 10:22:07 -0500
Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:55672)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <ultrono@HIDDEN>) id 1to2Ba-0001Lm-Te
 for 76615 <at> debbugs.gnu.org; Fri, 28 Feb 2025 10:22:02 -0500
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5dedd4782c6so4090169a12.3
 for <76615 <at> debbugs.gnu.org>; Fri, 28 Feb 2025 07:21:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740756112; x=1741360912; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from:from:to
 :cc:subject:date:message-id:reply-to;
 bh=+EGkDhPhtX3uZAfBLKpZIY5igXiCjPJGgMBImggvkPE=;
 b=DUChTx9EW21Uk57n6yK/TDzMdSrNx0P8BSIeWI2K6MhC9M5uAlfJ8GR1UV+ycSIC0+
 40xRlFc7kLKeKYsHjPZzQs2O7fy/2WFpTuvHCIVzXgV6XMMxnI9l7ipSmNHlEorkNgmH
 4LchnJmeo72zqFlfMvZszZAiuXFH5ns+DU0cCofrENTZBsWfaCylQpMfe0Rykb6RvqeP
 hhq+SVbJbGFUBSieToVPppvWbJVE9Q1sbT4LXvn7+LS9M63XTgxzwS8U0c+FcW4NlGNH
 WvRis4GFe7lIkK6MZryOjnfnI03s3h81WA5FnRFPQAAB2gBG1N/QqVgu8v+5ViVYHJLa
 4FUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740756112; x=1741360912;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=+EGkDhPhtX3uZAfBLKpZIY5igXiCjPJGgMBImggvkPE=;
 b=RMVFpzrdNySCpvWqGjJ/keCcdHNNUajit4jOzJkBNFFlAx1k7OiBdY51LWuTO267uH
 cd1bnSZJEUW7gj7vqElXIL2xllqy0ukGUoQJHny5Kuytlj38JKFtBtY13Pt+Om5wIvo6
 ylye006CtxjGjvQRc7QVpbDcesfv2C0NHGRYYDo7TxfUtAOwku+uOg6uSpa0gg/4sZ8H
 7lvilVM6Nk0ddmJz1obz+29P0Ak1nIB3GkMpp2nosLqqP1Qg3BUbyOa4rCsFzBoyN8E8
 SIlraijeVsTlXFllAYDmh+BTZSTO8oKwiYUBfGTWlVLaRtPP4lLKUEdwCCKheTPF3MAp
 Ipbw==
X-Gm-Message-State: AOJu0Yx2QUcQ+ncXcnUCBJAIrS9EI9HGICKJLxUrGuXjCrUgEcVNZLkQ
 /+rO1a3E+v6Jc/hL81o3ASv4NVmXGrFvdv1KgvrDjwiEM+Xv/rPn
X-Gm-Gg: ASbGncvXovc9hPNj36er4O+1xV4DM3IiehvmYE6fdmHhnrP6Kb/JdW8Dv/5/Xk0qnpp
 j2MGETPVawCmNJHVXrbvcqL6uALgnZorHXQmt6AOlqCzU1gTdLwb5iUWIPzjS1PGZoW+d6/1PqL
 3F2NZ9Y9AcbNlozCVXsMVVSAF+T3WOigdqu3kEq5uHLw7rhWn3H4X6Uc74/vJ1c/cdxlj1rSwvo
 xuSeTSxuByZt/6Iui7y0iCqhSwJ2bpFipjCZGdcxqjsx1Lkpy9hB0UKsxv+g4DXtSj+BrRU6mMm
 xshZw/7GKYc8y979PiWRb9+Xiqrc0x8mtr1NDI82Gz6E77ncRXjU
X-Google-Smtp-Source: AGHT+IEXEM6ZT+AuOVdQpz4bMHG2zQPzG+33JXyAnW0PE3aQOfE2ilJh04AspcZn3+noijK7sSzDww==
X-Received: by 2002:a05:6402:40ca:b0:5e0:4276:c39e with SMTP id
 4fb4d7f45d1cf-5e4d6b86d7dmr2944875a12.30.1740756112138; 
 Fri, 28 Feb 2025 07:21:52 -0800 (PST)
Received: from localhost (users-1190.st.net.au.dk. [130.225.0.251])
 by smtp.gmail.com with UTF8SMTPSA id
 4fb4d7f45d1cf-5e4c3b6ce0csm2666725a12.24.2025.02.28.07.21.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Feb 2025 07:21:50 -0800 (PST)
From: "Paul D. Nelson" <ultrono@HIDDEN>
In-Reply-To: <m21pvi8q1p.fsf@HIDDEN> (message from Arash Esbati
 on Fri, 28 Feb 2025 08:52:02 +0100)
Date: Fri, 28 Feb 2025 16:21:49 +0100
Message-ID: <uxsg7t4j0eyu0i.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Hi Arash,

>
> I think this is because of this part of amsmath.el[1]:
>
>    ;; RefTeX support: Tell RefTeX about amsmath environments.
>    (when (fboundp 'reftex-add-to-label-alist)
>      (reftex-add-to-label-alist '(AMSTeX)))
>
>> The issue arose when using log-edit-generate-changelog-from-diff for a
>> commit involving tex files.  I distilled it down to the above example.
>
> I'd say the form above was in amsmath.el since forever :-)
>

Indeed.

The attached patch addresses the issue for me.  Thoughts?

Paul


--=-=-=
Content-Type: text/plain
Content-Disposition: inline

diff --git a/style/amsmath.el b/style/amsmath.el
index 9d6944dc..68cd5983 100644
--- a/style/amsmath.el
+++ b/style/amsmath.el
@@ -163,7 +163,8 @@
    (TeX-run-style-hooks "amstext" "amsbsy" "amsopn")
 
    ;; RefTeX support: Tell RefTeX about amsmath environments.
-   (when (fboundp 'reftex-add-to-label-alist)
+   (when (and (fboundp 'reftex-add-to-label-alist)
+              (buffer-file-name))
      (reftex-add-to-label-alist '(AMSTeX)))
 
    ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e'
@@ -180,6 +181,7 @@
    ;; is non-nil
    (and LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
+        (buffer-file-name)
         (reftex-ref-style-activate "AMSmath"))
 
    (when (and (featurep 'font-latex)

--=-=-=--




Message sent to bug-auctex@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#76615: 14.0.9; error with amsmath style hooks
References: <uxsg7tcyf3nsws.fsf@HIDDEN>
Resent-From: "Paul D. Nelson" <ultrono@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Fri, 28 Feb 2025 15:55:02 +0000
Resent-Message-ID: <handler.76615.B76615.174075806416880 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 76615
X-GNU-PR-Package: auctex
X-GNU-PR-Keywords: 
To: "Paul D. Nelson" <ultrono@HIDDEN>
Cc: arash@HIDDEN, 76615 <at> debbugs.gnu.org
Received: via spool by 76615-submit <at> debbugs.gnu.org id=B76615.174075806416880
          (code B ref 76615); Fri, 28 Feb 2025 15:55:02 +0000
Received: (at 76615) by debbugs.gnu.org; 28 Feb 2025 15:54:24 +0000
Received: from localhost ([127.0.0.1]:51218 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1to2gy-0004OC-82
	for submit <at> debbugs.gnu.org; Fri, 28 Feb 2025 10:54:24 -0500
Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:49559)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <ultrono@HIDDEN>) id 1to2gw-0004NT-82
 for 76615 <at> debbugs.gnu.org; Fri, 28 Feb 2025 10:54:22 -0500
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5e058ca6806so3529572a12.3
 for <76615 <at> debbugs.gnu.org>; Fri, 28 Feb 2025 07:54:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740758055; x=1741362855; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from:from:to
 :cc:subject:date:message-id:reply-to;
 bh=9t9NtdG5dWdjGMq57UNgeF+kVXWVdvDNgaNsOb0ZuTA=;
 b=lHddxBLVEgmiQpdw6pNebrVyWZ+OifBimq4xAMleL++dfwpxh/xlQgDmCknpdhKqAe
 6Gqs7n3u/DFO7xJTLyAxXobDlt4Cpv+6L46Mgc7yDZvih0gHNZT3h5woYRz0s3t6cW0Z
 j9H1qJynOOMSN9EEcstf2mI4iIcwhg8U7TrsbFoWrkyBT9W95tEP+qPhYltTBdJ/MFu8
 3xVwVPNRgWTvWIF/oTCPHsZ7ImwIxfyzfWL+bsCkmRF8jTe1UkpG8G6wiz37lZKkbW6F
 qs+twTIjPkIiOnlEDtzOj2+/boxY3VV+5/qVCyOyjcrPEdqZre37RisvwEljl2krs4zF
 U3ow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740758055; x=1741362855;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=9t9NtdG5dWdjGMq57UNgeF+kVXWVdvDNgaNsOb0ZuTA=;
 b=vLg/SUUcMoXJLu+7RkwNQJ+74y++VC9Wwuo+0s2Ycnc2MxiJ0nOPlyGk5+OXs27SxC
 S/8AKkswcGzy12qX1FzTYK9q77F7plRv+WuQf9LG7RHPLxS2p7yos5a4HCtVLFdPbN99
 JHXgGyqhvGKd2tjRfIrP408IH1/XP85ip1WgUKYtMfVzqLzgzCkQIgkn6jIeeVyurCT7
 NWkTmxx/xYT8M06T22Hh9xuJFDg20WgoWX11EvqPvopHylA+f/H6yernny1IJVl2z4rm
 Z7UTzL9D52XvSZyPTVle9FsGA2zyrvwoESL7VQrY6LhnVlJ5RtfVjW1wnN/XGz8ZstNl
 d31A==
X-Forwarded-Encrypted: i=1;
 AJvYcCU5bjylURmjPu3qAVl5M5he7XxjpratL24lv5MMwjcNpVmbVKOhrZeTbvQsTcxmMcaNqQReIA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwKvKv5PxzvOK+1XTlaOgv/lAlQ4AteQx/2ueJZesv7hmPqLZuD
 GChFHytqYMCpCF2KNa60NsAzGKWhD+4DE9II6IUZgwIHloegoiSC
X-Gm-Gg: ASbGncvejHy8QY2vGFp0VB/VnVIqF2He74MWguFYZcItMKq0gya4c6dgRBinaNXZDvx
 Vninyme+tzleRsZsX7urJ58QktbZWdJZp5hWkUPuE0hMP9mDHiLwMA5Ycgkw8PCU7x10uZx8ot0
 VyGr8xg4SeZ/nTI8S/ylEkmVd3ZPqpVxyFrblh8b0CmR/pg5mPCRHPhtgYr304gxhJCXXoHRnoG
 Pkm2lcpTAQwFC0GDNIWqOPtTeCcl0p0bUeyiq1JbX4sIqW8q3+zO0aVjIb+tygFpP7tjlg0vLPg
 t1kjVrnsZXYd17zmg/MOQ5Dbq4phqJCQ0Gf7lC9q1fgeaXpx4f3Q
X-Google-Smtp-Source: AGHT+IGj0fzkem7f9E3A3Cs64jiC0j1qhspVtHrVRjlOEGiBFunbNQLaTzHIcoUnx3RzxsfThP5bDQ==
X-Received: by 2002:a17:907:7ba7:b0:ab7:83c2:bdb7 with SMTP id
 a640c23a62f3a-abf26826359mr482800166b.49.1740758055117; 
 Fri, 28 Feb 2025 07:54:15 -0800 (PST)
Received: from localhost (users-1190.st.net.au.dk. [130.225.0.251])
 by smtp.gmail.com with UTF8SMTPSA id
 a640c23a62f3a-abf0c74fb00sm307778866b.130.2025.02.28.07.54.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Feb 2025 07:54:14 -0800 (PST)
From: "Paul D. Nelson" <ultrono@HIDDEN>
In-Reply-To: <uxsg7t4j0eyu0i.fsf@HIDDEN> (ultrono@HIDDEN)
Date: Fri, 28 Feb 2025 16:54:13 +0100
Message-ID: <uxsg7tsenyjc9m.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

"Paul D. Nelson" <ultrono@HIDDEN> writes:

>
> The attached patch addresses the issue for me.  Thoughts?
>

Here's a more complete version, addressing related issues.  This feels a
bit like plugging a leak with a band-aid, so other suggestions would
also be welcome.


--=-=-=
Content-Type: text/plain
Content-Disposition: inline

diff --git a/style/amsmath.el b/style/amsmath.el
index 9d6944dc..68cd5983 100644
--- a/style/amsmath.el
+++ b/style/amsmath.el
@@ -163,7 +163,8 @@
    (TeX-run-style-hooks "amstext" "amsbsy" "amsopn")
 
    ;; RefTeX support: Tell RefTeX about amsmath environments.
-   (when (fboundp 'reftex-add-to-label-alist)
+   (when (and (fboundp 'reftex-add-to-label-alist)
+              (buffer-file-name))
      (reftex-add-to-label-alist '(AMSTeX)))
 
    ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e'
@@ -180,6 +181,7 @@
    ;; is non-nil
    (and LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
+        (buffer-file-name)
         (reftex-ref-style-activate "AMSmath"))
 
    (when (and (featurep 'font-latex)
diff --git a/style/cleveref.el b/style/cleveref.el
index 129d4ce1..67bece8b 100644
--- a/style/cleveref.el
+++ b/style/cleveref.el
@@ -211,6 +211,7 @@ string."
    ;; Activate RefTeX reference style.
    (and LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
+        (buffer-file-name)
         (reftex-ref-style-activate "Cleveref")))
  TeX-dialect)
 
diff --git a/style/fancyref.el b/style/fancyref.el
index d2d87bf5..a580fcbf 100644
--- a/style/fancyref.el
+++ b/style/fancyref.el
@@ -103,6 +103,7 @@
    ;; Activate RefTeX reference style.
    (and LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
+        (buffer-file-name)
         (reftex-ref-style-activate "Fancyref")))
  TeX-dialect)
 
diff --git a/style/hyperref.el b/style/hyperref.el
index 868acd33..e801140b 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -343,6 +343,7 @@
    ;; Activate RefTeX reference style.
    (and LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
+        (buffer-file-name)
         (reftex-ref-style-activate "Hyperref")))
  TeX-dialect)
 
diff --git a/style/refcount.el b/style/refcount.el
index e20ef395..560855c0 100644
--- a/style/refcount.el
+++ b/style/refcount.el
@@ -79,6 +79,7 @@
    ;; Activate RefTeX reference style
    (and LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
+        (buffer-file-name)
         (reftex-ref-style-activate "Refcount")))
  TeX-dialect)
 
diff --git a/style/varioref.el b/style/varioref.el
index e7f95f7f..b149d4de 100644
--- a/style/varioref.el
+++ b/style/varioref.el
@@ -90,6 +90,7 @@
    ;; Activate RefTeX reference style.
    (and LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
+        (buffer-file-name)
         (reftex-ref-style-activate "Varioref")))
  TeX-dialect)
 

--=-=-=--




Message sent to bug-auctex@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#76615: 14.0.9; error with amsmath style hooks
Resent-From: Ikumi Keita <ikumi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Fri, 28 Feb 2025 15:58:02 +0000
Resent-Message-ID: <handler.76615.B76615.174075823818217 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 76615
X-GNU-PR-Package: auctex
X-GNU-PR-Keywords: 
To: "Paul D. Nelson" <ultrono@HIDDEN>, Arash Esbati <arash@HIDDEN>
Cc: 76615 <at> debbugs.gnu.org
Received: via spool by 76615-submit <at> debbugs.gnu.org id=B76615.174075823818217
          (code B ref 76615); Fri, 28 Feb 2025 15:58:02 +0000
Received: (at 76615) by debbugs.gnu.org; 28 Feb 2025 15:57:18 +0000
Received: from localhost ([127.0.0.1]:51268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1to2jm-0004jk-0V
	for submit <at> debbugs.gnu.org; Fri, 28 Feb 2025 10:57:18 -0500
Received: from smtp1a.inetd.co.jp ([210.129.88.11]:38182)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ikumi@HIDDEN>)
 id 1to2je-0004iY-SL
 for 76615 <at> debbugs.gnu.org; Fri, 28 Feb 2025 10:57:11 -0500
Received: from localhost (42-144-34-247.rev.home.ne.jp [42.144.34.247])
 by smtp1a.inetd.co.jp (Postfix) with ESMTPSA id B4EDC6A;
 Sat,  1 Mar 2025 00:57:07 +0900 (JST)
From: Ikumi Keita <ikumi@HIDDEN>
In-reply-to: <m21pvi8q1p.fsf@HIDDEN>
References: <uxsg7tcyf3nsws.fsf@HIDDEN> <m21pvi8q1p.fsf@HIDDEN>
Comments: In-reply-to Arash Esbati <arash@HIDDEN>
 message dated "Fri, 28 Feb 2025 08:52:02 +0100."
X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 29.4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <54588.1740758226.1@localhost>
Date: Sat, 01 Mar 2025 00:57:06 +0900
Message-ID: <54589.1740758226@localhost>
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Paul and Arash,

>>>>> Arash Esbati <arash@HIDDEN> writes:
> "Paul D. Nelson" <ultrono@HIDDEN> writes:

>> Evaluating the following after Emacs -Q
>> 
>> (progn
>> (package-initialize)
>> (package-activate 'auctex)
>> (add-hook 'LaTeX-mode-hook #'turn-on-reftex)
>> (with-temp-buffer
>> (LaTeX-mode)
>> (TeX-run-style-hooks "amsmath")))
>> 
>> gives the backtrace:
>> 
>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>> expand-file-name(nil)
>> reftex-TeX-master-file()
>> reftex-tie-multifile-symbols()
>> reftex-add-to-label-alist((AMSTeX))

> I think this is because of this part of amsmath.el[1]:

>    ;; RefTeX support: Tell RefTeX about amsmath environments.
>    (when (fboundp 'reftex-add-to-label-alist)
>      (reftex-add-to-label-alist '(AMSTeX)))

I tried commenting out this part, but it still fails at another part im
amsmath.el:
   (and LaTeX-reftex-ref-style-auto-activate
        (fboundp 'reftex-ref-style-activate)
        (reftex-ref-style-activate "AMSmath"))

>> The issue arose when using log-edit-generate-changelog-from-diff for a
>> commit involving tex files.  I distilled it down to the above example.

> I'd say the form above was in amsmath.el since forever :-)

The fundamental origin of the problem is that RefTeX presumes that it
always works in the buffer associated with files. In other words, RefTeX
pays no attention to non-file buffer. (I have such impression, skimming
over the RefTeX code. Please correct me if I'm wrong.)

>>>>> "Paul D. Nelson" <ultrono@HIDDEN> writes:
> The attached patch addresses the issue for me.  Thoughts?

I have basically the same idea, but I think such partial treatment
inctroduces inconsistent internal state of RefTeX and can be potential
problems. Rather I propose to wrap the whole RefTeX management
part in amsmath.el by (when buffer-file-name ... ). In addition, we
should turn off RefTeX mode in `TeX-mode-cleanup' like
  (unless buffer-file-truename
    (if (bound-and-true-p reftex-mode) <-- addition
      (reftex-mode -1))                <-- addition
    (TeX-update-style))
to avoid inconsistency.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




Message sent to bug-auctex@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#76615: 14.0.9; error with amsmath style hooks
References: <uxsg7tcyf3nsws.fsf@HIDDEN>
Resent-From: "Paul D. Nelson" <ultrono@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Fri, 28 Feb 2025 16:08:02 +0000
Resent-Message-ID: <handler.76615.B76615.174075883221913 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 76615
X-GNU-PR-Package: auctex
X-GNU-PR-Keywords: 
To: Ikumi Keita <ikumi@HIDDEN>
Cc: arash@HIDDEN, 76615 <at> debbugs.gnu.org
Received: via spool by 76615-submit <at> debbugs.gnu.org id=B76615.174075883221913
          (code B ref 76615); Fri, 28 Feb 2025 16:08:02 +0000
Received: (at 76615) by debbugs.gnu.org; 28 Feb 2025 16:07:12 +0000
Received: from localhost ([127.0.0.1]:51396 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1to2tL-0005hH-AU
	for submit <at> debbugs.gnu.org; Fri, 28 Feb 2025 11:07:12 -0500
Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:55696)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <ultrono@HIDDEN>) id 1to2tH-0005gN-RK
 for 76615 <at> debbugs.gnu.org; Fri, 28 Feb 2025 11:07:08 -0500
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5dedd4782c6so4188832a12.3
 for <76615 <at> debbugs.gnu.org>; Fri, 28 Feb 2025 08:07:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740758821; x=1741363621; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from:from:to
 :cc:subject:date:message-id:reply-to;
 bh=Qz/0E2f6UYvJOJc3nX0N2sADjs8Wfwa5wovo6OPRdRw=;
 b=QmCAsAG+nY22nS8lzMTlzPV6m/AkTqTuxirKXsc+3L6NAGUno9mMQP3OaSSmqUUZ7c
 CSbePVPh3h0HN8ZyiVZnJ+eyahNfgRtXvDIM9QfeK+v6pIdPVpQ8eFM8t4e0+ZlitQUT
 FBce4f/Q44C8Duh092C7SvBVB9/TUqQGPDzvgRxdxT2j8+35vHvq7htd3Xa/LNi55H1v
 g1C3InCkJF35JeUgLDVyYjAi4VMZhRTS7HmuMq0LhpH8TZdzFixIB9rj5PAmJHfmb+cB
 4gp083BbrOKTkWVNIWvgqmAF8Nf/eH07JUDVW6oZ24yZMFrKWLLSskarEltB9QYyfs+0
 ZlOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740758821; x=1741363621;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=Qz/0E2f6UYvJOJc3nX0N2sADjs8Wfwa5wovo6OPRdRw=;
 b=DgKXmLluCc5NaVbVqoTGzvfW/Am/6LkDXXvsk9rXjvui8+tzOY4FRGenYui3+BmdZA
 0jvmjn238zTbEM62Xi8eqZCOWQIbW2OzHJv+gXSVASFVhYKNZ5N6Y0J/jLDq5l8UU+8J
 0g8VI1WqEENfcK//TBySyFjIyO4X+nFksoAZ/YuKyQOQxYrwRo6gUjWNYcCIypLPqpkd
 p/T0wm9b+m334YLDBbCcBfRITHPRRNCqFDtOjeRsWoHjMAxb+L6WNl2ChX0Wmu1UjKKc
 zQEmzg6p+LMD75hRtUlG1r8GOaePJ1sJDi5OqFkSk2pu4ajIw/6bG5fV/ZINsa55Oe7K
 73Ug==
X-Forwarded-Encrypted: i=1;
 AJvYcCW8omzTMrUaIlEMn4zyqYVpMCwo2mn0q+4GQ8QzfOXS0pwnpMfe8g3lvAUUeaupT59WCyOMqg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzYgioAy6YpMx2J2YrNAxykjGiwTvPd3VuRrlVcRxwywdTTcjJC
 diwGRPD+wOlhSRHV6cVvPQTaUjR6fg7IqlRp1XjFpNsOwatJeVQ5MllZGcKQ6i4=
X-Gm-Gg: ASbGncvefHtfXSX1iFXI6qdziu8MOKvPMgCNdA50FOvec+8giWFz1nA/De+jsQV3Jat
 1KtD+hkD92+VP9QmOf+quinGCFP618mQkRgThY26w6ld94fcT8lbfgvDXIK9heWc5pUyVWiEMLv
 reYh0olbgxYtNmCrOvxvO3H+0rDbXvlXDQwIENevPGsoc3mx/MO/YnL45FrrYvHbGDWF9OAPOIm
 WIM8SVbYBJwzL4QvsXK7KlOWImsogR0UywVkGDgJj849ZDby7CbTeQvbIvvKH3oW80L5HJxElOH
 lyF6T3p1TQLR6KBErIG0H1+dPmH3R/bMBNzHU4S0KjPg+wtE6MYN
X-Google-Smtp-Source: AGHT+IGS1K+7UZf/T9+iqZVdKZlwfVJ82mmetirD00DuR2bK3nWTtbMdIn1VUJ2hxWqV+2/dqyz/cA==
X-Received: by 2002:a05:6402:5242:b0:5e4:9348:72d4 with SMTP id
 4fb4d7f45d1cf-5e4d6b6fccamr3696700a12.24.1740758820510; 
 Fri, 28 Feb 2025 08:07:00 -0800 (PST)
Received: from localhost (users-1190.st.net.au.dk. [130.225.0.251])
 by smtp.gmail.com with UTF8SMTPSA id
 4fb4d7f45d1cf-5e4c3b4aad0sm2699291a12.2.2025.02.28.08.06.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Feb 2025 08:06:59 -0800 (PST)
From: "Paul D. Nelson" <ultrono@HIDDEN>
In-Reply-To: <54589.1740758226@localhost> (message from Ikumi Keita on Sat,
 01 Mar 2025 00:57:06 +0900)
Date: Fri, 28 Feb 2025 17:06:58 +0100
Message-ID: <uxsg7tplj2jbod.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Hi Ikumi,

>
> The fundamental origin of the problem is that RefTeX presumes that it
> always works in the buffer associated with files. In other words, RefTeX
> pays no attention to non-file buffer. (I have such impression, skimming
> over the RefTeX code. Please correct me if I'm wrong.)
>

This has also been my understanding (although I stopped using RefTeX
years ago, basically for this reason).

>>>>>> "Paul D. Nelson" <ultrono@HIDDEN> writes:
>> The attached patch addresses the issue for me.  Thoughts?
>
> I have basically the same idea, but I think such partial treatment
> inctroduces inconsistent internal state of RefTeX and can be potential
> problems. Rather I propose to wrap the whole RefTeX management
> part in amsmath.el by (when buffer-file-name ... ). In addition, we
> should turn off RefTeX mode in `TeX-mode-cleanup' like
>   (unless buffer-file-truename
>     (if (bound-and-true-p reftex-mode) <-- addition
>       (reftex-mode -1))                <-- addition
>     (TeX-update-style))
> to avoid inconsistency.
>

Something like the attached, I guess?  There are other uses of "reftex-"
in style/, so I guess something similar should be done for all of them?

Thanks, best,

Paul


--=-=-=
Content-Type: text/plain
Content-Disposition: inline

diff --git a/style/amsmath.el b/style/amsmath.el
index 9d6944dc..c73f7475 100644
--- a/style/amsmath.el
+++ b/style/amsmath.el
@@ -163,24 +163,25 @@
    (TeX-run-style-hooks "amstext" "amsbsy" "amsopn")
 
    ;; RefTeX support: Tell RefTeX about amsmath environments.
-   (when (fboundp 'reftex-add-to-label-alist)
-     (reftex-add-to-label-alist '(AMSTeX)))
-
-   ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e'
-   (when (and (boundp 'reftex-ref-style-alist)
-              ;; check if Emacs is already equipped with this
-              (not (assoc "AMSmath" reftex-ref-style-alist)))
-     ;; Append it to a local version in order to avoid a clash with
-     ;; user settings
-     (add-to-list (make-local-variable 'reftex-ref-style-alist)
-                  '("AMSmath" "amsmath" (("\\eqref" ?e)))
-                  t))
-
-   ;; Activate `AMSmath' when `LaTeX-reftex-ref-style-auto-activate'
-   ;; is non-nil
-   (and LaTeX-reftex-ref-style-auto-activate
-        (fboundp 'reftex-ref-style-activate)
-        (reftex-ref-style-activate "AMSmath"))
+   (when buffer-file-truename
+     (when (fboundp 'reftex-add-to-label-alist)
+       (reftex-add-to-label-alist '(AMSTeX)))
+
+     ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e'
+     (when (and (boundp 'reftex-ref-style-alist)
+                ;; check if Emacs is already equipped with this
+                (not (assoc "AMSmath" reftex-ref-style-alist)))
+       ;; Append it to a local version in order to avoid a clash with
+       ;; user settings
+       (add-to-list (make-local-variable 'reftex-ref-style-alist)
+                    '("AMSmath" "amsmath" (("\\eqref" ?e)))
+                    t))
+
+     ;; Activate `AMSmath' when `LaTeX-reftex-ref-style-auto-activate'
+     ;; is non-nil
+     (and LaTeX-reftex-ref-style-auto-activate
+          (fboundp 'reftex-ref-style-activate)
+          (reftex-ref-style-activate "AMSmath")))
 
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))

--=-=-=--




Message sent to bug-auctex@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#76615: 14.0.9; error with amsmath style hooks
Resent-From: Ikumi Keita <ikumi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Sat, 01 Mar 2025 03:40:01 +0000
Resent-Message-ID: <handler.76615.B76615.174080036716984 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 76615
X-GNU-PR-Package: auctex
X-GNU-PR-Keywords: 
To: "Paul D. Nelson" <ultrono@HIDDEN>
Cc: arash@HIDDEN, 76615 <at> debbugs.gnu.org
Received: via spool by 76615-submit <at> debbugs.gnu.org id=B76615.174080036716984
          (code B ref 76615); Sat, 01 Mar 2025 03:40:01 +0000
Received: (at 76615) by debbugs.gnu.org; 1 Mar 2025 03:39:27 +0000
Received: from localhost ([127.0.0.1]:57396 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1toDhG-0004Ps-LV
	for submit <at> debbugs.gnu.org; Fri, 28 Feb 2025 22:39:26 -0500
Received: from smtp1a.inetd.co.jp ([210.129.88.11]:38970)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ikumi@HIDDEN>)
 id 1toDhD-0004PR-Ux
 for 76615 <at> debbugs.gnu.org; Fri, 28 Feb 2025 22:39:25 -0500
Received: from localhost (42-144-34-247.rev.home.ne.jp [42.144.34.247])
 by smtp1a.inetd.co.jp (Postfix) with ESMTPSA id D44DA5C;
 Sat,  1 Mar 2025 12:39:20 +0900 (JST)
From: Ikumi Keita <ikumi@HIDDEN>
In-reply-to: <uxsg7tplj2jbod.fsf@HIDDEN>
References: <uxsg7tplj2jbod.fsf@HIDDEN>
Comments: In-reply-to "Paul D. Nelson" <ultrono@HIDDEN>
 message dated "Fri, 28 Feb 2025 17:06:58 +0100."
X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 29.4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <55235.1740800359.1@localhost>
Date: Sat, 01 Mar 2025 12:39:19 +0900
Message-ID: <55236.1740800359@localhost>
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Paul,

>>>>> "Paul D. Nelson" <ultrono@HIDDEN> writes:
> Something like the attached, I guess?

Yes, that's what I thought.

> There are other uses of "reftex-" in style/, so I guess something
> similar should be done for all of them?

Ideally, yes. (But it seems tedious... Does anyone see possibility to
tame RefTeX to live along with non-file buffer?)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




Message sent to bug-auctex@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#76615: 14.0.9; error with amsmath style hooks
References: <uxsg7tcyf3nsws.fsf@HIDDEN>
Resent-From: "Paul D. Nelson" <ultrono@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Sat, 01 Mar 2025 07:35:02 +0000
Resent-Message-ID: <handler.76615.B76615.174081445129600 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 76615
X-GNU-PR-Package: auctex
X-GNU-PR-Keywords: 
To: Ikumi Keita <ikumi@HIDDEN>
Cc: arash@HIDDEN, 76615 <at> debbugs.gnu.org
Received: via spool by 76615-submit <at> debbugs.gnu.org id=B76615.174081445129600
          (code B ref 76615); Sat, 01 Mar 2025 07:35:02 +0000
Received: (at 76615) by debbugs.gnu.org; 1 Mar 2025 07:34:11 +0000
Received: from localhost ([127.0.0.1]:59880 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1toHMQ-0007hJ-92
	for submit <at> debbugs.gnu.org; Sat, 01 Mar 2025 02:34:11 -0500
Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:46293)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <ultrono@HIDDEN>) id 1toHMN-0007gT-8P
 for 76615 <at> debbugs.gnu.org; Sat, 01 Mar 2025 02:34:08 -0500
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5e4b410e48bso4306660a12.0
 for <76615 <at> debbugs.gnu.org>; Fri, 28 Feb 2025 23:34:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740814441; x=1741419241; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from:from:to
 :cc:subject:date:message-id:reply-to;
 bh=B8Tj/oAE4uZBKQQBHFGcWhgj5dWM7W0L/Ox0K1p0bzE=;
 b=JQpZYYBEmo5f145U12EN2G3ifp1X02/4huaDJY55osbriJH0Y4wxCyvqb/osPrcy1T
 wCRPqZowD9JObQXX9xgAsGCyaqAtLbCTQ5aZIRbMyKWUbSqXHxt6moGF7uGyOMZlHlCZ
 hddNldM8sVm5nGx0X9apn88Z7bmSWyriu6sVsZ42dozYVOenShCfN6Ije+ZM6J234gau
 UodIzl5LfOKO0mh8Q9WJy7j+Varspwl86dGCkhdDU3fV4ZxqZ4rBcvMzjU8Lv/ydRVcf
 D49zIOiubdVjcBJiiQbadhNMuS032vRV2EK3g3/F4w8VtCypLlyg9cRHgqlQ+KsVo+Ae
 o4pQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740814441; x=1741419241;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=B8Tj/oAE4uZBKQQBHFGcWhgj5dWM7W0L/Ox0K1p0bzE=;
 b=Ck8tXvOEfosr3+WDYvSc0aCZEv5MosU/XPQE0/h6kF+ob4h0HmECdAN6jtGSZQ67C+
 CDItdhZkFdiN790H9GGKO+SPUn7DuUqfSpEKR9BIZyAp4xq7DpiiqWKIm2Q7CHsd/ISd
 +RBp/jnnymZb+xwDuytpdEIY2dTGKl9sjcwwAAmoGThgY+7r6g6VWE0/xMeXzpLyK7Qe
 YfDGuJJcJ0sEx8XOVf/hm8Kfj74WSjn1LcZnDvhf3DE67+1LyobFjiVbUm4hIzfc7yIk
 ttyaCJF/E3fwJ3+2wjQK/pUZaeV52STFZ5v3F6YxafYEx0Tqpaob8aLcEEQpgns/DPyc
 eqlQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVWyjcC2DX6B0b9ThOreOgrWNwZnbS8r5ttEkMt/PD19c9CknEiEDtvI8DDBE4LdZqvrK+BnA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyY+2+PuiVsksVeRnWes3W6tAPx9+rXGpr+9YJIoJzHehgpl0pi
 cTN0j9DSlAkqELYSjv/bjkEHngOtFIMVkZwyDLOR5AURkd+5PDTb
X-Gm-Gg: ASbGncuhUKybo0bqRAEZW6ta8Wim00mUci7i+hzCkzxQjtYUgCZcTYpRVA02VZHtsku
 qF0cArAMy/TH4hshnfS8xB5kJvfCXxKU7NYMPAklavpSj82jvGSO1fEzv0vthz3W1NSRClWDvGj
 X8La1JMcHqSSD1zdatkRGDFRk2efzhshN0p2O+0+Oy+RmIMMDfsL0iKfx8c7sNWHqU23lM3B7vx
 Ps2G98iSsQR0jSy7IXu+PZcv1lnCseyq33Y0S3OPrAk//hCJzP2DTf+dXc5Ux+ExF2WJJWxYzq2
 Ukb73QdROc/Pfrmxn88fXFgRX+qrGq9gmq6WANWvNEaTOdeJobKiUvg3vd8oHEy4coVYlYzYO/c
 x5T5zUzjTJYA=
X-Google-Smtp-Source: AGHT+IHLsTbRZg6O/LdqVALkDFBGvQxKH3US1cwkKjXmUwqIY5BX4IhJIfRCXMjh4dgDwBNKQevosQ==
X-Received: by 2002:a05:6402:26ce:b0:5de:a6a8:5ebc with SMTP id
 4fb4d7f45d1cf-5e4d6ad41femr5775538a12.3.1740814440360; 
 Fri, 28 Feb 2025 23:34:00 -0800 (PST)
Received: from localhost (0x573d669a.static.cust.fastspeed.dk. [87.61.102.154])
 by smtp.gmail.com with UTF8SMTPSA id
 4fb4d7f45d1cf-5e4c3b4a81asm3612434a12.9.2025.02.28.23.33.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Feb 2025 23:33:59 -0800 (PST)
From: "Paul D. Nelson" <ultrono@HIDDEN>
In-Reply-To: <55236.1740800359@localhost> (message from Ikumi Keita on Sat,
 01 Mar 2025 12:39:19 +0900)
Date: Sat, 01 Mar 2025 08:33:57 +0100
Message-ID: <uxsg7tbjuljjbu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain


>> There are other uses of "reftex-" in style/, so I guess something
>> similar should be done for all of them?
>
> Ideally, yes. (But it seems tedious... Does anyone see possibility to
> tame RefTeX to live along with non-file buffer?)
>

Making RefTeX work well with non-file buffers always seemed to me like a
major undertaking.  The commands

;; reftex-add-index-macros
;; reftex-add-section-levels
;; reftex-add-label-environments
;; reftex-scanning-info-available-p
;; reftex-access-parse-file
;; reftex-access-scan-info
;; reftex-ref-style-list
;; reftex-ref-style-toggle
;; reftex-set-cite-format

each call reftex-tie-multifile-symbols, which in turn calls
reftex-TeX-master-file, which fails (with a hard landing) in a non-file
buffer for which TeX-master has not been set to a tex file.

The attached patch wraps the calls from style files to such functions
with a check for buffer-true-filename (although I would also prefer a
less tedious way to address the underlying issue).


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=changes.patch
Content-Description: changes

diff --git a/style/alphanum.el b/style/alphanum.el
index 318281b4..37ff8f8b 100644
--- a/style/alphanum.el
+++ b/style/alphanum.el
@@ -92,10 +92,11 @@
    ;; this won't work in multifile documents, but at least there is
    ;; something.
 
-   (if (fboundp 'reftex-add-section-levels)
-       (reftex-add-section-levels
-        '(("toc" .  reftex-get-section-level-alphanum)
-          ("sub" .  reftex-get-section-level-alphanum)))))
+   (when (and buffer-file-truename
+              (fboundp 'reftex-add-section-levels))
+     (reftex-add-section-levels
+      '(("toc" .  reftex-get-section-level-alphanum)
+        ("sub" .  reftex-get-section-level-alphanum)))))
  TeX-dialect)
 
 ;; Local Variables:
diff --git a/style/amsmath.el b/style/amsmath.el
index 9d6944dc..c73f7475 100644
--- a/style/amsmath.el
+++ b/style/amsmath.el
@@ -163,24 +163,25 @@
    (TeX-run-style-hooks "amstext" "amsbsy" "amsopn")
 
    ;; RefTeX support: Tell RefTeX about amsmath environments.
-   (when (fboundp 'reftex-add-to-label-alist)
-     (reftex-add-to-label-alist '(AMSTeX)))
-
-   ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e'
-   (when (and (boundp 'reftex-ref-style-alist)
-              ;; check if Emacs is already equipped with this
-              (not (assoc "AMSmath" reftex-ref-style-alist)))
-     ;; Append it to a local version in order to avoid a clash with
-     ;; user settings
-     (add-to-list (make-local-variable 'reftex-ref-style-alist)
-                  '("AMSmath" "amsmath" (("\\eqref" ?e)))
-                  t))
-
-   ;; Activate `AMSmath' when `LaTeX-reftex-ref-style-auto-activate'
-   ;; is non-nil
-   (and LaTeX-reftex-ref-style-auto-activate
-        (fboundp 'reftex-ref-style-activate)
-        (reftex-ref-style-activate "AMSmath"))
+   (when buffer-file-truename
+     (when (fboundp 'reftex-add-to-label-alist)
+       (reftex-add-to-label-alist '(AMSTeX)))
+
+     ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e'
+     (when (and (boundp 'reftex-ref-style-alist)
+                ;; check if Emacs is already equipped with this
+                (not (assoc "AMSmath" reftex-ref-style-alist)))
+       ;; Append it to a local version in order to avoid a clash with
+       ;; user settings
+       (add-to-list (make-local-variable 'reftex-ref-style-alist)
+                    '("AMSmath" "amsmath" (("\\eqref" ?e)))
+                    t))
+
+     ;; Activate `AMSmath' when `LaTeX-reftex-ref-style-auto-activate'
+     ;; is non-nil
+     (and LaTeX-reftex-ref-style-auto-activate
+          (fboundp 'reftex-ref-style-activate)
+          (reftex-ref-style-activate "AMSmath")))
 
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
diff --git a/style/beamer.el b/style/beamer.el
index fe1e4611..4afa2973 100644
--- a/style/beamer.el
+++ b/style/beamer.el
@@ -605,7 +605,8 @@ also be a string.  Then the length of the string is used."
     (insert LaTeX-title TeX-grcl)
     (LaTeX-newline)
     ;; If RefTeX is available, tell it that we've just made a new section
-    (and (fboundp 'reftex-notice-new-section)
+    (and buffer-file-truename
+         (fboundp 'reftex-notice-new-section)
          (reftex-notice-new-section))))
 
 (defvar LaTeX-beamer-class-options-list
diff --git a/style/biblatex.el b/style/biblatex.el
index 8b2c6b7a..c8d58740 100644
--- a/style/biblatex.el
+++ b/style/biblatex.el
@@ -672,7 +672,8 @@ for citation keys."
 
    ;; Tell RefTeX: If package option `natbib' is given, activate that
    ;; format, otherwise stick with `biblatex':
-   (when (and LaTeX-reftex-cite-format-auto-activate
+   (when (and buffer-file-truename
+              LaTeX-reftex-cite-format-auto-activate
               (fboundp 'reftex-set-cite-format))
      (if (or (LaTeX-provided-package-options-member "biblatex" "natbib")
              (LaTeX-provided-package-options-member "biblatex" "natbib=true"))
@@ -708,22 +709,22 @@ for citation keys."
    ;;; Preamble Options
    LaTeX-biblatex-executebibliographyoptions-options
    '(;;; Load-time Options
-    ("backend" ("biber" "bibtex" "bibtexu" "bibtex8"))
-    ("style" BibLaTeX-global-style-files)
-    ("bibstyle" BibLaTeX-global-style-files)
-    ("citestyle" BibLaTeX-global-style-files)
-    ("natbib" ("true" "false"))
-    ("mcite" ("true" "false"))
+     ("backend" ("biber" "bibtex" "bibtexu" "bibtex8"))
+     ("style" BibLaTeX-global-style-files)
+     ("bibstyle" BibLaTeX-global-style-files)
+     ("citestyle" BibLaTeX-global-style-files)
+     ("natbib" ("true" "false"))
+     ("mcite" ("true" "false"))
     ;;; Entry Options
-    ;; Preamble/Type/Entry Options
-    ("useauthor" ("true" "false"))
-    ("useeditor" ("true" "false"))
-    ("usetranslator" ("true" "false"))
-    ("useprefix" ("true" "false"))
-    ("indexing" ("true" "false" "cite" "bib"))
-    ;; Type/Entry Options are not available globally.
-    ;; Legacy Options (deprecated)
-    ("openbib")))
+     ;; Preamble/Type/Entry Options
+     ("useauthor" ("true" "false"))
+     ("useeditor" ("true" "false"))
+     ("usetranslator" ("true" "false"))
+     ("useprefix" ("true" "false"))
+     ("indexing" ("true" "false" "cite" "bib"))
+     ;; Type/Entry Options are not available globally.
+     ;; Legacy Options (deprecated)
+     ("openbib")))
   "Package options for the biblatex package.")
 
 (defun LaTeX-biblatex-package-options nil
diff --git a/style/breqn.el b/style/breqn.el
index f2784bf9..5b4db486 100644
--- a/style/breqn.el
+++ b/style/breqn.el
@@ -102,7 +102,8 @@ The keys \"label\" and \"labelprefix\" are omitted.")
    ;; dseries   == equation   -- dseries* == unnumbered
    ;; dgroup    == align      -- dgroup*  == unnumbered
    ;; darray    == eqnarray   -- darray*  == unnumbered
-   (when (fboundp 'reftex-add-label-environments)
+   (when (and buffer-file-truename
+              (fboundp 'reftex-add-label-environments))
      (dolist (env '("dmath" "dseries" "dgroup"))
        (reftex-add-label-environments `((,env ?e nil nil t))))
      (reftex-add-label-environments '(("darray" ?e nil nil eqnarray-like))))
diff --git a/style/cleveref.el b/style/cleveref.el
index 129d4ce1..ceed42d6 100644
--- a/style/cleveref.el
+++ b/style/cleveref.el
@@ -209,7 +209,8 @@ string."
                               'function))
 
    ;; Activate RefTeX reference style.
-   (and LaTeX-reftex-ref-style-auto-activate
+   (and buffer-file-truename
+        LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
         (reftex-ref-style-activate "Cleveref")))
  TeX-dialect)
diff --git a/style/empheq.el b/style/empheq.el
index 31c22eaf..ffbb8e92 100644
--- a/style/empheq.el
+++ b/style/empheq.el
@@ -252,7 +252,8 @@ number of ampersands if possible."
    (add-to-list 'LaTeX-item-list '("empheq" . LaTeX-empheq-item-equation) t)
 
    ;; Reftex support: Use `reftex-add-label-environments'
-   (when (fboundp 'reftex-add-label-environments)
+   (when (and buffer-file-truename
+              (fboundp 'reftex-add-label-environments))
      (reftex-add-label-environments '(("empheq" ?e nil nil t))))
 
    (TeX-add-symbols
@@ -398,7 +399,8 @@ number of ampersands if possible."
          (add-to-list 'LaTeX-label-alist `(,env . LaTeX-amsmath-label) t)))
 
      ;; RefTeX support: Add original definitions with `reftex-add-label-environments'
-     (when (fboundp 'reftex-add-label-environments)
+     (when (and buffer-file-truename
+                (fboundp 'reftex-add-label-environments))
        (reftex-add-label-environments
         '(("AmSalign"     ?e nil nil eqnarray-like)
           ("AmSequation"  ?e nil nil t)
diff --git a/style/exam.el b/style/exam.el
index 64179192..ee250dae 100644
--- a/style/exam.el
+++ b/style/exam.el
@@ -87,7 +87,8 @@ Arguments NAME and TYPE are the same as for the function
        (add-to-list 'LaTeX-label-alist
                     (cons env 'LaTeX-exam-label))
        ;; to RefTeX with `reftex-add-label-environments'
-       (when (fboundp 'reftex-add-label-environments)
+       (when (and buffer-file-truename
+                  (fboundp 'reftex-add-label-environments))
          (reftex-add-label-environments
           `((,env ,LaTeX-exam-reftex-quick-id-key ,LaTeX-exam-label
                   "~\\ref{%s}" nil
diff --git a/style/fancyref.el b/style/fancyref.el
index d2d87bf5..6b71a7cd 100644
--- a/style/fancyref.el
+++ b/style/fancyref.el
@@ -101,7 +101,8 @@
      (font-latex-add-keywords '(("fref" "[{") ("Fref" "[{")) 'reference))
 
    ;; Activate RefTeX reference style.
-   (and LaTeX-reftex-ref-style-auto-activate
+   (and buffer-file-truename
+        LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
         (reftex-ref-style-activate "Fancyref")))
  TeX-dialect)
diff --git a/style/harvard.el b/style/harvard.el
index 36e2e471..431e72b5 100644
--- a/style/harvard.el
+++ b/style/harvard.el
@@ -101,7 +101,8 @@
                LaTeX-item-list))
 
    ;; Tell RefTeX
-   (when (and LaTeX-reftex-cite-format-auto-activate
+   (when (and buffer-file-truename
+              LaTeX-reftex-cite-format-auto-activate
               (fboundp 'reftex-set-cite-format))
      (reftex-set-cite-format 'harvard)))
  TeX-dialect)
diff --git a/style/hyperref.el b/style/hyperref.el
index 868acd33..03f7575f 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -341,7 +341,8 @@
          (TeX-run-style-hooks "backref"))))
 
    ;; Activate RefTeX reference style.
-   (and LaTeX-reftex-ref-style-auto-activate
+   (and buffer-file-truename
+        LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
         (reftex-ref-style-activate "Hyperref")))
  TeX-dialect)
diff --git a/style/imakeidx.el b/style/imakeidx.el
index 0d6a626c..ae0efce5 100644
--- a/style/imakeidx.el
+++ b/style/imakeidx.el
@@ -93,7 +93,8 @@
          (append
           '(("|see{\\([^{}\n\r]*\\)" 1 LaTeX-index-entry-list))
           TeX-complete-list))
-   (and (fboundp 'reftex-add-index-macros)
+   (and buffer-file-truename
+        (fboundp 'reftex-add-index-macros)
         (reftex-add-index-macros '(default)))
 
    ;; Fontification
diff --git a/style/index.el b/style/index.el
index 1e5657e6..9e370fad 100644
--- a/style/index.el
+++ b/style/index.el
@@ -75,7 +75,8 @@
           TeX-complete-list))
 
    ;; RefTeX support
-   (and (fboundp 'reftex-add-index-macros)
+   (and buffer-file-truename
+        (fboundp 'reftex-add-index-macros)
         (reftex-add-index-macros '(index))))
  TeX-dialect)
 
diff --git a/style/jurabib.el b/style/jurabib.el
index 0aa6966d..532a3cfa 100644
--- a/style/jurabib.el
+++ b/style/jurabib.el
@@ -153,7 +153,8 @@
                                 'variable))
 
      ;; Tell RefTeX (Thanks, Carsten)
-     (when (and LaTeX-reftex-cite-format-auto-activate
+     (when (and buffer-file-truename
+                LaTeX-reftex-cite-format-auto-activate
                 (fboundp 'reftex-set-cite-format))
        ;; Check if RefTeX supports jurabib.
        (if (assoc 'jurabib reftex-cite-format-builtin)
diff --git a/style/listings.el b/style/listings.el
index e03b8216..4738d687 100644
--- a/style/listings.el
+++ b/style/listings.el
@@ -349,7 +349,8 @@
                                       (LaTeX-extract-key-value-label))
                              1 LaTeX-auto-label))
       ;; Tell RefTeX
-      (when (fboundp 'reftex-add-label-environments)
+      (when (and buffer-file-truename
+                 (fboundp 'reftex-add-label-environments))
         (reftex-add-label-environments
          `((,env ?l "lst:" "~\\ref{%s}"
                  LaTeX-keyval-caption-reftex-context-function
@@ -431,7 +432,8 @@
    ;; RefTeX support lstlistings environment via
    ;; `reftex-label-alist-builtin'.  We add the same thing here only
    ;; with our function as 5th element:
-   (when (fboundp 'reftex-add-label-environments)
+   (when (and buffer-file-truename
+              (fboundp 'reftex-add-label-environments))
      (reftex-add-label-environments
       '(("lstlisting" ?l "lst:" "~\\ref{%s}"
          LaTeX-keyval-caption-reftex-context-function
diff --git a/style/makeidx.el b/style/makeidx.el
index 680a16b7..0f7bbb3e 100644
--- a/style/makeidx.el
+++ b/style/makeidx.el
@@ -45,7 +45,8 @@
           TeX-complete-list))
 
    ;; RefTeX support
-   (and (fboundp 'reftex-add-index-macros)
+   (and buffer-file-truename
+        (fboundp 'reftex-add-index-macros)
         (reftex-add-index-macros '(default)))
 
    ;; Fontification
diff --git a/style/mathtools.el b/style/mathtools.el
index 853093d3..55039731 100644
--- a/style/mathtools.el
+++ b/style/mathtools.el
@@ -145,7 +145,8 @@
                    `(,env . LaTeX-item-equation) t)
       (add-to-list 'LaTeX-label-alist
                    `(,env . LaTeX-amsmath-label) t)
-      (when (fboundp 'reftex-add-label-environments)
+      (when (and buffer-file-truename
+                 (fboundp 'reftex-add-label-environments))
         (reftex-add-label-environments `((,env ?e nil nil t)))))))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-mathtools-auto-prepare t)
@@ -473,7 +474,8 @@ Put line break macro on the last line.  Next, insert an ampersand."
                  LaTeX-label-alist))
 
    ;; RefTeX support: Add env's with `reftex-add-label-environments'
-   (when (fboundp 'reftex-add-label-environments)
+   (when (and buffer-file-truename
+              (fboundp 'reftex-add-label-environments))
      (let ((envs '(("lgathered"  ?e nil nil t)
                    ("rgathered"  ?e nil nil t)
                    ("multlined"  ?e nil nil t))))
diff --git a/style/minted.el b/style/minted.el
index 655e9a4f..94a2aa1a 100644
--- a/style/minted.el
+++ b/style/minted.el
@@ -440,7 +440,8 @@ a list of strings."
      (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
                   '("listing" current-indentation) t)
      (add-to-list 'LaTeX-label-alist '("listing" . LaTeX-listing-label) t)
-     (when (fboundp 'reftex-add-label-environments)
+     (when (and buffer-file-truename
+                (fboundp 'reftex-add-label-environments))
        (reftex-add-label-environments
         '(("listing" ?l "lst:" "~\\ref{%s}" caption nil nil)))))
 
diff --git a/style/minted2.el b/style/minted2.el
index 687b195c..08ddcc09 100644
--- a/style/minted2.el
+++ b/style/minted2.el
@@ -421,7 +421,8 @@ a list of strings."
      (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
                   '("listing" current-indentation) t)
      (add-to-list 'LaTeX-label-alist '("listing" . LaTeX-listing-label) t)
-     (when (fboundp 'reftex-add-label-environments)
+     (when (and buffer-file-truename
+                (fboundp 'reftex-add-label-environments))
        (reftex-add-label-environments
         '(("listing" ?l "lst:" "~\\ref{%s}" caption nil nil)))))
 
diff --git a/style/multind.el b/style/multind.el
index a4e921bd..0bad853b 100644
--- a/style/multind.el
+++ b/style/multind.el
@@ -59,7 +59,8 @@
           TeX-complete-list))
 
    ;; RefTeX support
-   (and (fboundp 'reftex-add-index-macros)
+   (and buffer-file-truename
+        (fboundp 'reftex-add-index-macros)
         (reftex-add-index-macros '(multind)))
 
    ;; Fontification
diff --git a/style/natbib.el b/style/natbib.el
index e04de458..f08565d0 100644
--- a/style/natbib.el
+++ b/style/natbib.el
@@ -168,7 +168,8 @@
                               'function))
 
    ;; Tell RefTeX
-   (when (and LaTeX-reftex-cite-format-auto-activate
+   (when (and buffer-file-truename
+              LaTeX-reftex-cite-format-auto-activate
               (fboundp 'reftex-set-cite-format))
      (reftex-set-cite-format 'natbib)))
  TeX-dialect)
diff --git a/style/newfloat.el b/style/newfloat.el
index e3824a82..2fff45b4 100644
--- a/style/newfloat.el
+++ b/style/newfloat.el
@@ -117,13 +117,15 @@ If `caption.el' is loaded, add the new floating environment to
       (cond ((string-equal type "figure")
              (LaTeX-add-environments `(,flt LaTeX-env-figure))
              (add-to-list 'LaTeX-label-alist `(,flt . LaTeX-figure-label) t)
-             (when (fboundp 'reftex-add-label-environments)
+             (when (and buffer-file-truename
+                      (fboundp 'reftex-add-label-environments))
                (reftex-add-label-environments
                 `((,flt ?f ,LaTeX-figure-label "~\\ref{%s}" caption nil nil)))))
             ((string-equal type "table")
              (LaTeX-add-environments `(,flt LaTeX-env-figure))
              (add-to-list 'LaTeX-label-alist `(,flt . LaTeX-table-label) t)
-             (when (fboundp 'reftex-add-label-environments)
+             (when (and buffer-file-truename
+                      (fboundp 'reftex-add-label-environments))
                (reftex-add-label-environments
                 `((,flt ?t ,LaTeX-table-label "~\\ref{%s}" caption nil nil)))))
             ((string-equal type "verbatim")
@@ -131,7 +133,8 @@ If `caption.el' is loaded, add the new floating environment to
              (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
                           `(,flt current-indentation) t)
              (add-to-list 'LaTeX-label-alist `(,flt . LaTeX-listing-label) t)
-             (when (fboundp 'reftex-add-label-environments)
+             (when (and buffer-file-truename
+                      (fboundp 'reftex-add-label-environments))
                (reftex-add-label-environments
                 `((,flt ?l "lst:" "~\\ref{%s}" caption nil nil)))))
             (t
diff --git a/style/subcaption.el b/style/subcaption.el
index 4ae2975d..2c6e98c5 100644
--- a/style/subcaption.el
+++ b/style/subcaption.el
@@ -215,7 +215,8 @@ outer-pos adjusted."
    (add-to-list 'LaTeX-label-alist '("subtable" . LaTeX-table-label) t)
 
    ;; Introduce env's to RefTeX if loaded
-   (when (fboundp 'reftex-add-label-environments)
+   (when (and buffer-file-truename
+              (fboundp 'reftex-add-label-environments))
      (reftex-add-label-environments
       `(("subfigure" ?f ,LaTeX-figure-label "~\\ref{%s}" caption)
         ("subtable"  ?t ,LaTeX-table-label  "~\\ref{%s}" caption))))
diff --git a/style/varioref.el b/style/varioref.el
index e7f95f7f..4c9ffb26 100644
--- a/style/varioref.el
+++ b/style/varioref.el
@@ -88,7 +88,8 @@
                               'reference))
 
    ;; Activate RefTeX reference style.
-   (and LaTeX-reftex-ref-style-auto-activate
+   (and buffer-file-truename
+        LaTeX-reftex-ref-style-auto-activate
         (fboundp 'reftex-ref-style-activate)
         (reftex-ref-style-activate "Varioref")))
  TeX-dialect)

--=-=-=--




Message sent to bug-auctex@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#76615: 14.0.9; error with amsmath style hooks
Resent-From: Ikumi Keita <ikumi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Sat, 01 Mar 2025 18:02:01 +0000
Resent-Message-ID: <handler.76615.B76615.174085211021139 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 76615
X-GNU-PR-Package: auctex
X-GNU-PR-Keywords: 
To: "Paul D. Nelson" <ultrono@HIDDEN>
Cc: arash@HIDDEN, 76615 <at> debbugs.gnu.org
Received: via spool by 76615-submit <at> debbugs.gnu.org id=B76615.174085211021139
          (code B ref 76615); Sat, 01 Mar 2025 18:02:01 +0000
Received: (at 76615) by debbugs.gnu.org; 1 Mar 2025 18:01:50 +0000
Received: from localhost ([127.0.0.1]:43188 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1toR9p-0005Uo-J6
	for submit <at> debbugs.gnu.org; Sat, 01 Mar 2025 13:01:50 -0500
Received: from smtp1a.inetd.co.jp ([210.129.88.11]:40196)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ikumi@HIDDEN>)
 id 1toR9k-0005Tw-GU
 for 76615 <at> debbugs.gnu.org; Sat, 01 Mar 2025 13:01:47 -0500
Received: from localhost (42-144-34-247.rev.home.ne.jp [42.144.34.247])
 by smtp1a.inetd.co.jp (Postfix) with ESMTPSA id 0FE885C;
 Sun,  2 Mar 2025 03:01:41 +0900 (JST)
From: Ikumi Keita <ikumi@HIDDEN>
In-reply-to: <uxsg7tbjuljjbu.fsf@HIDDEN>
References: <uxsg7tbjuljjbu.fsf@HIDDEN>
Comments: In-reply-to "Paul D. Nelson" <ultrono@HIDDEN>
 message dated "Sat, 01 Mar 2025 08:33:57 +0100."
X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 29.4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <57867.1740852100.1@localhost>
Date: Sun, 02 Mar 2025 03:01:40 +0900
Message-ID: <57868.1740852100@localhost>
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Paul,

>>>>> "Paul D. Nelson" <ultrono@HIDDEN> writes:
> Making RefTeX work well with non-file buffers always seemed to me like a
> major undertaking.  The commands

> ;; reftex-add-index-macros
> ;; reftex-add-section-levels
> ;; reftex-add-label-environments
> ;; reftex-scanning-info-available-p
> ;; reftex-access-parse-file
> ;; reftex-access-scan-info
> ;; reftex-ref-style-list
> ;; reftex-ref-style-toggle
> ;; reftex-set-cite-format

> each call reftex-tie-multifile-symbols, which in turn calls
> reftex-TeX-master-file, which fails (with a hard landing) in a non-file
> buffer for which TeX-master has not been set to a tex file.

Is `reftex-TeX-master-file' the only source of RefTeX non-file buffer
difficulties? If so, I expect there is a possibility that we can amend
it so that RefTeX would not stumble in non-file buffer. For example,
`TeX-master-file' returns "<none>.tex" if it can't find a sensible
master file. What if we implement similar fallback for
`reftex-TeX-master-file'?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW





Last modified: Sat, 1 Mar 2025 18:15:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.