aboutsummaryrefslogtreecommitdiff
path: root/generic/proof-utils.el
AgeCommit message (Collapse)Author
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-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`)
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-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-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-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
2017-01-24annoying missing parentheisis in a comment.Pierre Courtieu
2017-01-04Fixing #121 + avoid hiding user windows too much.Pierre Courtieu
2016-11-02fix error in process filter: Cannot resize windowHendrik Tews
2016-09-16Fix reference to log-warning-minimum-levelpsteckler
Fixes #110.
2012-09-05Fixed double hit terminator. Now it is disabled by default, andPierre Courtieu
enabling it disables electric-terminator and vice-versa. In case both are non nil at the same time, then electric teminator has priority. If people like it we may propose this to other modes than coq. + fixed window layout policy.
2011-01-31CommentsDavid Aspinall
2011-01-25Bump/relax version numbers. Error for <23, warning for minor version mismatch.David Aspinall
2011-01-18Removing a debugging message.Pierre Courtieu
2011-01-12Type-check on integer settingsDavid Aspinall
2011-01-11Add additional support for pgipfloat typeDavid Aspinall
2010-10-11proof-debug: fiddle with warning levels to make *PG Debug* buffer appear, ↵David Aspinall
set it in help mode.
2010-10-08Remove developers note from docstring of togglersDavid Aspinall
2010-10-01CommentDavid Aspinall
2010-09-29Coding conventionsDavid Aspinall
2010-09-21proof-deftoggle: add declare-function to prevent compiler warningsDavid Aspinall
2010-08-25Fixed my last commit where compilation was broken. (function put atPierre Courtieu
the wrong place).
2010-08-25Fixed the bug of vertical window splitting when the size of the windowPierre Courtieu
is too small. However if the frame is too small the bug remains (but it is much less probable).
2010-08-25Bring syntactic context functions togetherDavid Aspinall
2010-08-11Move some var+macro to fix compilationDavid Aspinall
2010-08-11Support custom syntactic fontification. Split out pa macros.David Aspinall
2010-08-08Checkdoc cleanupsDavid Aspinall
2010-08-03proof-deftoggle-fn: make ARG optional as suggested by docstringDavid Aspinall
2009-09-27proof-save-this-buffer: addedDavid Aspinall
2009-09-15Fix compile warningDavid Aspinall
2009-09-11Our own buffer for debug messagesDavid Aspinall
2009-09-10Move stripping and minibuffer-message function hereDavid Aspinall
2009-09-10Experimental changes to queue several commands at once and to allow ↵David Aspinall
pre-processing of commands when they're queued from script
2009-09-10Move defpacustom here. Move message functions to proof-shell. Fix requires.David Aspinall
2009-09-08Clarify requireDavid Aspinall
2009-09-08Require on scomintDavid Aspinall
2009-09-06proof-clean-buffer: inhibit read onlyDavid Aspinall
2009-09-06Remove commentDavid Aspinall
2009-09-05Clean whitespaceDavid Aspinall
2009-09-04replace-in-string -> replace-regexp-in-stringDavid Aspinall
2009-09-04Alternative implementation of pg-remove-specials which does not introduce ↵David Aspinall
restriction.
2009-09-04proof-files-to-buffers, proof-locate-executable: simplifyDavid Aspinall
proof-file-to-buffer: use find-buffer-visiting instead proof-looking-at-syntactic-context: moved here from proof-syntax for compilation
2009-08-31Unnecessary testDavid Aspinall
2009-08-14pg-current-word-pos: add for convenience in identifier query functionDavid Aspinall
2009-05-26Add proof state hover messages to proof script, along with useful customization.David Aspinall