From a921439a4eb5b0d96182748e779c78e2f6a41a5f Mon Sep 17 00:00:00 2001
From: Stefan Monnier
Date: Tue, 11 Dec 2018 18:48:51 -0500
Subject: Cleanup patch; Moving defvar to toplevel
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.
---
obsolete/plastic/plastic.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'obsolete')
diff --git a/obsolete/plastic/plastic.el b/obsolete/plastic/plastic.el
index f5462ba6..09a61b27 100644
--- a/obsolete/plastic/plastic.el
+++ b/obsolete/plastic/plastic.el
@@ -1,5 +1,7 @@
;; plastic.el - Major mode for Plastic proof assistant
;;
+;; Portions © Copyright 2018 Free Software Foundation, Inc.
+;;
;; Author: Paul Callaghan
;;
;; $Id$
@@ -15,8 +17,8 @@
(require 'cl)
(require 'span)
(require 'proof-syntax)
- (require 'outline)
- (defvar plastic-keymap nil))
+ (require 'outline))
+(defvar plastic-keymap) ;FIXME: Not defined anywhere!
(require 'plastic-syntax)
--
cgit v1.2.3
From 632a3d7f9ded16faaf58e1c0769bcd4f7c8193e3 Mon Sep 17 00:00:00 2001
From: Stefan Monnier
Date: Wed, 12 Dec 2018 15:20:08 -0500
Subject: Use `cl-lib` instead of `cl` everywhere
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.
---
obsolete/plastic/plastic.el | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
(limited to 'obsolete')
diff --git a/obsolete/plastic/plastic.el b/obsolete/plastic/plastic.el
index 09a61b27..cf69a731 100644
--- a/obsolete/plastic/plastic.el
+++ b/obsolete/plastic/plastic.el
@@ -13,8 +13,8 @@
(require 'proof)
+(require 'cl-lib) ;cl-member-if
(eval-when-compile
- (require 'cl)
(require 'span)
(require 'proof-syntax)
(require 'outline))
@@ -229,7 +229,7 @@ Given is the first SPAN which needs to be undone."
(setq i 0)
(while (< i (length string))
(if (string-equal (substring string i (+ i tl)) proof-terminal-string)
- (incf ct))
+ (cl-incf ct))
(setq i (+ 1 i)))))
(setq span (next-span span 'type)))
(list (concat plastic-lit-string
@@ -264,9 +264,9 @@ Given is the first SPAN which needs to be undone."
; (list (concat "Can't Undo imports yet\n"
; "You have to exit Plastic for this\n")
; ["ok, I'll do this" (lambda () t) t]))
- (return)
+ (cl-return) ;FIXME: No enclosing block?!
) ;; warn the user that undo of imports not yet working.
- (t (incf spans))
+ (t (cl-incf spans))
)
(setq span (next-span span 'type))
@@ -453,7 +453,7 @@ Value for `proof-shell-compute-new-files-list', which see.
For Plastic, we assume that module identifiers coincide with file names."
(let ((module (match-string 1)))
- (cdr (member-if
+ (cdr (cl-member-if
(lambda (filename) (plastic-equal-module-filename module filename))
proof-included-files-list))))
@@ -541,33 +541,33 @@ For Plastic, we assume that module identifiers coincide with file names."
(l (length string))
(eat-rest (lambda ()
(aset string i ?\ ) ;; kill the \n or "-" at least
- (incf i)
+ (cl-incf i)
(while (and (< i l) (/= (aref string i) ?\n))
(aset string i ?\ )
- (incf i) )))
+ (cl-incf i) )))
(keep-rest (lambda ()
(loop for x in (string-to-list plastic-lit-string)
- do (aset string i ?\ ) (incf i))
+ do (aset string i ?\ ) (cl-incf i))
(while (and (< i l)
(/= (aref string i) ?\n)
(/= (aref string i) ?-))
- (incf i) ))))
+ (cl-incf i) ))))
(while (< i l)
(cond
((eq 0 (string-match "--" (substring string i)))
(funcall eat-rest)) ; comment.
((eq 0 (string-match "\n\n" (substring string i)))
(aset string i ?\ )
- (incf i)) ; kill repeat \n
+ (cl-incf i)) ; kill repeat \n
((= (aref string i) ?\n) ; start of new line
- (aset string i ?\ ) (incf i) ; remove \n
+ (aset string i ?\ ) (cl-incf i) ; remove \n
(if (eq 0 (string-match plastic-lit-string
(substring string i)))
(funcall keep-rest) ; code line.
(funcall eat-rest) ; non-code line
))
(t
- (incf i)))) ; else include.
+ (cl-incf i)))) ; else include.
(setq string (replace-regexp-in-string " +" " " string))
(setq string (replace-regexp-in-string "^ +" "" string))
(if (string-match "^\\s-*$" string)
--
cgit v1.2.3