diff options
| author | Erik Martin-Dorel | 2020-04-10 11:49:27 +0200 |
|---|---|---|
| committer | GitHub | 2020-04-10 11:49:27 +0200 |
| commit | e85e58415f6849b5dd692908cc2ea85d409f9354 (patch) | |
| tree | e83fe639d71578ec3dfd4c08d74cf9566ffe2342 | |
| parent | 4dba3f78e50604d899ef80bfda45c5aa4467adeb (diff) | |
| parent | 8b9c985c4efdb4579338bbae28a651974e31419c (diff) | |
Merge pull request #480 from CyrilAnac/master
feat(coq-insert-intros): Conditionally insert `move=>` or `intros`
| -rw-r--r-- | coq/coq.el | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -2502,17 +2502,21 @@ mouse activation." (progn (end-of-line) (point))))))) (insert (concat "End" section))))) + (defun coq--format-intros (output) - "Create an “intros” form from the OUTPUT of “Show Intros”." + "Create an “intros” or ”move” form from the OUTPUT of “Show Intros”." (let* ((shints1 (replace-regexp-in-string "^[0-9] subgoal\\(.\\|\n\\|\r\\)*" "" output)) (shints (replace-regexp-in-string "[\r\n ]*\\'" "" shints1))) (if (or (string= "" shints) (string-match coq-error-regexp shints)) (error "Don't know what to intro") - (format "intros %s" shints)))) + (save-excursion + (if (re-search-backward "Require.*ssreflect" nil t) + (format "move=> %s" shints) + (format "intros %s" shints)))))) (defun coq-insert-intros () - "Insert an intros command with names given by Show Intros. + "Insert an intros or move command with names given by Show Intros. Based on idea mentioned in Coq reference manual." (interactive) (let* ((output (proof-shell-invisible-cmd-get-result "Show Intros."))) |
