Skip to content

Coq system - #915

Merged
Matafou merged 7 commits into
ProofGeneral:masterfrom
Matafou:coq-system
Nov 6, 2026
Merged

Matafou merged 7 commits into
ProofGeneral:masterfrom
Matafou:coq-system

Conversation

@Matafou

@Matafou Matafou commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Coq: file variables for the Coq program, and cleanup of coq-system.el

  • Fix: a file or directory variable coq-prog-name was ignored. The Coq program detected when Coq starts replaced it, and the same happened to coq-compiler and coq-dependency-analyzer.
    • Cause: coq--user-set-p only recognized customized options, and coq-pg-setup copied coq-prog-name to proof-prog-name before the file variables are applied.
    • Buffer-local values now count as set by the user. A program given with proof-prog-name-ask still has priority.
  • Tests first (coq-test-file-variables.el), freezing the current behavior:
    • file and directory variables override the project file, variable by variable;
    • the Coq program is detected by default, and kept when it is asked or customized.
  • Cleanup:
    • The version tests (coq--post-vXX, coq--pre-vXX) are factored, with no change (checked on 25 versions). Their error handling was dead code.
    • coq--post-v809 compared with 8.10 instead of 8.9. It is only used by a test.
    • coq-detect-rocq-cli is cached per command, remote host and exec-path. It ran the Coq program on every call, several times at load and at each start of Coq.
    • The unused round trip checks of the project options become an ERT test (coq-test-system.el).
    • The unused deprecated options coq-use-makefile and coq-pre-v85 are removed.

Tested on rocq-9.2, rocq-9.0 and coq-8.20, interpreted and compiled.

Matafou and others added 7 commits November 6, 2026 17:55
Freeze the current behavior: file and directory variables have priority
over the project file for coq-load-path and coq-prog-args, one by one;
coq-pg-detect-programs detects the Coq program by default and keeps
the one asked (proof-prog-name-ask) or customized.  Coq is not started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
coq-pg-detect-programs, run just before starting Coq, replaced them by
the detected programs: coq--user-set-p only recognized customized
options, and proof-prog-name was copied from coq-prog-name by
coq-pg-setup, before the file variables are set.  coq--user-set-p now
also recognizes buffer-local values (file and directory variables), and
coq-pg-detect-programs copies a buffer-local coq-prog-name to
proof-prog-name, unless proof-prog-name-ask asked it.  As for a
customized coq-prog-name, the compiler and coqdep are then looked for
in its directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New coq--version-at-least and coq--version-before; the coq--post-vXX
and coq--pre-vXX become one-liners with the same thresholds and
defaults.  Their condition-case was dead code: coq--version< already
returns nil on invalid versions.  Checked identical on 25 versions,
invalid ones included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It is used only by a test of omit proofs, skipped before Coq 8.9
(#[local] hints).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
coq-detect-rocq-cli runs the Coq program each time, and it is called
several times at load time and before each start of Coq (to detect
coqc, coqdep, and their arguments).  Cache its result per command,
remote host of default-directory and exec-path (which changes with the
opam switch, for example).  A command that cannot be run is not
cached.  The result is now t instead of a match position.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
coq--options-test-roundtrips and its helpers, in coq-system.el, printed
the checks in a buffer and were called by nobody.  They become the ERT
test coq-test-system-options-roundtrip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both were deprecated and read by nobody.  The comment "DEAD CODE?" on
coq-prog-env is wrong: it is also defined by defpgcustom in
pg-custom.el, and passed to the Coq process by Proof General.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Matafou
Matafou merged commit 7922429 into ProofGeneral:master Nov 6, 2026
140 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant