aboutsummaryrefslogtreecommitdiff
path: root/coq/coq-indent.el
AgeCommit message (Collapse)Author
2020-10-16Fix #514 + support for named goal selector.Pierre Courtieu
It was hard to separate this too fixes (same regexps).
2019-12-04Uncommented coq-find-comment-start, coq-find-comment-end as quick fix for #444Vadim Zaliva
2019-02-12Simpler fix for #411.Pierre Courtieu
2019-02-12Fixes #411.Pierre Courtieu
Stefan's cleanup stumbled on my lack of comments :-(. Some function was supposed to return point found if found.
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-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-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-08-23Fix most doc issues raised by (checkdoc)Erik Martin-Dorel
2018-02-21Update copyright messages and improve the header of elisp files.Erik Martin-Dorel
2018-01-26look for vernac controls before focus bracket, fix for #223Paul Steckler
2018-01-15Experimental fix for #220.Pierre Courtieu
2017-03-08Fix incorrect uses of defvarClément Pit--Claudel
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.
2016-05-27Fixing a smal glitch in indentation.Pierre Courtieu
2016-01-14Fix #29 + indentation glitch + regexp refactoring.Pierre Courtieu
2015-12-07Speeding up indentation (regexp optim).Pierre Courtieu
2015-12-07Speeding up indentation.Pierre Courtieu
Dedicated regexp for bullets when searching backward.
2015-12-05Fixed #15 + more speedup of indentation.Pierre Courtieu
Experimenting on more regexp and less adhoc searching in the smie lexer. In particular the regexp for bullet seems now capture only real bullets.
2015-01-27Fixed a bug in script navigation. Updated CHANGEPierre Courtieu
2014-12-30removed debug message.Pierre Courtieu
2014-12-30fixed indentation (lexing of 'with') + made local coq-load-path.Pierre Courtieu
2014-12-24fixed a bug in command parsing for coq, due to recent changes.Pierre Courtieu
2014-12-23Supporting more bullets (coq 8.5), like ++ or ++++.Pierre Courtieu
2012-08-30Summary: Don't quote lambda expressionsStefan Monnier
* coq/coq-indent.el (coq-indent-inner-regexp): Remove old X-Symbol element. (coq-save-count, coq-proof-count): * obsolete/plastic/plastic.el (plastic-shell-handle-output): * lib/texi-docstring-magic.el (texi-docstring-magic-insert-magic): * lib/pg-dev.el (emacs-lisp-mode-hook): * lib/maths-menu.el (maths-menu-filter-predicate) (maths-menu-tokenise-insert): * lib/holes.el (holes-next): * lego/lego.el (lego-shell-handle-output): * isar/isabelle-system.el (isabelle-docs-menu): * coq/coq.el (coq-compile-command, coq-compile-auto-save) (coq-compile-ignored-directories, coq-load-path-safep) (proof-shell-handle-delayed-output-hook): Don't quote lambda.
2012-07-05Fixed a syntactic recognition function. Should Fix #2819.Pierre Courtieu
2012-06-14Fix a bug in coq indet code when at the beginning of a buffer.Pierre Courtieu
2012-06-11Trying to minimize the slowness of indentation when no "Proof." isPierre Courtieu
given. Seems to work.
2012-02-10Fixed an ineficiency in comment detection.Pierre Courtieu
2012-02-01Cleaning some code.Pierre Courtieu
2012-02-01Quick fix of a regression introduced by my last commit. Looking for aPierre Courtieu
better fix.
2012-02-01Fixed command end recognition in presence of operators of the form .+Pierre Courtieu
+. is not accepted yet.
2011-12-16Adapting coq syntax recognition to the future v8.4 behavior of bulletsPierre Courtieu
(stand-alone commands), which is different of the experiments made until now in coq/trunk.
2011-09-04Fix trac #420 indentation freezing.Pierre Courtieu
2011-08-23Crude patch for Trac #416. I haven't tried to understand indent code fully, ↵David Aspinall
so may not be best fix.
2011-07-08Fixing the scripting of new subproof script parenthesizing ({ and }).Pierre Courtieu
2011-06-19Removed { and } as command terminators for now.Pierre Courtieu
Fixes #412.
2011-06-10Fix trac #410.Pierre Courtieu
2011-06-09Fix compile errors (seems to be code duplication between coq.el and coq-indent)David Aspinall
2011-06-072011-06-07 Stefan Monnier <monnier@iro.umontreal.ca>Stefan Monnier
* coq/coq.el: Match Proof...Qed and fix ;-vs-| precedence. (coq-smie-grammar): Add ; and | tacticals. Rename decls => cmds. Add CoInductive, and Proof..Qed. (coq-smie-search-token-forward): Rename from coq-smie-search-token; make it more robust. (coq-smie-search-token-backward): New function. (coq-smie-forward-token, coq-smie-backward-token): Use it to distinguish Inductive's ":=" from other uses. (coq-smie-rules): Use smie-rule-separator for |. Add ugly hack for Qed without matching "Proof".
2011-06-04Updated the old code for indentation, in case Stefan cannot finish thePierre Courtieu
new one for the release. Added also support for an experimental syntax modification: { .. } is a new syntax for Beginsubproof. ... EndSubproof. There a also few minor behavior changes. The code has changed a lot though.
2011-05-31Some small fixes in indentation for coq.Pierre Courtieu
2011-05-31Added indentation for BeginSubProof/EndSubProof.Pierre Courtieu
+ added some tactics syntax.
2010-09-09Fixed the cleaning of goals buffer when proof completedPierre Courtieu
+ fixed the refreshing of modeline goal number display.
2010-09-09Cleaning indentation code.Pierre Courtieu
2010-09-09Fixed indentation at end of file.Pierre Courtieu
2010-09-09Fixed small bugs in indentation.Pierre Courtieu
2010-09-07Finished fixing the small indentation bug at buffer top.Pierre Courtieu
2010-09-07Fix of previous commit.Pierre Courtieu
2010-09-07half fixed the indentation bug at buffer start.Pierre Courtieu
2010-09-03First fix of bug introduced by the last font-lock fix. Not finished.Pierre Courtieu
2010-09-01Fixed bug #346. Coq code was using proof-ids-to-regexp on regexpPierre Courtieu
instead of pure strings.