[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch to suppress "deprecated cl" warnings plus few others
From: |
Kyle Meyer |
Subject: |
Re: patch to suppress "deprecated cl" warnings plus few others |
Date: |
Wed, 26 Aug 2020 01:05:37 -0400 |
Richard Kim writes:
> Attached patch suppresses byte compiler warnings.
Thanks. contrib/ doesn't receive much love when it comes to these sorts
of things, and byte-compiling its files is not a pretty sight.
> Subject: [PATCH] Suppressed all "deprecated cl" warnings plus few others.
A "contrib: " prefix on this subject would be useful for orienting log
readers.
Convention nit-pick: Drop the period from the subject.
> diff --git a/contrib/lisp/ob-tcl.el b/contrib/lisp/ob-tcl.el
> index 091eb5d09..d269ad38a 100644
> --- a/contrib/lisp/ob-tcl.el
> +++ b/contrib/lisp/ob-tcl.el
> @@ -31,7 +31,7 @@
> ;;; Code:
> (require 'ob)
> (require 'ob-eval)
> -(eval-when-compile (require 'cl))
> +(eval-when-compile (require 'cl-lib))
The byte-compiler complains after your change:
contrib/lisp/ob-tcl.el:129:1:Warning: the following functions are
not known to be defined: case, output, value
These all come from a missed s/case/cl-case/.
> (defvar org-babel-tangle-lang-exts)
> (add-to-list 'org-babel-tangle-lang-exts '("tcl" . "tcl"))
> diff --git a/contrib/lisp/org-choose.el b/contrib/lisp/org-choose.el
> index c1006d095..799fd917f 100644
> --- a/contrib/lisp/org-choose.el
> +++ b/contrib/lisp/org-choose.el
> @@ -62,9 +62,7 @@
> ;;; Requires
>
> (require 'org)
> - ;(eval-when-compile
> - ; (require 'cl))
> -(require 'cl)
> +(require 'cl-lib)
Same applies here. You took care of s/position/cl-position/ below, but
there are a good number of other symbols that now require a prefix:
defstruct, destructuring-bind, incf, pushnew, first, and second.
> ;;; Body
> ;;; The variables
> @@ -357,7 +355,7 @@ setting was changed."
> (defun org-choose-get-index-in-keywords (ix all-keywords)
> "Return the index of the current entry."
> (if ix
> - (position ix all-keywords
> + (cl-position ix all-keywords
> :test #'equal)))
>
I haven't yet looked beyond the first two files, though I suspect the
other files may have similar issues. Could you take a closer look and
send an updated patch?