aboutsummaryrefslogtreecommitdiff
path: root/generic/proof-syntax.el
AgeCommit message (Collapse)Author
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
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-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-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-08-23Fix most doc issues raised by (checkdoc)Erik Martin-Dorel
2018-03-07Add a missing parameter in advice on font-lock-fontify-keywords-regionClément Pit--Claudel
2018-02-21Update copyright messages and improve the header of elisp files.Erik Martin-Dorel
2010-09-22Fix some bugs in coq regexp generationDavid Aspinall
2010-08-25Bring syntactic context functions togetherDavid Aspinall
2010-08-18Style fixesDavid Aspinall
2010-08-11only run custom font-lock-fontify-syntactically-region on PG buffersDavid Aspinall
2010-08-11Support custom syntactic fontification. Split out pa macros.David Aspinall
2010-08-08Checkdoc cleanupsDavid Aspinall
2009-12-01proof-splice-separator -> mapconcat builtinDavid Aspinall
2009-12-01proof-ids-to-regexp: use regexp-opt, this seems reliable now.David Aspinall
2009-12-01fix proof-splice-separatorDavid Aspinall
2009-10-03proof-regexp-alt: use shy matchingDavid Aspinall
2009-09-09Add proof-re-search-forward-safeDavid Aspinall
2009-09-06Doc fixes, and many defun -> defsubst to enhance compiled code.David Aspinall
2009-09-05Clean whitespaceDavid Aspinall
2009-09-04Remove proof-shell-prompt-pattern, no longer used.David Aspinall
2009-09-04proof-looking-at-syntactic-context: moved to proof-utils because of macro useDavid Aspinall
2009-09-04commentDavid Aspinall
2009-08-19proof-splice-separator: ignore nil entries for convenienceDavid Aspinall
2009-08-18NoteDavid Aspinall
2009-08-17Update docDavid Aspinall
2009-08-17proof-looking-at-syntactic-context: allow proof assistantDavid Aspinall
version to override default.
2008-07-24Merge changes from Version4Branch.David Aspinall
2008-07-21proof-ids-to-regexp: Use word-symbol constituent match \_< \_> in GNU Emacs,David Aspinall
with improvement due to Stefan Monnier. No change for XEmacs.
2008-07-21Changed the main menu of coq. Changed a shortcut for holes.Pierre Courtieu
2008-01-16Reduce compiler warnings. Minor fixes.David Aspinall
2008-01-15Many rearrangements for compatibility, efficient/correct compilation, ↵David Aspinall
namespaces fixes. pre-shell-start-hook: remove this, use default names for modes proof-compat: simplify architecture flags, use standard (featurep 'xemacs).
2007-05-10Add proof-replace-regexp-nocasefoldDavid Aspinall
2006-08-23Coq indentation small fixes.Pierre Courtieu
2005-09-01added proof-search-forward, proof-replace-regexp-in-string;Makarius Wenzel
avoid (re-)search-forward, which does not observe proof-case-fold-search;
2005-02-13Add suggestion by Stefan Monnier (comment only)David Aspinall
2002-08-31Documentation.David Aspinall
2002-08-31Improved implementation of zap-commas font lock behaviour, patch from Stefan ↵David Aspinall
Monnier
2002-08-13proof-string-match-safe is even more safeDavid Aspinall
2002-07-19Variable name change proof-comment-{start,end}-regexp -> ↵David Aspinall
proof-script-comment-{start,end}-regexp.
2002-07-18Investigation of proof-zap-commas failure in GNU Emacs; comments, no results.David Aspinall
2002-07-18Fix bug in proof-zap-commas-region (which is anyway faulty)David Aspinall
2002-07-16Refactor several variable names; clean up, doc subterm markup and output ↵David Aspinall
display.
2002-06-21GPLDavid Aspinall
2002-01-31Tweak commentDavid Aspinall
2001-08-10Found another instance of buffer-syntactic-contextDavid Aspinall
2001-05-08Copyright date updatedDavid Aspinall
2000-12-14Generalise proof-format-filenameDavid Aspinall