(setq coq-prog-name “/usr/bin/coqtop”) maybe? That variable should contain the path of the binary, not the command line. Also, are you on macOS? If so, look into exec-path-from-shell.
But if you can’t find coqtop in the terminal, I think the problem isn’t with Emacs — how did you install coq? Did you install it as a macOS app? If so, the path is a bit different — something like /Applications/…/Contents/MacOS/… maybe?
I’m on mac too, actually, and had the same problem. You have to right click on coqide and click open application content, you’ll then find coqtop and all the executable stuff in resources/bin or something like that if my memory is good (at least there should be a bin folder containing all executable files somewhere in there).
You can add those to your path for next uses. Actually, I advise you to download everything with OPAM to get latest releases and be able to use mac shortcuts for some symbols.
What brought me here was that I was using vs-code (How to set the coq path for vscode (how to find coqtop)? · Issue #243 · coq-community/vscoq · GitHub) and it couldn’t find the path since I didn’t have it installed. The dmg didn’t work so I installed it with opam and now vs-code was able to find coqtop by itself once I installed it with opam. Perhaps that is your issue. This is how I installed it with opam:
(base) miranda9@Brandos-MBP bin % which coqtop
/Users/miranda9/.opam/qcert-env/bin/coqtop
if you do not have coq install then install it. For me installing it with an opam switch <COMPILER> version and pinning it to that compiler/switch worked nicely and kept my “opam env” organized. Pheraps you should do that. For that check my previous comment here: Coqtop not found - #8 by brando90
then if you .emacs file copy:
(setq coq-prog-name “/usr/bin/coqtop -emacs”)
you probably have to restart emacs.
(note for vscode make sure you install coq with opam and restard vscode worked for me)
You shouldn’t put -emacs in coq-prog-name, and these quotes should be straight, not curvy: (setq coq-prog-name "/usr/bin/coqtop"). But since /usr/bin is typically already in your path, there’s no point in adding that line (and, since you’re installing from OPAM, that’s not actually the right path)