diff options
| author | cyrilzak31 | 2020-04-09 15:55:46 +0200 |
|---|---|---|
| committer | Cyril Anaclet | 2020-04-10 11:43:23 +0200 |
| commit | 8b9c985c4efdb4579338bbae28a651974e31419c (patch) | |
| tree | b98c127ed6a73bbcdf92900bb0b3a1f633667672 | |
| parent | 1f56706ff2f0870a461ded0f5a40292df8bcd96a (diff) | |
Close #479
| -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."))) |
