aboutsummaryrefslogtreecommitdiff
path: root/generic
AgeCommit message (Collapse)Author
2021-04-16omit proofs: emit warning on nested proofs and continueHendrik Tews
2021-04-16prefix arg for temporarily disabling omitting proofsHendrik Tews
Make proof-goto-point and proof-process-buffer prefix argument aware. With argument, both commands temporarily switch off proof-omit-proofs-option, such that all proofs are completely processed for one particular invocation.
2021-04-16add feature to omit complete opaque proofsHendrik Tews
This commit adds a feature to recognize complete opaque proofs in the asserted region and to replace them with an admitted proof. This can drastically improve the processing time for the asserted region at the cost of not checking the omitted proofs. Omitted proofs are displayed slightly darker compared to other parts of the locked region. With this commit, the feature is supported for Coq for files in which proofs are started with some form of Proof and ended with either Qed, Defined, Admitted or Abort. To enable, configure proof-omit-proofs-option or click Proof General -> Quick Options -> Processing -> Omit Proofs.
2021-03-17Remove evaluate-elisp-comment-regexp and set-elisp-variable-regexpClément Pit-Claudel
Closes GH-557.
2021-02-25refactor: Simplify proof-upgrade-elpa-packagesErik Martin-Dorel
* Lastly, package-menu-async keeps its initial value even if we C-g.
2021-02-25$ make autoloadsErik Martin-Dorel
2021-02-25feat(proof-upgrade-elpa-packages): autoloadErik Martin-Dorel
2021-02-25feat: Add proof-upgrade-menu triggering proof-upgrade-elpa-packagesErik Martin-Dorel
* require package.el (in a safe way thanks to `proof-try-require`)
2021-01-31fix typos and unicode single quotations in doc stringsHendrik Tews
Backported those typos that were fixed only in the manual texi sources and not in the doc strings, from which the text was imported. Convert a few symbols quoted with curved unicode single quotations to ascii, such that make magic recognizes them.
2021-01-31fix make magic problem from 2017Hendrik Tews
After 574b09 92e3cb4b7a4ad88400b9a5ab0198a96ca5, make magic fails with a recursive require chain. No requires were changed in that commit, it's unclear to me, why there is no recursive require chain with (eval-when (compile).
2020-06-18Use `proof-shell-string-match-safe` to avoid failing on `nil` regexpPhilipp G. Haselwarter
Fixes a regression introduced in 22681a3caf2c8f45700585ea74dffbf48bb2ac19. In particular, the Coq module seems to be the only one currently setting `proof-show-proof-diffs-regexp`, causing an error for EasyCrypt.
2020-06-04New hook for early prompt/output analyzis.Pierre Courtieu
proof-state-change-pre-hook happens earlier than proof-state-change-hook, i.e. before proof-done-advancing. This should be used to register information in the currently processed span before proof-done-advancing classifies it. Historically PG design was to gather these information during proof-done-advancing (or in its hook called at the end) by just looking at the command statement. But it is often useful to look at the output (messages and/or prompt) to gather more accurate information. Some of this information may be needed DURING proof-done-advancing. Hence this early hook.
2020-05-29fix: backtrack for "Show Proof" disabledAnaclet
2020-05-29fix: backtrack wrong type argumentAnaclet
2020-05-29Apply reviews of @erikmdCyril Anaclet
2020-05-29WIP for #487Cyril Anaclet
2020-05-29Fix name clash & rephrase some stringsErik Martin-Dorel
2020-05-29All case for Show and regex variableCyril Anaclet
2020-05-28Fix default value for proof-shell-last-cmd-left-goals-p.Pierre Courtieu
This variable was still not used anywhere, but will soon.
2020-05-27Add proof-shell-last-cmd-left-goals-p.Pierre Courtieu
Prover specific analyzis of the last prompt/output to determine if there are open goals left.
2020-04-16Fix hide/show proof.Pierre Courtieu
Bug described by @MdeLv at: https://github.com/coq/coq/issues/12088#issuecomment-613266520
2020-04-15Span menu entry for proof using annotation + doc.Pierre Courtieu
2020-04-10Fixed proof using annotation mechanism.Pierre Courtieu
I ended up using (in a slight devious way) the lemma dependency mechanism of PG: the dependency information stored in the span is only the ones suggested by coq: only the one that should appear in theproof using annotation (and only when coq felt the need to suggest them.
2020-03-13Fix 464: proof-autoloads not found by EmacsPierre Courtieu
2020-01-31faces: Extend highlights to EOL to adjust for latest Emacs changesClément Pit-Claudel
2019-06-18Remove pghelp spans when retracting.Pierre Courtieu
Due to performance issue (probably an emacs bug) and given the uselessness of the pghelp spans in retracted regions. We simply remove these spans when retracting. The question remains to remove them completely or to make them more useful. company-coq currently disables them anyway.
2019-06-03Process tags in the buffer rather than in stringsJim Fehrle
2019-06-01Add hook for coq diff-highlighting routineJim Fehrle
2019-05-31Remove stray hTej Chajed
Fixes #424
2019-05-31* coq/coq-diffs.el (coq-insert-tagged-text): Rework to avoid `aset`Stefan Monnier
(coq-insert-with-face): Don't assume we're at EOB. * generic/pg-goals.el (pg-goals-display): Use with-current-buffer. * generic/pg-response.el (pg-response-maybe-erase): Narrow the scope of inhibit-read-only. (pg-response-display-with-face): Use `member`. Remove unused var `end`. Only bind `start` when we have a value for it. (proof-trace-buffer-display): Use with-current-buffer.
2019-05-16proof-syntax.el: Fix an out-of-range bug in function `proof-format'Erik Martin-Dorel
This bug seems to date from the generalization performed in commit: 080babbb0f361885e9b502ee56dec14351104a37
2019-05-16proof-assistant-format: Support format character "%l" a.k.a. lambdaErik Martin-Dorel
This patch allows one to load the `coq-diffs' option at Coq startup, provided the ambient Coq version is >= 8.10. This additional "lambda" format is needed because [Set Diffs "on".] is neither: - a boolean setting from Coq side (there are three possible values) - a string setting from Emacs side (it is implemented as a radio/symbol option) - a cross-version compatible Coq setting.
2019-05-16Highlight diffs in goals and some error messagesJim Fehrle
using Coq's proof diffs feature.
2019-04-18Derive proof-mode from prog-modeBenjamin Barenblat
prog-mode [1] is the base mode for programming that comes with Emacs: “All major modes for programming languages should derive from this mode so that users can put generic customization on prog-mode-hook.” Make proof-mode derive from prog-mode, reflecting its status as a programming mode. [1] https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/prog-mode.el?id=a18336a8dc754fa1c68e16dd8009466cf409271b
2019-01-12* pg-init.el: Add subdirs during compilation (bug #413)Stefan Monnier
* generic/pg-user.el (proof-add-completions): `proof-assistant` can also be the empty string :-(
2018-12-26Make coq-mode work without generic/proof-*Stefan Monnier
Revise the various `require`s to avoid spurious dependencies, and tweak the code here and there to eliminate the remaining dependencies. * coq/coq-db.el: Don't require proof-config nor proof-syntax. (coq-build-opt-regexp-from-db): Avoid proof-regexp-alt-list. * coq/coq-indent.el: Use lexical-binding. Don't require coq-syntax. Comment out all the code that's not used any more. (coq-empty-command-p): Use forward-comment instead of coq-find-not-in-comment-backward. Fix paren typos. (coq-script-parse-cmdend-forward, coq-script-parse-cmdend-backward): Use forward-comment i.s.o proof-script-generic-parse-find-comment-end. Use syntax-ppss i.s.o proof-buffer-syntactic-context. (coq-find-current-start): Explicit case-fold-search i.s.o proof-looking-at. * coq/coq-mode.el (coq-mode): Set comment-start/end. * coq/coq-smie.el: Require coq-syntax explicitly. (coq-smie-detect-goal-command, coq-smie-module-deambiguate): Explicit case-fold-search i.s.o proof-looking-at. (coq-indent-basic): New custom var. (coq-smie-rules): Use it in case PG is not loaded. * coq/coq-syntax.el: Don't require proof-syntax, proof-utils, and span. (coq-goal-command-p): Use overlay-get i.s.o span-property. (coq-save-command-regexp-strict, coq-save-command-regexp): Use \` and regexp-opt i.s.o proof-anchor-regexp and proof-ids-to-regexp. (coq-save-command-p): Explicit case-fold-search i.s.o proof-string-match. (coq--regexp-alt-list-symb): Rename from proof-regexp-alt-list-symb. Use mapconcat i.s.o proof-regexp-alt-list. (coq-save-with-hole-regexp): Use regexp-opt i.s.o proof-regexp-alt-list. (coq-goal-command-regexp, coq-goal-with-hole-regexp) (coq-decl-with-hole-regexp, coq-defn-with-hole-regexp) (coq-font-lock-keywords-1): Use mapconcat i.s.o proof-regexp-alt-list. (coq-find-first-hyp, coq-detect-hyps-positions-in-goals): Use current buffer i.s.o proof-goals-buffer. (coq-with-altered-syntax-table): Fix broken use of unwind-protect. * coq/coq.el (coq-detect-hyps-in-goals): Change buffer before calling coq-find-first-hyp and coq-detect-hyps-positions-in-goals. (coq-pg-setup): Use comment-start/end. * generic/pg-goals.el: Require proof-script explicitly instead of autoloading via proof-insert-sendback-command. * generic/pg-pbrpm.el: Require proof-script explicitly instead of autoloading via proof-insert-pbp-command. * generic/pg-pgip.el: Require proof-script explicitly. * generic/proof-depends.el: Require proof-script explicitly instead of autoloading via pg-set-span-helphighlights. * generic/proof-script.el (pg-set-span-helphighlights) (proof-insert-pbp-command, proof-insert-sendback-command) (proof-script-generic-parse-find-comment-end): Don't autoload. * generic/proof-syntax.el (proof-ids-to-regexp): Simplify. * lib/span.el (span-delete): η-reduce.
2018-12-25Reduce the impact of proof-site, in case PG is not usedStefan Monnier
* generic/proof-autoloads.el: Remove `require`s; not needed. * generic/proof-site.el: Don't require `pg-vars`. (proof-ready-for-assistant): Move to proof-script.el. * generic/proof-menu.el (proof-assistant-format): Make dynamically scoped var explicit (preparation for lexical-binding). * generic/proof-script.el: Require `pg-vars`. (proof-ready-for-assistant): Move from proof-site.el. * generic/proof-syntax.el (proof-replace-regexp-in-string): * generic/proof-shell.el (proof-shell-live-buffer): Don't mark it as inlinable: it's not performance sensitive.
2018-12-22* coq-mode.el: New file to make coq-mode independent from PGStefan Monnier
Move the part of coq.el that is not specific to ProofGeneral into coq-mode.el to make `coq-mode` into a major mode that can work without PG. * coq/coq-mode.el: New file, with code extracted from coq.el. (coq-use-pg): New var. (coq-near-comment-region): Complete rewrite. * Makefile.devel (autoloads): Add `coq` to the scanned subdirectories. * generic/proof-autoloads.el: Regenerate. * generic/proof-site.el: Don't override pre-existing major-mode definitions. * coq/coq-syntax.el (coq-init-syntax-table): Delete function. Setup the syntax-table while loading coq-mode.el instead. * coq/coq-system.el (coq-prog-name, get-coq-library-directory) (coq-library-directory, coq-tags): Move to coq-mode.el. * coq/coq.el: Set proof-assistant when loaded. (coq-may-use-prettify, coq-outline-regexp) (coq-outline-heading-end-regexp, coq-mode) (coq-prettify-symbols-alist, coq-fill-paragraph-function) (coq-adaptive-fill-function): Move to coq-mode.el. (coq-shell-mode-syntax-table, coq-response-mode-syntax-table) (coq-goals-mode-syntax-table): Just reuse the already setup coq-mode-syntax-table... (coq-shell-mode-config, coq-goals-mode-config, coq-response-config): ... instead of calling coq-init-syntax-table. (coq-get-comment-region): Delete, not used any more. (coq-pg-mode-map): New var. Move top-level keymap setup here. (coq-pg-setup): Rename from coq-mode-config. Move all the non-PG specific settings to coq-mode. * generic/proof-script.el (proof-mode): Simplify call to proof-splash-message since it does the same extra tests internally. (proof-config-done-related): Don't touch font-lock-defaults if the mode doesn't provide any font-lock-defaults. * isar/isar-syntax.el: Use lexical-binding. (isar-font-lock-fontify-syntactically-region): Make it callable from font0lock-keywords. (isar-font-lock-keywords-1): Call isar-font-lock-fontify-syntactically-region. * generic/proof-syntax.el (font-lock-fontify-keywords-region): Remove advice. (proof-ids): Remove, unused. * lib/bufhist.el (bufhist-erase-buffer): Don't let-bind after-change-functions. * generic/pg-pbrpm.el (pg-pbrpm-auto-select-around-point): Fix one more left-over cl.el use. * generic/proof-utils.el (proof-with-script-buffer): Add edebug spec.
2018-12-15Cosmetic cleanup of coq-smie, coq-syntax, and coq-abbrev.Stefan Monnier
Fix a few more cl.el leftovers. Get rid of remaining use of iso-2022. Use SMIE unconditionally. * coq/coq-abbrev.el: Use lexical-binding. (coq-install-abbrevs): Delete, only keep the relevant contents. (proof-defstringset-fn): Remove. Fold changes into the main version. * coq/coq-indent.el (coq-find-real-start): Use forward-comment. * coq/coq-smie.el: Use lexical-binding. Assume `smie` is available. (coq--string-suffix-p): Rename from coq-string-suffix-p. Use string-suffix-p for it when available. (string-suffix-p): Never define here. Change all users to use coq--string-suffix-p instead. (coq-smie-.-deambiguate): Use forward-comment. Remove unused var `beg`. (coq-backward-token-fast-nogluing-dot-friends) (coq-forward-token-fast-nogluing-dot-friends): Remove unused var `tok-other`. (coq-smie-search-token-backward): Remove unused var `p`. (coq-smie-:=-deambiguate, coq-smie-backward-token): Prefer char-before over looking-back. (coq-smie-rules): Use `pcase` over deprecated cl's `case`. * coq/coq-syntax.el: Use lexical-binding. (coq-count-match): Rewrite so it doesn't do needless heap-allocation. (coq-module-opening-p, coq-section-command-p, coq-goal-command-str-p): Use case-fold-search rather than proof-string-match. (coq-goal-command-regexp): Forward-declare. (coq-save-command-regexp-strict): Move before first use. (coq-reserved-regexp): Use a single \_< ... \_>. (coq-detect-hyps-positions): Limit search for looking-back. * coq/coq.el: Remove SMIE declarations since SMIE is always used. (coq-use-smie): Remove, unused. (coq-smie): Always require. * generic/pg-pbrpm.el: Fix leftover cl.el uses. * generic/proof-utils.el (proof-defstringset-fn): Fix copy&paste error in the docstring, improve interactive prompt. * lib/maths-menu.el: Use utf-8 and lexical-binding.
2018-12-15Prepend cl- to more c[ad]+r instancesClément Pit-Claudel
2018-12-15Use cl-caddr instead of caddrClément Pit-Claudel
Hopefully fixes #409. Reported-By: @lysxia
2018-12-14Fix remaining uses of CL; Make files more declarativeStefan Monnier
Emacs occasionally loads Elisp files just to get more info (e.g. for C-h f), so loading a file should "no effect". Fix the most obvious such effects: the splash screen and the autotests by moving those effects into a function. * coq/coq-autotest.el: Make it declarative. Use lexical-binding. (coq-autotest): New function holding the code that used to be at top-level. * generic/proof.el: Use lexical-binding. Don't call proof-splash-message just because we're being loaded. * generic/proof-script.el: Use lexical-scoping; fix all warnings. (pg-show-all-portions): Simplify the code with a closure. (proof-activate-scripting): Declare activated-interactively as dyn-scoped. (proof--splash-done): New var. (proof-mode): Call proof-splash-message upon first use. * generic/proof-splash.el (proof-splash-message): Don't check byte-compile-current-file now that we're only called when the mode is activated. * acl2/acl2.el (auto-mode-alist): Use `add-to-list` and \'. * coq/coq-db.el (coq-build-menu-from-db-internal): Avoid silly O(N²). * coq/coq-seq-compile.el: * coq/coq-par-test.el: * coq/coq-par-compile.el: Fix leftover uses of CL's `assert`. * generic/proof-utils.el: * generic/pg-movie.el: * etc/testsuite/pg-test.el: * coq/coq-syntax.el: Fix leftover uses of CL's `incf`. * generic/pg-autotest.el: Fix leftover uses of CL's `decf`. * obsolete/plastic/plastic.el (plastic-preprocessing): Fix leftover use of CL's `loop`. * generic/pg-user.el (proof-add-completions): Do nothing if no proof-assistant is set yet (i.e. during byte-compilation). (byte-compile-current-file): No need to test this any more. * generic/proof-syntax.el (proof-regexp-alt-list): Use mapconcat. Remove unnecessary "\\(?:...\\)". (proof-regexp-alt): Redefine in terms of proof-regexp-alt-list.
2018-12-14Fixes the fix of #407. Is this temporary.Pierre Courtieu
This fix is not completely satisfying for the following reason: 1- I had to add a new hook in generic code. But I don't see how we could avoid this: the computation of options must happen AFTER the proof-prog-name is asked to the user, because this computation depends on the version of coq. 2- We should fix the synchronization between coq-prog-name and proof-prog-name. Either remove coq-prog-name and use only proof-prog-name, or have the generic coq always point to some (proof-ass-sym prog-name).
2018-12-13Use `cl-lib` instead of `cl` everywhereStefan Monnier
Use lexical-binding in a few files where it was easy. Don't require `proof-compat` when it's not used. * coq/coq-db.el: Use lexical-binding. * coq/coq-system.el: Use lexical-binding. (coq--extract-prog-args): Use concatenated-args rather than recomputing it. * coq/coq.el: Require `span` to silence some warnings. * generic/pg-user.el: Use lexical-binding. (complete, add-completion, completion-min-length): Silence warnings. * generic/pg-xml.el: Use lexical-binding. (pg-xml-string-of): Prefer mapconcat to reduce+concat. * generic/proof-depends.el: Use lexical-binding. (proof-dep-split-deps): Use `push`. * generic/proof-shell.el: Require `span` to silence some warnings. (proof-shell-invisible-command): Don't use lexical-let just to build a wasteful η-redex! * lib/holes.el: Use lexical-binding. Remove redundant :group args. * lib/span.el: Use lexical-binding. (span-read-only-hook): Use user-error. (span-raise): Remove, unused.
2018-12-12Cleanup patch; Moving defvar to toplevelStefan Monnier
Move `defvar`s used to silence warnings outside of eval-when-compile. Make sure they don't actually give a value to the var. * pg-init.el: Simplify. Use (if t ...) to avoid running `require` at compile-time. Don't add subdirs to load-path here since this code is never used. (pg-init--script-full-path, pg-init--pg-root): Inline their definition into their sole user. * generic/proof-utils.el (proof-resize-window-tofit): Inline definitions of window-leftmost-p and window-rightmost-p previously in proof-compat.el. * lib/proof-compat.el (proof-running-on-win32): Remove, not used. (mac-key-mode): Remove, there's no carbon-emacs-package-version in Emacs≥24.3. (pg-custom-undeclare-variable): Use dolist. (save-selected-frame): Remove, save-selected-window also saves&restores the selected frame at the same time. Update all users (which already used save-selected-window around it). (window-leftmost-p, window-rightmost-p, window-bottom-p) (find-coding-system): Remove, unused. * hol-light/hol-light.el (caml-font-lock-keywords): Don't try to defvar it to a dummy value and... (hol-light): ...check its existence before using it instead. * coq/coq.el (coq-may-use-prettify): Simplify initialization.
2018-11-12Remove code that hides mode-line.Calvin Beck
2018-09-01Reloading proof-autoloads is safe; don't forbid itClément Pit-Claudel
Fixes GH-386. Reported-by: @mrkkrp
2018-08-25Merge pull request #169 from ProofGeneral/help-span-extendedErik Martin-Dorel
Fix #158 by extending helpspan
2018-08-23Run make autoloadsErik Martin-Dorel
2018-08-23Fix most doc issues raised by (checkdoc)Erik Martin-Dorel