aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic/proof-script.el
Commit message (Collapse)AuthorAge
* Make coq-mode work without generic/proof-*Gravatar Stefan Monnier2018-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Reduce the impact of proof-site, in case PG is not usedGravatar Stefan Monnier2018-12-25
| | | | | | | | | | | | | | | | * 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.
* * coq-mode.el: New file to make coq-mode independent from PGGravatar Stefan Monnier2018-12-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix remaining uses of CL; Make files more declarativeGravatar Stefan Monnier2018-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use `cl-lib` instead of `cl` everywhereGravatar Stefan Monnier2018-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Cleanup patch; Moving defvar to toplevelGravatar Stefan Monnier2018-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #169 from ProofGeneral/help-span-extendedGravatar Erik Martin-Dorel2018-08-25
|\ | | | | Fix #158 by extending helpspan
* | Fix most doc issues raised by (checkdoc)Gravatar Erik Martin-Dorel2018-08-23
| |
* | Update copyright messages and improve the header of elisp files.Gravatar Erik Martin-Dorel2018-02-21
| |
* | Fix pg-{show,hide}-all-proofs and Move them into pg-user.el.Gravatar Erik Martin-Dorel2017-08-15
| | | | | | | | This commit address ProofGeneral/PG#193.
| * extend helpspan, issue #158Gravatar Paul Steckler2017-03-09
|/
* Remove default key-binding for proof-electric-terminator-toggle.Gravatar Erik Martin-Dorel2017-03-03
| | | | Close ProofGeneral/PG#160
* proof-retract-before-change: Fix #41 by saving/restoring the match data.Gravatar Erik Martin-Dorel2016-09-25
|
* Reset proof-script-buffer to nil if -ready-prover failsGravatar Clément Pit--Claudel2016-06-10
| | | | Fixes #65
* Fixing #25.Gravatar Pierre Courtieu2016-01-06
| | | | proof-script-buffer was not set before calling proof-shell-ready-prover.
* proof-retract-command-hook added + more auto adjust width in coq mode.Gravatar Pierre Courtieu2015-10-13
|
* proof-assert-command-hook added + Auto adjust width in coq mode.Gravatar Pierre Courtieu2015-10-12
| | | | | | | This hook was missing, it allows to send complete commands before the (set of) command(s) sent by the user. It shall be used when proof-shell-insert-hook cannot be used (because of multiple prompts appearing).
* Don't mess with overlay priorities.Gravatar Stefan Monnier2014-06-06
|
* Add option proof-layout-windows-on-visit-file, addressing Trac #444Gravatar David Aspinall2012-08-16
|
* fix 443 by enforcing that the prover is not busy in proof-retract-until-pointGravatar Hendrik Tews2012-08-14
|
* * generic/pg-user.el (which-func-modes): Fix compiler declaration.Gravatar Stefan Monnier2012-06-29
| | | | * generic/proof-site.el (assistants): Fix regexp.
* Made a small change in generic code about the setting ofGravatar Pierre Courtieu2012-06-09
| | | | | | | comment-start-skip: if it is already set then proof-script should not change it. Ultimately if David approves we should moreover fix the setting itself which is bugged. coq-mode now sets this variable by itself.
* Patch from Tom Prince to fix Emacs 24 byte compilation (replace ↵Gravatar David Aspinall2011-10-13
| | | | interactive-p with called-interactively-p)
* Add autoload.Gravatar David Aspinall2011-06-09
|
* - fix for #408: Only use the buffer name inGravatar Hendrik Tews2011-06-08
| | | | | coq-compile-response-buffer - fix typo elsewhere
* Trac#403: wait for retraction to complete before returning, toGravatar David Aspinall2011-05-30
| | | | avoid hitting read only error in calling command.
* ensure (integerp proof-segment-up-to-cache-end), fixes Trac #404Gravatar David Aspinall2011-05-27
|
* proof-retract-before-change: fix Trac #403 (at least partially) byGravatar David Aspinall2011-05-26
| | | | | removing restriction during automatic retraction so proof-retract-until-point behaves correctly.
* Patch for Trac#400.Gravatar David Aspinall2011-05-16
|
* Tweak for `proof-segment-up-to-using-cache': better handling ofGravatar David Aspinall2011-05-12
| | | | proof-last-edited-low-watermark.
* Attempted fix for `proof-segment-up-to-using-cache', reGravatar David Aspinall2011-05-12
| | | | http://proofgeneral.inf.ed.ac.uk/trac/ticket/395
* - flushed proof-done-advancing-require-function andGravatar Hendrik Tews2011-05-05
| | | | | proof-shell-require-command-regexp - TAGS updated to really flush them
* Fix for Trac #397. Needs some exercise.Gravatar David Aspinall2011-04-26
|
* Add proof-output-tooltips option to turn off output highlighting for people ↵Gravatar David Aspinall2011-04-13
| | | | who read or edit by waving mouse at text
* - change to proof-restart-buffers for unlocking ancestorsGravatar Hendrik Tews2011-03-14
| | | | - improve internal docs for unlocking
* Support mouse action on modeline indicator for scripting modeGravatar David Aspinall2011-01-31
|
* proof-deactivate-scripting: cleanup this function to make moreGravatar David Aspinall2011-01-25
| | | | | intelligible, also to properly support behaviour needed for `proof-no-fully-processed-buffer'.
* - change 'span-delete-action in 'span-delete-actions, which isGravatar Hendrik Tews2011-01-24
| | | | | now a list of functions to be run when the span is deleted. Use span-add-delete-action to add a delete action.
* proof-protected-process-or-retract: don't give failure error if nothing to doGravatar David Aspinall2011-01-23
| | | | Addresses Trac #383
* pg-show-all-portions: protect against empty hash tablesGravatar David Aspinall2011-01-19
|
* - move proof-no-fully-processed-buffer to generic/proof-configGravatar Hendrik Tews2011-01-14
| | | | | | - add documentation for it - add a test case demonstrating it in coq/ex/test-cases/retract-completely-asserted
* Add preliminary support for multiple files for coq.Gravatar Hendrik Tews2011-01-12
| | | | | | | | | | | | | | | The following points are implemented already: - recompile either via an external command (make) or let ProofGeneral handle everything internally - complete dependency tracking and recompilation for coq files in internal mode - support for extending the LoadPath: does almost work, even if specified file-locally - move back to clean state if recompilation fails There are the following known problems: - coq-load-path extensions are not retracted - fails on partially qualified library names
* proof-segment-up-to-using-cache: improve attemptGravatar David Aspinall2010-10-11
|
* Fix debug message formatGravatar David Aspinall2010-10-10
|
* pg-span-name: improve docstring.Gravatar David Aspinall2010-10-10
| | | | | proof-complete-buffer-atomic: simplify. Add debug message for parser cache.
* Fix to last patch.Gravatar David Aspinall2010-10-10
|
* proof-assert-electric-terminator: prevent adding terminator if point is ↵Gravatar David Aspinall2010-10-10
| | | | | | after it as well as before, as in PG 3.7. Fixes #371.
* Move utility span-make-modifying-removing-span to span.elGravatar David Aspinall2010-10-01
|
* proof-shell-handle-error-or-interrupt-hook: only run if ordinary scripting ↵Gravatar David Aspinall2010-10-01
| | | | input (no non-nil flags in queue)
* Adjust handling of insertion of newlines before next command.Gravatar David Aspinall2010-10-01
|