aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/obsolete
diff options
context:
space:
mode:
authorStefan Kangas2020-12-02 10:19:16 +0100
committerStefan Kangas2020-12-02 10:19:16 +0100
commited1730718f17832d8ee22ea79bedcfa37eedbfb5 (patch)
tree02faf12f36d25093558cf4186249c588dfa87f9b /lisp/obsolete
parent5f45fc7ee24d025a6292bca82c4eed556be76e77 (diff)
downloademacs-ed1730718f17832d8ee22ea79bedcfa37eedbfb5.tar.gz
emacs-ed1730718f17832d8ee22ea79bedcfa37eedbfb5.zip
Remove specific byte-compiler warnings for cl.el
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types) (byte-compile-warnings, byte-compile-cl-file-p) (byte-compile-eval, byte-compile-eval-before-compile) (byte-compile-arglist-warn, byte-compile-find-cl-functions) (byte-compile-cl-warn, displaying-byte-compile-warnings) (byte-compile-file-form-require, byte-compile-form): Remove all specific cl.el warnings, as that library is now obsolete. The regular obsoletion warnings are sufficiently discouraging. * lisp/emacs-lisp/advice.el (ad-compile-function): Don't try to silence the now removed warning. * doc/lispref/tips.texi (Coding Conventions): * doc/misc/cl.texi (Organization): Make recommendation to not use cl.el and cl-compat.el stronger. * lisp/obsolete/cl.el: Make alias help say that they are obsolete. * lisp/obsolete/cl-compat.el (build-klist, safe-idiv) (pair-with-newsyms): Silence byte-compiler.
Diffstat (limited to 'lisp/obsolete')
-rw-r--r--lisp/obsolete/cl-compat.el17
-rw-r--r--lisp/obsolete/cl.el4
2 files changed, 12 insertions, 9 deletions
diff --git a/lisp/obsolete/cl-compat.el b/lisp/obsolete/cl-compat.el
index b2471523d14..c37fc8eb5bb 100644
--- a/lisp/obsolete/cl-compat.el
+++ b/lisp/obsolete/cl-compat.el
@@ -111,8 +111,9 @@
111(defun build-klist (arglist keys &optional allow-others) 111(defun build-klist (arglist keys &optional allow-others)
112 (let ((res (Multiple-value-call 'mapcar* 'cons (unzip-lists arglist)))) 112 (let ((res (Multiple-value-call 'mapcar* 'cons (unzip-lists arglist))))
113 (or allow-others 113 (or allow-others
114 (let ((bad (set-difference (mapcar 'car res) keys))) 114 (with-suppressed-warnings ((obsolete set-difference))
115 (if bad (error "Bad keywords: %s not in %s" bad keys)))) 115 (let ((bad (set-difference (mapcar 'car res) keys)))
116 (if bad (error "Bad keywords: %s not in %s" bad keys)))))
116 res)) 117 res))
117 118
118(defun extract-from-klist (klist key &optional def) 119(defun extract-from-klist (klist key &optional def)
@@ -130,16 +131,18 @@
130 (funcall (or test 'eql) item elt)))) 131 (funcall (or test 'eql) item elt))))
131 132
132(defun safe-idiv (a b) 133(defun safe-idiv (a b)
133 (let* ((q (/ (abs a) (abs b))) 134 (with-suppressed-warnings ((obsolete signum))
134 (s (* (signum a) (signum b)))) 135 (let* ((q (/ (abs a) (abs b)))
135 (Values q (- a (* s q b)) s))) 136 (s (* (signum a) (signum b))))
137 (Values q (- a (* s q b)) s))))
136 138
137 139
138;; Internal routines. 140;; Internal routines.
139 141
140(defun pair-with-newsyms (oldforms) 142(defun pair-with-newsyms (oldforms)
141 (let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms))) 143 (with-suppressed-warnings ((obsolete mapcar*))
142 (Values (mapcar* 'list newsyms oldforms) newsyms))) 144 (let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms)))
145 (Values (mapcar* 'list newsyms oldforms) newsyms))))
143 146
144(defun zip-lists (evens odds) 147(defun zip-lists (evens odds)
145 (cl-mapcan 'list evens odds)) 148 (cl-mapcan 'list evens odds))
diff --git a/lisp/obsolete/cl.el b/lisp/obsolete/cl.el
index 20bffffd781..6a628f305cf 100644
--- a/lisp/obsolete/cl.el
+++ b/lisp/obsolete/cl.el
@@ -113,7 +113,7 @@
113 most-positive-float 113 most-positive-float
114 ;; custom-print-functions 114 ;; custom-print-functions
115 )) 115 ))
116 (defvaralias var (intern (format "cl-%s" var)))) 116 (define-obsolete-variable-alias var (intern (format "cl-%s" var)) "27.1"))
117 117
118(dolist (fun '( 118(dolist (fun '(
119 (get* . cl-get) 119 (get* . cl-get)
@@ -291,7 +291,7 @@
291 )) 291 ))
292 (let ((new (if (consp fun) (prog1 (cdr fun) (setq fun (car fun))) 292 (let ((new (if (consp fun) (prog1 (cdr fun) (setq fun (car fun)))
293 (intern (format "cl-%s" fun))))) 293 (intern (format "cl-%s" fun)))))
294 (defalias fun new))) 294 (define-obsolete-function-alias fun new "27.1")))
295 295
296(defun cl--wrap-in-nil-block (fun &rest args) 296(defun cl--wrap-in-nil-block (fun &rest args)
297 `(cl-block nil ,(apply fun args))) 297 `(cl-block nil ,(apply fun args)))