See Proof General and scrupulously do as described at https://proofgeneral.github.io/download/. Using Melpa is the best way to go.
Here is a relevant fragment of the lecturer’s .emacs file
in his Devuan-powered computers:
(require 'package)
; (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") ;; for Version 26.1 of Emacs
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
; Please there be 3 windows no matter the size of the screen:
(setq proof-three-window-mode-policy 'hybrid)
in his aging Ubuntu-powered computer:
;;;;;;;;;;
;;; the Coq Proof Assistant:
(setq auto-mode-alist (cons '("\\.v$" . coq-mode) auto-mode-alist))
;; (autoload 'coq-mode "gallina" "Major mode for editing Coq vernacular." t)
(setq coq-prog-name "~/coq-8.8.0/bin/coqtop")
;;;;;;;;;;
;;; Proof General
;; Open .v files with Proof General's Coq mode
(load "~/.emacs.d/lisp/PG/generic/proof-site")
(setq proof-three-window-mode-policy 'hybrid)
;;;;;;;;;;
in his MacBook at work:
(setq load-path (cons "/Users/danvy/.emacs.d/lisp" load-path))
(load "~/.emacs.d/lisp/PG/generic/proof-site")
Upon opening a .v file, Prool General’s welcome banner is displayed for a few seconds. (If one is in a hurry, one can type C-l to see the content of one’s .v file straight away.)
In the top bar, of relevance are the Next button (C-c C-n) and the Undo button (C-c C-u) that process the next syntactic unit in the file (comment, command, declaration, tactic, etc.). The first time C-c C-n is issued, the Coq Proof Assistant is started, and 3 windows appear.
The Use button corresponds to issuing C-c C-n repeatedly until the end of the file.
If one’s cursor lies in the middle of the file, clicking on the Goto button (C-c C-return) makes the Coq Proof Assistant process the file until the cursor. (Reminder: return is the enter key.)
This being Emacs, typing C-x 2 splits the current window horizontally, which is useful to have 2 views of the same file.
More generally, typing C-h k invites one to type a key to then read a description of its effect. So for example, typing C-c C-l then tells us that “C-c C-l refresh[es] the display of windows according to the current display mode”.
Suggestions:
Pablito: Lemme type C-h k and then C-h k...Mimer: That’s the spirit, Pablito!
Created [15 Jan 2024]