Skip to content

Commit 43d8d20

Browse files
committed
Remove remaining uses of defunct cl library
1 parent 82da9dc commit 43d8d20

File tree

6 files changed

+39
-39
lines changed

6 files changed

+39
-39
lines changed

purescript-align-imports.el

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@
158158
"Merge together parts of an import statement that shouldn't be separated."
159159
(let ((parts (apply #'vector l))
160160
(join (lambda (ls)
161-
(reduce (lambda (a b)
162-
(concat a
163-
(if (and (> (length a) 0)
164-
(> (length b) 0))
165-
" "
166-
"")
167-
b))
168-
ls))))
161+
(cl-reduce (lambda (a b)
162+
(concat a
163+
(if (and (> (length a) 0)
164+
(> (length b) 0))
165+
" "
166+
"")
167+
b))
168+
ls))))
169169
(if purescript-align-imports-pad-after-name
170170
(list (funcall join (list (aref parts 0)
171171
(aref parts 1)
@@ -195,19 +195,19 @@
195195
"Find the padding for each part of the import statements."
196196
(if (null imports)
197197
imports
198-
(reduce (lambda (a b) (mapcar* #'max a b))
199-
(mapcar (lambda (x) (mapcar #'length (car x)))
200-
imports))))
198+
(cl-reduce (lambda (a b) (cl-mapcar #'max a b))
199+
(mapcar (lambda (x) (mapcar #'length (car x)))
200+
imports))))
201201

202202
(defun purescript-align-imports-fill (padding line)
203203
"Fill an import line using the padding worked out from all statements."
204204
(mapconcat #'identity
205-
(mapcar* (lambda (pad part)
206-
(if (> (length part) 0)
207-
(concat part (make-string (- pad (length part)) ? ))
208-
(make-string pad ? )))
209-
padding
210-
line)
205+
(cl-mapcar (lambda (pad part)
206+
(if (> (length part) 0)
207+
(concat part (make-string (- pad (length part)) ? ))
208+
(make-string pad ? )))
209+
padding
210+
line)
211211
" "))
212212

213213
(defun purescript-align-imports-line-match-it ()

purescript-font-lock.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
(require 'purescript-mode)
9191
(require 'font-lock)
92-
(with-no-warnings (require 'cl))
92+
(require 'cl-lib)
9393

9494
(defcustom purescript-font-lock-symbols nil
9595
"Display \\ and -> and such using symbols in fonts.
@@ -382,7 +382,7 @@ Returns keywords suitable for `font-lock-keywords'."
382382
purescript-constructor-face
383383
purescript-operator-face))))
384384
(unless (boundp 'font-lock-syntactic-keywords)
385-
(case literate
385+
(cl-case literate
386386
(bird
387387
(setq keywords
388388
`(("^[^>\n].*$" 0 purescript-comment-face t)
@@ -543,14 +543,14 @@ that should be commented under LaTeX-style literate scripts."
543543
;;;###autoload
544544
(defun purescript-font-lock-choose-keywords ()
545545
(let ((literate (if (boundp 'purescript-literate) purescript-literate)))
546-
(case literate
546+
(cl-case literate
547547
(bird purescript-font-lock-bird-literate-keywords)
548548
((latex tex) purescript-font-lock-latex-literate-keywords)
549549
(t purescript-font-lock-keywords))))
550550

551551
(defun purescript-font-lock-choose-syntactic-keywords ()
552552
(let ((literate (if (boundp 'purescript-literate) purescript-literate)))
553-
(case literate
553+
(cl-case literate
554554
(bird purescript-bird-syntactic-keywords)
555555
((latex tex) purescript-latex-syntactic-keywords)
556556
(t purescript-basic-syntactic-keywords))))

purescript-indent.el

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
;;; Code:
9090

9191
(require 'purescript-string)
92-
(with-no-warnings (require 'cl))
92+
(require 'cl-lib)
9393

9494
(defvar purescript-literate)
9595

@@ -267,7 +267,7 @@ If so, return its start; otherwise return nil:
267267
If it is Bird-style, then return the position of the >;
268268
otherwise return the ending position of \\begin{code}."
269269
(save-excursion
270-
(case purescript-literate
270+
(cl-case purescript-literate
271271
(bird
272272
(beginning-of-line)
273273
(if (or (eq (following-char) ?\>)
@@ -374,7 +374,7 @@ location of the opening symbol, nil otherwise."
374374
"Check, starting from START, if END is at or within a comment.
375375
Returns the location of the start of the comment, nil otherwise."
376376
(let (pps)
377-
(assert (<= start end))
377+
(cl-assert (<= start end))
378378
(cond ((= start end) nil)
379379
((nth 4 (save-excursion (setq pps (parse-partial-sexp start end))))
380380
(nth 8 pps))
@@ -580,7 +580,7 @@ Returns the location of the start of the comment, nil otherwise."
580580
(if rpurs-sign (purescript-indent-push-pos rpurs-sign)
581581
(purescript-indent-push-pos-offset valname))
582582
(purescript-indent-push-pos-offset valname)))
583-
(case ; general case
583+
(cl-case ; general case
584584
(purescript-indent-find-case test)
585585
;; "1.1.11" 1= vn gd rh arh
586586
(1 (purescript-indent-push-pos valname)
@@ -681,7 +681,7 @@ Returns the location of the start of the comment, nil otherwise."
681681
(purescript-indent-push-pos-offset valname))))
682682
(if (string= purescript-indent-current-line-first-ident "::")
683683
(if valname (purescript-indent-push-pos valname))
684-
(case ; general case
684+
(cl-case ; general case
685685
(purescript-indent-find-case test)
686686
;; "1.1.11" 1= vn gd rh arh
687687
(1 (if is-where
@@ -776,7 +776,7 @@ than an identifier, a guard or rpurs."
776776
(if (and valname-string ; special case for start keywords
777777
(string-match purescript-indent-start-keywords-re valname-string))
778778
(purescript-indent-push-pos-offset valname)
779-
(case ; general case
779+
(cl-case ; general case
780780
(purescript-indent-find-case test)
781781
;; "1.1.11" 1= vn gd rh arh
782782
(1 (purescript-indent-push-pos aft-rpurs-sign))
@@ -819,11 +819,11 @@ than an identifier, a guard or rpurs."
819819
purescript-indent-info)))
820820

821821
(defun purescript-indent-valdef-indentation (start end end-visible curr-line-type
822-
indent-info)
822+
indent-info)
823823
"Find indentation information for a value definition."
824824
(let ((purescript-indent-info indent-info))
825825
(if (< start end-visible)
826-
(case curr-line-type
826+
(cl-case curr-line-type
827827
(empty (purescript-indent-empty start end end-visible indent-info))
828828
(ident (purescript-indent-ident start end end-visible indent-info))
829829
(guard (purescript-indent-guard start end end-visible indent-info))
@@ -839,7 +839,7 @@ Separate a line of program into valdefs between offside keywords
839839
and find indentation info for each part."
840840
(save-excursion
841841
;; point is (already) at line-start
842-
(assert (eq (point) line-start))
842+
(cl-assert (eq (point) line-start))
843843
(let ((purescript-indent-info indent-info)
844844
(start (or (purescript-indent-in-comment line-start line-end)
845845
(purescript-indent-in-string line-start line-end))))
@@ -1025,7 +1025,7 @@ See http://hackage.purescript.org/trac/purescript-prime/wiki/DoAndIfThenElse"
10251025
(defun purescript-indent-closing-keyword (start)
10261026
(let ((open (save-excursion
10271027
(purescript-indent-find-matching-start
1028-
(case (char-after)
1028+
(cl-case (char-after)
10291029
(?i "\\<\\(?:\\(in\\)\\|let\\)\\>")
10301030
(?o "\\<\\(?:\\(of\\)\\|case\\)\\>")
10311031
(?t "\\<\\(?:\\(then\\)\\|if\\)\\>")

purescript-indentation.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
;;; Code:
3434

3535
(require 'syntax)
36-
(with-no-warnings (require 'cl))
36+
(require 'cl-lib)
3737

3838
(defvar delete-active-region)
3939

@@ -178,7 +178,7 @@ autofill-mode."
178178
(while (< (point) start)
179179
(if (= (char-after) ?\t)
180180
(setq cc (* 8 (+ 1 (/ cc 8))))
181-
(incf cc))
181+
(cl-incf cc))
182182
(forward-char))
183183
cc)))
184184

purescript-package.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
;;; Code:
2929

30-
(with-no-warnings (require 'cl))
30+
(require 'cl-lib)
3131

3232
;; Dynamically scoped variables.
3333
;; TODO What actually sets this?
@@ -72,7 +72,7 @@
7272
name
7373
version))))
7474

75-
(defstruct purescript-package "PureScript package object.")
75+
(cl-defstruct purescript-package "PureScript package object.")
7676

7777
(defun purescript-package-parse (text)
7878
"Parse a package into a package object."
@@ -147,7 +147,7 @@
147147
(lambda (line)
148148
(string-match "^{?\\([a-zA-Z0-9-_]+\\)-\\([0-9.]+\\)}?$" line)
149149
(cons (match-string 1 line) (match-string 2 line)))
150-
(delete-if
150+
(cl-delete-if
151151
(lambda (line)
152152
(not (string-match "^{?[a-zA-Z0-9-_]+-[0-9.]+}?$" line)))
153153
lines))))

purescript-show.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
(defvar sexp-show "sexp-show")
3333
(require 'purescript-string)
34-
(with-no-warnings (require 'cl))
34+
(require 'cl-lib)
3535

3636
(defun purescript-show-replace-region ()
3737
"Replace the given region with a pretty printed version."
@@ -76,7 +76,7 @@
7676

7777
(defun purescript-show-insert-pretty (column tree &optional parens)
7878
"Insert a Show `tree' into the current buffer with collapsible nodes."
79-
(case (car tree)
79+
(cl-case (car tree)
8080
('list (let ((start (point)))
8181
(insert "[")
8282
(purescript-show-mapcar/i (lambda (x i len)
@@ -196,7 +196,7 @@
196196

197197
(defun purescript-show-pretty (tree &optional parens)
198198
"Show a Show `tree'."
199-
(case (car tree)
199+
(cl-case (car tree)
200200
('list (format "[%s]"
201201
(mapconcat
202202
(lambda (x)

0 commit comments

Comments
 (0)