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 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. --- lib/unicode-tokens.el | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'lib/unicode-tokens.el') diff --git a/lib/unicode-tokens.el b/lib/unicode-tokens.el index 4d1d0d35..41f478d1 100644 --- a/lib/unicode-tokens.el +++ b/lib/unicode-tokens.el @@ -46,7 +46,7 @@ ;;; Code: -(require 'cl) +(require 'cl-lib) (require 'quail) (eval-when-compile @@ -429,12 +429,12 @@ This function also initialises the important tables for the mode." ;; hairy logic based on Coq-style vs Isabelle-style configs (if (string= "" (format unicode-tokens-token-format "")) ;; no special token format, parse separate words/symbols - (let* ((tokextra (remove* "^\\(?:\\sw\\|\\s_\\)+$" toks :test 'string-match)) - (toksymbwrd (set-difference toks tokextra)) + (let* ((tokextra (cl-remove "^\\(?:\\sw\\|\\s_\\)+$" toks :test 'string-match)) + (toksymbwrd (cl-set-difference toks tokextra)) ;; indentifier that are not pure words - (toksymb (remove* "^\\(?:\\sw\\)+$" toksymbwrd :test 'string-match)) + (toksymb (cl-remove "^\\(?:\\sw\\)+$" toksymbwrd :test 'string-match)) ;; pure words - (tokwrd (set-difference toksymbwrd toksymb)) + (tokwrd (cl-set-difference toksymbwrd toksymb)) (idorop (concat "\\(\\_<" (regexp-opt toksymb) @@ -461,9 +461,9 @@ This function also initialises the important tables for the mode." The check is with `char-displayable-p'." (cond ((stringp comp) - (reduce (lambda (x y) (and x (char-displayable-p y))) - comp - :initial-value t)) + (cl-reduce (lambda (x y) (and x (char-displayable-p y))) + comp + :initial-value t)) ((characterp comp) (char-displayable-p comp)) (comp ;; assume any other non-null is OK @@ -518,7 +518,7 @@ The face property is set to the :family and :slant attriubutes taken from (car props) (cadr props)) (setq props (cddr props))))) (unless (or unicode-tokens-show-symbols - (intersection unicode-tokens-fonts propsyms)) + (cl-intersection unicode-tokens-fonts propsyms)) (font-lock-append-text-property start end 'face ;; just use family and slant to enhance merging with other faces @@ -680,7 +680,7 @@ Calculated from `unicode-tokens-token-name-alist' and `unicode-tokens-shortcut-alist'." (let ((unicode-tokens-quail-define-rules (list 'quail-define-rules))) - (let ((ulist (copy-list unicode-tokens-shortcut-alist)) + (let ((ulist (copy-sequence unicode-tokens-shortcut-alist)) ustring shortcut) (setq ulist (sort ulist 'unicode-tokens-map-ordering)) (while ulist @@ -714,7 +714,7 @@ Available annotations chosen from `unicode-tokens-control-regions'." "Annotate region with: " unicode-tokens-control-regions nil 'requirematch)))) - (assert (assoc name unicode-tokens-control-regions)) + (cl-assert (assoc name unicode-tokens-control-regions)) (let* ((entry (assoc name unicode-tokens-control-regions)) (beg (region-beginning)) (end (region-end)) @@ -736,7 +736,7 @@ Available annotations chosen from `unicode-tokens-control-regions'." "Insert control symbol: " unicode-tokens-control-characters nil 'requirematch))) - (assert (assoc name unicode-tokens-control-characters)) + (cl-assert (assoc name unicode-tokens-control-characters)) (insert (format unicode-tokens-control-char-format (cadr (assoc name unicode-tokens-control-characters))))) @@ -833,7 +833,8 @@ but multiple characters in the underlying buffer." (error "Cannot find token before point")) (when token (let* ((tokennumber - (search (list token) unicode-tokens-token-list :test 'equal)) + (cl-search (list token) unicode-tokens-token-list + :test #'equal)) (numtoks (hash-table-count unicode-tokens-hash-table)) (newtok @@ -943,7 +944,7 @@ Starts from point." 'face 'header-line)) (insert " ")) - (incf count) + (cl-incf count) (if (null toks) (insert " ") (insert-text-button -- cgit v1.2.3