Skip to content

Commit 65b58b2

Browse files
authored
Fix cl deprecation (#68)
1 parent 1488629 commit 65b58b2

File tree

6 files changed

+33
-35
lines changed

6 files changed

+33
-35
lines changed

gnuplot-context.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233

234234
;; Library dependencies
235235
(eval-when-compile
236-
(require 'cl)
236+
(require 'cl-lib)
237237

238238
;; Prevent compiler warnings about undefined functions
239239
(require 'gnuplot))
@@ -1808,7 +1808,7 @@ there."
18081808
gnuplot-info-at-point nil
18091809
gnuplot-captures nil)
18101810

1811-
(flet ((advance
1811+
(cl-flet ((advance
18121812
()
18131813
(pop tokens)
18141814
(if (and (null tokens) (not completing-p))

gnuplot-debug-context.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
(if gnuplot-captures
100100
(with-gnuplot-trace-buffer
101101
(insert "\n-- * capture groups: * --\n")
102-
(loop for c on gnuplot-captures
102+
(cl-loop for c on gnuplot-captures
103103
do
104104
(let ((name (caar c))
105105
(gnuplot-captures c))

gnuplot-gui.el

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
(require 'widget)
6969
(require 'wid-edit))
7070
(error nil)))
71-
(require 'cl)
71+
(require 'cl-lib)
7272
(eval-when-compile ; suppress some compiler warnings
7373
(defvar gnuplot-quote-character nil)
7474
(defvar gnuplot-info-display nil)
@@ -934,15 +934,15 @@ Note that \"cntrparam\" is not currently supported."
934934
(old-top (gnuplot-gui-get-frame-param 'top)))
935935
(when (or
936936
(and (equal gnuplot-gui-plot-splot-fit-style 'complete)
937-
(member* word '("plot" "splot" "fit")
937+
(cl-member word '("plot" "splot" "fit")
938938
:test 'string=))
939939
(equal word "test"))
940940
(gnuplot-gui-set-frame-param 'height 32)
941941
(gnuplot-gui-set-frame-param 'top 50))
942942
(gnuplot-gui-prompt-for-frame word)
943943
(when (or
944944
(and (equal gnuplot-gui-plot-splot-fit-style 'complete)
945-
(member* word '("plot" "splot" "fit")
945+
(cl-member word '("plot" "splot" "fit")
946946
:test 'string=))
947947
(equal word "test"))
948948
(gnuplot-gui-set-frame-param 'height old-height)
@@ -1011,8 +1011,8 @@ argument, for example an axis label or a font name. It also replaces
10111011
bounding single quotes with double quotes, since double quotes are
10121012
used in `gnuplot-gui-all-types'."
10131013
(let (fixed-list quote quoted) ; remove blanks
1014-
(setq list (remove* "\\s-+" list :test 'string-match)
1015-
list (remove* "" list :test 'string=))
1014+
(setq list (cl-remove "\\s-+" list :test 'string-match)
1015+
list (cl-remove "" list :test 'string=))
10161016
(while list ; concatinate parts of quoted string
10171017
(if (not (string-match "^\\([\]\[()'\"]\\)" (car list)))
10181018
(setq fixed-list (append fixed-list (list (car list))))
@@ -1063,14 +1063,14 @@ arguments."
10631063
(while temp-list
10641064
(cond
10651065
;; ---------------------------- list
1066-
((member* symbol '(list list*) :test 'equal)
1066+
((cl-member symbol '(list list*) :test 'equal)
10671067
(let* ((case-fold-search nil)
1068-
(match-cons (member* (concat "^" (car temp-list))
1068+
(match-cons (cl-member (concat "^" (car temp-list))
10691069
values :test 'string-match)))
10701070
(if (and (car match-cons) ; " " may be first elem. of list
10711071
(not (string= " " (car match-cons))))
10721072
(setq this-cons (cons tag (car match-cons))
1073-
arg-list (remove* (car temp-list) arg-list
1073+
arg-list (cl-remove (car temp-list) arg-list
10741074
:test 'string= :count 1)
10751075
temp-list nil)
10761076
(setq temp-list (cdr temp-list)))))
@@ -1091,16 +1091,16 @@ arguments."
10911091
(cond ((and (string= prefix (car temp-list))
10921092
(string-match "^[-0-9.]+$" (cadr temp-list)))
10931093
(setq this-cons (cons tag (cadr temp-list))
1094-
arg-list (remove* (car temp-list) arg-list
1094+
arg-list (cl-remove (car temp-list) arg-list
10951095
:test 'string= :count 1)
1096-
arg-list (remove* (cadr temp-list) arg-list
1096+
arg-list (cl-remove (cadr temp-list) arg-list
10971097
:test 'string= :count 1)
10981098
temp-list nil))
10991099
;; --------------------- number without prefix
11001100
((and (not prefix)
11011101
(string-match "^[-0-9.]+$" (car temp-list)))
11021102
(setq this-cons (cons tag (car temp-list))
1103-
arg-list (remove* (car temp-list) arg-list
1103+
arg-list (cl-remove (car temp-list) arg-list
11041104
:test 'string= :count 1)
11051105
temp-list nil))
11061106
(t
@@ -1126,7 +1126,7 @@ arguments."
11261126
(setq this-cons
11271127
(cons tag (cons (match-string 1 (car temp-list))
11281128
(match-string 2 (car temp-list))))
1129-
arg-list (remove* (car temp-list) arg-list
1129+
arg-list (cl-remove (car temp-list) arg-list
11301130
:test 'string= :count 1)
11311131
temp-list nil)
11321132
(setq temp-list (cdr temp-list)) ))
@@ -1137,7 +1137,7 @@ arguments."
11371137
")") ; closing paren
11381138
(car temp-list))
11391139
(let* ((list (split-string (car temp-list) "[ \t(),]+"))
1140-
(list (remove* "" list :test 'string=))
1140+
(list (cl-remove "" list :test 'string=))
11411141
(return ()))
11421142
(while list
11431143
(if (string-match "['\"]\\([^'\"]*\\)['\"]" (car list))
@@ -1148,28 +1148,28 @@ arguments."
11481148
(setq return (append return (list "" (car list)))))
11491149
(setq list (cdr list)) )
11501150
(setq this-cons (cons tag return)
1151-
arg-list (remove* (car temp-list) arg-list
1151+
arg-list (cl-remove (car temp-list) arg-list
11521152
:test 'string= :count 1)
11531153
temp-list nil))
11541154
(setq temp-list (cdr temp-list))) )
11551155
;; ---------------------------- string, file, format
1156-
((member* symbol '(string file format) :test 'equal)
1156+
((cl-member symbol '(string file format) :test 'equal)
11571157
(if (string-match (concat "['\"]" ; opening quote
11581158
"\\([^'\"]*\\)" ; string
11591159
"['\"]") ; closing quote
11601160
(car temp-list))
11611161
(setq this-cons (cons tag (match-string 0 (car temp-list)))
1162-
arg-list (remove* (car temp-list) arg-list
1162+
arg-list (cl-remove (car temp-list) arg-list
11631163
:test 'string= :count 1)
11641164
temp-list nil)
11651165
(setq temp-list (cdr temp-list)) ))
11661166
;; ---------------------------- string*
11671167
((equal symbol 'string*)
11681168
(if (string= prefix (car temp-list))
11691169
(setq this-cons (cons tag (cadr temp-list))
1170-
arg-list (remove* (car temp-list) arg-list
1170+
arg-list (cl-remove (car temp-list) arg-list
11711171
:test 'string= :count 1)
1172-
arg-list (remove* (cadr temp-list) arg-list
1172+
arg-list (cl-remove (cadr temp-list) arg-list
11731173
:test 'string= :count 1)
11741174
temp-list nil)
11751175
(setq temp-list (cdr temp-list)) ) )
@@ -1301,19 +1301,19 @@ SAVE-FRAME is non-nil when the widgets are being reset."
13011301
(widget-insert "\t") ; insert the appropriate widget
13021302
(cond
13031303
;;------------------------------ list, list* ------------
1304-
((member* (eval wtype) '(list list*) :test 'equal)
1304+
((cl-member (eval wtype) '(list list*) :test 'equal)
13051305
(let ((starred (if (equal (eval wtype) 'list*) t nil)))
13061306
(gnuplot-gui-menu-choice tag default list starred)))
13071307
;;------------------------------ number, tag, fontsize --
1308-
((member* (eval wtype) '(number tag fontsize) :test 'equal)
1308+
((cl-member (eval wtype) '(number tag fontsize) :test 'equal)
13091309
(gnuplot-gui-number tag default prefix))
13101310
;;------------------------------ position ---------------
13111311
;;------------------------------ range, pair ------------
1312-
((member* (eval wtype) '(range pair) :test 'equal)
1312+
((cl-member (eval wtype) '(range pair) :test 'equal)
13131313
(let ((is-range (equal (eval wtype) 'range)))
13141314
(gnuplot-gui-range tag default prefix is-range)))
13151315
;;------------------------------ string, string* --------
1316-
((member* (eval wtype) '(string string*) :test 'equal)
1316+
((cl-member (eval wtype) '(string string*) :test 'equal)
13171317
(let ((starred (if (equal (eval wtype) 'string) nil t)))
13181318
(gnuplot-gui-string tag default prefix starred)))
13191319
;;------------------------------ format -----------------

gnuplot-test-context.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
(require 'ert)
88

99
(eval-when-compile
10-
(require 'cl)
10+
(require 'cl-lib)
1111
(if (not (fboundp 'ert-deftest))
1212
(defalias 'ert-deftest 'deftest))
1313

gnuplot-tests.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
(require 'gnuplot)
77
(require 'ert)
8-
(eval-when-compile (require 'cl))
8+
(eval-when-compile (require 'cl-lib))
99

1010
;; Hide an annoying interactive message during batch testing
1111
(when (require 'nadvice nil t)
@@ -67,7 +67,7 @@ string-literal in multiple different contexts, as determined by
6767
(declare (indent 1))
6868
`(ert-deftest ,name ()
6969
,string
70-
,@(loop for context in gnuplot-string-test-contexts
70+
,@(cl-loop for context in gnuplot-string-test-contexts
7171
collect
7272
`(should (gnuplot-test-string-in-context ,string ,context)))))
7373

@@ -203,11 +203,11 @@ comment
203203
(when (fboundp 'syntax-propertize)
204204
(syntax-propertize (point-max)))
205205
(goto-char (1+ start))
206-
(flet ((in-comment-p (position)
206+
(cl-flet ((in-comment-p (position)
207207
(nth 4 (syntax-ppss position))))
208208
(and
209209
(not (in-comment-p start))
210-
(loop for position from (1+ start) upto end
210+
(cl-loop for position from (1+ start) upto end
211211
always (in-comment-p position))
212212
(or (= end (point-max))
213213
(not (in-comment-p (1+ end))))))))))
@@ -221,7 +221,7 @@ string-literal in multiple different contexts, as determined by
221221
(declare (indent 1))
222222
`(ert-deftest ,name ()
223223
,comment
224-
,@(loop for context in gnuplot-comment-test-contexts
224+
,@(cl-loop for context in gnuplot-comment-test-contexts
225225
collect
226226
`(should (gnuplot-test-comment-in-context ,comment ,context)))))
227227

gnuplot.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@
199199

200200
(require 'comint)
201201
(require 'easymenu)
202-
;; TODO Fix deprecation
203-
(eval-when-compile (require 'cl))
202+
(eval-when-compile (require 'cl-lib))
204203

205204
(declare-function 'eldoc-add-command "eldoc")
206205

@@ -603,9 +602,8 @@ non-nil."
603602

604603
(defvar gnuplot-mode-menu nil)
605604

606-
;; TODO Fix deprecation
607605
(defvar gnuplot-display-options-menu
608-
(flet ((make-image-setter (type)
606+
(cl-flet ((make-image-setter (type)
609607
`[,(concat (upcase type) " images")
610608
(lambda () (interactive) (gnuplot-set-image-format ,type))
611609
:style toggle

0 commit comments

Comments
 (0)