Open zacque0 opened 2 years ago
Good point. IMHO the idea is either you have a _CoqProject file either you set coq-prog-args
because implicitly coq-prog-args
is mainly for setting the load-path.
For user options you should probably use coq-user-init-cmd
for user preferences like this.
If we stick to this policy we should probably document it.
Hmmm, but coq-user-init-cmd
is defined as a constant, not a custom variable... That's why I'm not aware of it in the M-x customize-group
options.
Indeed it is a bit rough at the edges. We need to make this easier to set up. Especially because dune is also coming in the game and we probably will have more use case like yours.
Okay, not sure how is that relevant to my issue.
Anyways, my workaround solution is to place user-wide configuration into ~/.coqrc
.
As for this issue, I'll leave it open since it's unsolved. Thanks!
Agreed, this needs a proper and documented solution.
Hi,
Problem description: As per title.
Steps to reproduce:
coq-prog-args
to some values. E.g.(setq coq-prog-args '("-set" "Printing Parentheses"))
.M-x proof-shell-start
, orC-c C-s
bound toproof-toggle-active-scripting
.coq-prog-args
is now set to("-emacs")
.Problem diagnosis:
Function
coq-prog-args
is run right before everyproof-shell-start
. https://github.com/ProofGeneral/PG/blob/ec4f9bad18f6c8336e53910d3ea941d5ceb52f52/coq/coq-system.el#L659-L667In
coq-prog-args
, the functioncoq-load-project-file
fails to detectcoq-load-args
fromfile-local-variables-alist
. https://github.com/ProofGeneral/PG/blob/ec4f9bad18f6c8336e53910d3ea941d5ceb52f52/coq/coq-system.el#L626-L627Indeed, in any newly opened Coq file, the
file-local-variables-alist
isnil
.So, now, if I
M-x eval-expression
, then(push (cons 'coq-prog-args coq-prog-args) file-local-variables-alist)
and starts the proof-shell. Everything works as expected.But then now the variable
coq-prog-args
is modified to custom value specified for the current file and Coq project. And if I stop and start the proof-shell again, the same file-specific arguments will be appended tocoq-prog-args
again and again.I haven't found out which function does that. But maybe it should work on the file-local
coq-prog-args
value and not the user-defined one...Summary: There are two things gone wrong here:
coq-prog-args
, but it fails.coq-prog-args
instead. This is surprising to the user, because custom variable should only be modifiable by the user. Perhaps storing the computed arguments ascoq-computed-args
into thefile-local-variables-alist
would solve the problem(?).Thanks!
Environment: Using Coq v8.15.1 Melpa version:
proof-general-20220610.705
. Variable value ofproof-general-version
: "Proof General Version 4.5-git."