aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic/proof-utils.el
diff options
context:
space:
mode:
authorGravatar Stefan Monnier <monnier@iro.umontreal.ca>2018-12-13 22:57:15 -0500
committerGravatar Clément Pit-Claudel <clement.pitclaudel@live.com>2018-12-14 17:11:19 -0500
commit9a25320acf24020fc0e2b97589f9d996f3d1d4fb (patch)
tree336e2a8dcc25f855ad93506b04c9d4e389457b6c /generic/proof-utils.el
parentd45bad350834876a0b7e625039313bd1f643c50b (diff)
Fix remaining uses of CL; Make files more declarative
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.
Diffstat (limited to 'generic/proof-utils.el')
-rw-r--r--generic/proof-utils.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/proof-utils.el b/generic/proof-utils.el
index 99e537c5..1568b2f0 100644
--- a/generic/proof-utils.el
+++ b/generic/proof-utils.el
@@ -23,6 +23,7 @@
;;; Code:
+(eval-when-compile (require 'cl-lib))
;;
;; Give Emacs version mismatch error here.
;;
@@ -58,8 +59,6 @@
(require 'proof-autoloads) ; interface fns
(require 'scomint) ; for proof-shell-live-buffer
-;;; Code:
-
;;
;; Handy macros
;;
@@ -247,7 +246,8 @@ Experimentally we display a message from time to time advertising
;; IF there *isn't* a visible window showing buffer...
(unless (get-buffer-window buffer 0)
(if proof-three-window-enable
- (if (< proof-advertise-layout-count 30) (incf proof-advertise-layout-count)
+ (if (< proof-advertise-layout-count 30)
+ (cl-incf proof-advertise-layout-count)
(message (substitute-command-keys "Hit \\[proof-layout-windows] to reset layout"))
(setq proof-advertise-layout-count 0)))
;; THEN either we are in 2 wins mode and we must switch the assoc