aboutsummaryrefslogtreecommitdiffhomepage
path: root/coq/coq-syntax.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.
* * 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.
* Cosmetic cleanup of coq-smie, coq-syntax, and coq-abbrev.Gravatar Stefan Monnier2018-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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.
* Fix most doc issues raised by (checkdoc)Gravatar Erik Martin-Dorel2018-08-23
|
* Support the Variant vernacularGravatar Tej Chajed2018-08-17
| | | | | Syntactically looks much like an Inductive, though it is non-recursive so "where" (mutual recursion) is not supported.
* Fixing last commit.Gravatar Pierre Courtieu2018-06-15
|
* Fix #368 (emacs < 25 split-string has no trim arg).Gravatar Pierre Courtieu2018-06-15
| | | | Copied some code from company-coq.
* Fix multiple hyp overlays.Gravatar Pierre Courtieu2018-06-13
| | | | | queries would trigger re-generarion of overlays. Now overlays are generated if there are no overlays already.
* Fix the fix #355.Gravatar Pierre Courtieu2018-06-13
| | | | The fix was bad: no ore hyps were foldable/highlightable.
* Changed the look of folding/unfolding hyps.Gravatar Pierre Courtieu2018-06-08
|
* Small fix in a regexp.Gravatar Pierre Courtieu2018-06-06
|
* Shorter CHANGES + smal fixes in hide/highlight hyps code.Gravatar Pierre Courtieu2018-06-04
|
* Click hypothesis to (un)hide them.Gravatar Pierre Courtieu2018-06-01
|
* Infrastructure for transient hyps highlighting.Gravatar Pierre Courtieu2018-05-31
|
* Update copyright messages and improve the header of elisp files.Gravatar Erik Martin-Dorel2018-02-21
|
* typo in abbrevs.Gravatar Pierre Courtieu2018-02-07
|
* Merge pull request #157 from ProofGeneral/elpaGravatar Clément Pit-Claudel2017-05-05
|\ | | | | [WIP] ELPA/MELPA support
* | Typo from commit 758e679e.Gravatar Pierre Courtieu2017-04-25
| |
* | Preparing new warning tags (no more special chars).Gravatar Pierre Courtieu2017-04-24
| |
* | Fixing #173.Gravatar Pierre Courtieu2017-03-31
| |
* | Added support for future new options (trunk).Gravatar Pierre Courtieu2017-03-22
| |
| * Fix incorrect uses of defvarGravatar Clément Pit--Claudel2017-03-08
|/ | | | | | | It didn't really matter that these variables were defined and set to nil during compilation, since we ran compilation in a clean Emacs in --batch mode; it does matter now, however, since package.el compiles PG in the user's currently running Emacs instance.
* Add {Local ,}Axioms like {Local ,}Axiom, fix Parameters (#106)Gravatar Jason Gross2017-01-17
|
* Merge pull request #107 from JasonGross/patch-3Gravatar hendriktews2017-01-17
|\ | | | | Add Context to coq-syntax.el
* | fix coq-require-command-regexp (fixes #75)Gravatar Hendrik Tews2016-10-28
| |
| * Add Context to coq-syntax.elGravatar Jason Gross2016-09-01
|/
* Add Reserved Infix like Reserved Notation (#95)Gravatar Jason Gross2016-08-14
|
* Adding the option to highlight susual symbols.Gravatar Pierre Courtieu2016-07-22
| | | | | This may look ugly to the majority, so I let it off by default. I find it helpfull to have structuring symbols bold.
* Highlight Existing Class like Existing Instance (#85)Gravatar Jason Gross2016-07-03
| | | Closes #81
* Highlight [nra] like [nia] and [lia] and [lra] (#84)Gravatar Jason Gross2016-07-01
|
* Color lia, romega, nia, psatz, nsatz, lraGravatar Jason Gross2016-06-10
| | | | This closes #77
* abbrev twivking.Gravatar Pierre Courtieu2016-06-08
|
* Fixing font-locking of unicode forall etc.Gravatar Pierre Courtieu2016-06-08
|
* Fixing a smal glitch in indentation.Gravatar Pierre Courtieu2016-05-27
|
* Merge branch 'master' of github.com:ProofGeneral/PGGravatar Pierre Courtieu2016-05-20
|\
* | Fix #72+ make user keywords prioritized over default ones.Gravatar Pierre Courtieu2016-05-20
| |
| * Merge branch 'master' of github.com:ProofGeneral/PGGravatar Clément Pit--Claudel2016-05-16
| |\ | |/ |/|
| * coq-syntax: Add a debug specGravatar Clément Pit--Claudel2016-05-16
| |
* | Fixing detection of symbol at point.Gravatar Pierre Courtieu2016-05-02
|/ | | | | | Quote at start of a word should not be considered part of the word. Other characters than ' or _ are punctuation.
* Adding more keywords (Local xxx).Gravatar Pierre Courtieu2016-03-09
|
* Highlight ltac:(), constr:(), and uconstr:()Gravatar Clément Pit--Claudel2016-03-05
| | | | Also refactor coq-font-lock-keywords-1 slightly.
* Adding missing keywordsGravatar Pierre Courtieu2016-02-18
|
* fix #36.Gravatar Pierre Courtieu2016-01-19
|
* Introduce a coq-question-mark-faceGravatar Clément Pit--Claudel2015-11-23
| | | | Closes #12
* Fixed the regexp for colorizing hyps in the goal.Gravatar Pierre Courtieu2015-10-15
|
* Trying to deal with debug mode.Gravatar Pierre Courtieu2015-10-06
|
* colorizing hypothesis in compact mode.Gravatar Pierre Courtieu2015-09-29
|
* hyps highlighting now supports compact contexts (in coq trunk soon).Gravatar Pierre Courtieu2015-09-22
|
* Fixes #492. fixed regexp (\\< --> \\_< everywhere).Gravatar Pierre Courtieu2015-05-07
| | | | Surprising that this did not raise before...