Re: [PG-devel] Use cl-lib instead of cl

2018-12-20 Thread Stefan Monnier
Here's another patch.
This one is again more along the lines of mere cleanup.
Its goal is to reduce the amount of work done in proof-site, so Emacs
starts up a bit faster and is less impacted by the presence of PG in
those sessions where PG is actually not used.


Stefan


0001-Reduce-the-impact-of-proof-site-in-case-PG-is-not-us.patch
Description: Binary data
___
ProofGeneral-devel mailing list
ProofGeneral-devel@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/proofgeneral-devel

Re: [PG-devel] Use cl-lib instead of cl

2018-12-15 Thread Clément Pit-Claudel
On 15/12/2018 20.06, Stefan Monnier wrote:
> Hopefully, the one below will go through better.

Indeed, this one applied smoothly. Thanks!



signature.asc
Description: OpenPGP digital signature
___
ProofGeneral-devel mailing list
ProofGeneral-devel@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/proofgeneral-devel

Re: [PG-devel] Use cl-lib instead of cl

2018-12-15 Thread Stefan Monnier
>> Here's another,
> `git am` doesn't like this one :'(

Hopefully, the one below will go through better.

Sorry 'bout the incomplete removal of cl.el as well.
I made another round of checks and found a few more leftover uses.


Stefan


0001-Cosmetic-cleanup-of-coq-smie-coq-syntax-and-coq-abbr.patch
Description: Binary data
___
ProofGeneral-devel mailing list
ProofGeneral-devel@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/proofgeneral-devel

Re: [PG-devel] Use cl-lib instead of cl

2018-12-13 Thread Clément Pit-Claudel
On 13/12/2018 22.58, Stefan Monnier wrote:
> Here's another,

`git am` doesn't like this one :'(

Applying: Fix remaining uses of CL; Make files more declarative
error: acl2/acl2.el: does not match index
error: coq/coq-autotest.el: does not match index
error: coq/coq-db.el: does not match index
error: coq/coq-par-compile.el: does not match index
error: coq/coq-par-test.el: does not match index
error: coq/coq-seq-compile.el: does not match index
error: coq/coq-syntax.el: does not match index
error: etc/testsuite/pg-test.el: does not match index
error: generic/pg-autotest.el: does not match index
error: generic/pg-movie.el: does not match index
error: generic/pg-user.el: does not match index
error: generic/proof-script.el: does not match index
error: generic/proof-splash.el: does not match index
error: generic/proof-syntax.el: does not match index
error: generic/proof-useropts.el: does not match index
error: generic/proof-utils.el: does not match index
error: generic/proof.el: does not match index
error: obsolete/plastic/plastic.el: does not match index
Patch failed at 0001 Fix remaining uses of CL; Make files more declarative
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Clément.



signature.asc
Description: OpenPGP digital signature
___
ProofGeneral-devel mailing list
ProofGeneral-devel@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/proofgeneral-devel

Re: [PG-devel] Use cl-lib instead of cl

2018-12-13 Thread Stefan Monnier
> Pushed as well. Thanks!

[ Tant que je gagne, je joue!  ]

Here's another,


Stefan
>From 5549c4751e7e73382d2bd088322a483df90f51c9 Mon Sep 17 00:00:00 2001
From: Stefan Monnier 
Date: Thu, 13 Dec 2018 22:57:15 -0500
Subject: [PATCH] Fix remaining uses of CL; Make files more declarative
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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.
---
 acl2/acl2.el|  9 ++---
 coq/coq-autotest.el |  6 ++-
 coq/coq-db.el   | 16 
 coq/coq-par-compile.el  | 34 
 coq/coq-par-test.el | 35 +
 coq/coq-seq-compile.el  |  5 ++-
 coq/coq-syntax.el   | 17 
 etc/testsuite/pg-test.el|  8 ++--
 generic/pg-autotest.el  |  9 +++--
 generic/pg-movie.el |  5 ++-
 generic/pg-user.el  | 16 
 generic/proof-script.el | 96 +++--
 generic/proof-splash.el |  4 +-
 generic/proof-syntax.el | 14 +++
 generic/proof-useropts.el   |  4 +-
 generic/proof-utils.el  |  6 +--
 generic/proof.el|  5 +--
 obsolete/plastic/plastic.el |  4 +-
 18 files changed, 147 insertions(+), 146 deletions(-)

diff --git a/acl2/acl2.el b/acl2/acl2.el
index cf9f521c..db3120ed 100644
--- a/acl2/acl2.el
+++ b/acl2/acl2.el
@@ -3,7 +3,7 @@
 ;; This file is part of Proof General.
 
 ;; Portions © Copyright 1994-2012  David Aspinall and University of Edinburgh
-;; Portions © Copyright 2003, 2012, 2014  Free Software Foundation, Inc.
+;; Portions © Copyright 2003-2018  Free Software Foundation, Inc.
 ;; Portions © Copyright 2001-2017  Pierre Courtieu
 ;; Portions © Copyright 2010, 2016  Erik Martin-Dorel
 ;; Portions © Copyright 2011-2013, 2016-2017  Hendrik Tews
@@ -24,10 +24,9 @@
 (require 'proof-easy-config); easy configure mechanism
 (require 'proof-syntax)			; functions for making regexps
 
-(setq auto-mode-alist   ; ACL2 uses two file extensions
-  (cons; Only grab .lisp extension after
-   (cons "\\.lisp$" 'acl2-mode)	; an acl2 file has been loaded
-   auto-mode-alist))
+(add-to-list 'auto-mode-alist; ACL2 uses two file extensions
+ ; Only grab .lisp extension after
+ (cons "\\.lisp\\'" 'acl2-mode)) ; an acl2 file has been loaded
 
 (proof-easy-config  'acl2 "ACL2"
  proof-assistant-home-page   "http://www.cs.utexas.edu/users/moore/acl2;
diff --git a/coq/coq-autotest.el b/coq/coq-autotest.el
index 8be4bed9..5ca66706 100644
--- a/coq/coq-autotest.el
+++ b/coq/coq-autotest.el
@@ -1,4 +1,4 @@
-;;; coq-autotest.el --- tests of Coq Proof General (in progress).
+;;; coq-autotest.el --- tests of Coq Proof General (in progress)  -*- lexical-binding:t -*-
 
 ;; This file is part of Proof General.
 
@@ -21,7 +21,9 @@
 (require 'proof-site)
 (defvar coq-compile-before-require)
 
-(unless (bound-and-true-p byte-compile-current-file)
+;;;###autoload
+(defun coq-autotest ()
+  (interactive)
 
   (pg-autotest start 'debug)
 
diff --git a/coq/coq-db.el b/coq/coq-db.el
index 36812c4c..7e59bffb 100644
--- a/coq/coq-db.el
+++ b/coq/coq-db.el
@@ -25,7 +25,7 @@
 
 

Re: [PG-devel] Use cl-lib instead of cl (was: Supported version of Emacs)

2018-12-13 Thread Clément Pit-Claudel


On 12/12/2018 15.27, Stefan Monnier wrote:
 I'm happy to push it for you. Would you mind sending a copy as a `git
 format-patch` attachment, so that the commit is properly attributed?
>>> Here it is,
>> Pushed, thanks. Looking forward to more neat patches :)
> 
> Here's the next one.

Pushed as well. Thanks!



signature.asc
Description: OpenPGP digital signature
___
ProofGeneral-devel mailing list
ProofGeneral-devel@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/proofgeneral-devel

[PG-devel] Use cl-lib instead of cl (was: Supported version of Emacs)

2018-12-12 Thread Stefan Monnier
>>> I'm happy to push it for you. Would you mind sending a copy as a `git
>>> format-patch` attachment, so that the commit is properly attributed?
>> Here it is,
> Pushed, thanks. Looking forward to more neat patches :)

Here's the next one.

`cl` is deprecated in favor of cl-lib, which is virtually identical except
it uses names with a "cl-" prefix, so this patch makes the
corresponding change.  It also uses lexical-binding in a few files
(e.g. to replace lexical-let which was in `cl` but is not in `cl-lib`)
and removes most of the (require 'proof-compat) since they're mostly unused.


Stefan


>From 4e1eec445658173273e11a49e0733250745278a4 Mon Sep 17 00:00:00 2001
From: Stefan Monnier 
Date: Wed, 12 Dec 2018 15:20:08 -0500
Subject: [PATCH] Use `cl-lib` instead of `cl` everywhere
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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.
---
 coq/coq-autotest.el |  5 +--
 coq/coq-compile-common.el   |  5 +--
 coq/coq-db.el   | 19 ++--
 coq/coq-local-vars.el   |  7 ++---
 coq/coq-par-compile.el  |  3 --
 coq/coq-seq-compile.el  |  3 --
 coq/coq-system.el   |  8 ++---
 coq/coq.el  | 53 +++
 doc/docstring-magic.el  |  3 +-
 easycrypt/easycrypt.el  |  3 +-
 generic/pg-assoc.el |  7 +++--
 generic/pg-goals.el |  1 -
 generic/pg-pgip.el  | 20 ++--
 generic/pg-user.el  | 36 ++---
 generic/pg-xml.el   | 15 +
 generic/proof-depends.el| 15 +
 generic/proof-maths-menu.el |  5 +--
 generic/proof-menu.el   | 33 +++-
 generic/proof-script.el | 42 -
 generic/proof-shell.el  | 30 +-
 generic/proof-syntax.el |  3 +-
 generic/proof-tree.el   | 11 +++
 generic/proof-unicode-tokens.el |  5 +--
 generic/proof-utils.el  |  1 -
 generic/proof.el|  5 ++-
 hol-light/hol-light-autotest.el |  5 +--
 isar/isabelle-system.el |  5 ++-
 isar/isar-autotest.el   |  3 --
 isar/isar-profiling.el  |  3 --
 isar/isar-syntax.el | 10 +++---
 isar/isar-unicode-tokens.el | 10 +++---
 isar/isar.el|  3 --
 lego/lego.el|  5 +--
 lib/holes.el| 69 +++--
 lib/pg-dev.el   |  5 +--
 lib/proof-compat.el |  4 +--
 lib/span.el | 42 -
 lib/texi-docstring-magic.el |  5 +--
 lib/unicode-tokens.el   | 29 -
 obsolete/plastic/plastic.el | 24 +++---
 40 files changed, 252 insertions(+), 308 deletions(-)

diff --git a/coq/coq-autotest.el b/coq/coq-autotest.el
index cecfdcf1..8be4bed9 100644
--- a/coq/coq-autotest.el
+++ b/coq/coq-autotest.el
@@ -3,7 +3,7 @@
 ;; This file is part of Proof General.
 
 ;; Portions © Copyright 1994-2012  David Aspinall and University of Edinburgh
-;; Portions © Copyright 2003, 2012, 2014  Free Software Foundation, Inc.
+;; Portions © Copyright 2003-2018  Free Software Foundation, Inc.
 ;; Portions © Copyright 2001-2017  Pierre Courtieu
 ;; Portions © Copyright 2010, 2016  Erik Martin-Dorel
 ;; Portions © Copyright 2011-2013, 2016-2017  Hendrik Tews
@@ -16,9 +16,6 @@
 
 ;;; Code:
 
-(eval-when-compile
-  (require 'cl))
-
 (require 'pg-autotest)
 
 (require 'proof-site)
diff --git a/coq/coq-compile-common.el b/coq/coq-compile-common.el
index 9dca0082..d29bf1b9 100644
--- a/coq/coq-compile-common.el
+++ b/coq/coq-compile-common.el
@@ -22,6 +22,7 @@
 
 ;;; Code:
 
+(require 'cl-lib)   ;cl-every cl-some
 (require 'proof-shell)
 (require 'coq-system)
 (require 'compile)
@@ -442,7 +443,7 @@ expressions in here are always matched against the .vo file name,
 regardless whether ``-quick'' would be used to compile the file
 or not."
   :type