Subject: bug#56641: Deprecate `lsh`

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sat, 23 Jul 2022 18:42:56 +0300

Mattias Engdegård [2022-07-23 12:32 +0200] wrote:

> There is now a compiler warning about calls to `lsh`.

Thanks, but the warnings are being stubborn with and not listening to
me.  Could you please have a word with them?

First, they are a bit repetitive in parallel 'make -j8 check':

In toplevel form:
lisp/international/ccl-tests.el:29:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:29:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:33:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:33:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:37:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:37:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:41:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:41:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:29:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:33:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:37:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:41:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:29:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:33:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:37:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:41:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:29:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:33:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:37:15: Warning: avoid `lsh'; use `ash' instead
lisp/international/ccl-tests.el:41:15: Warning: avoid `lsh'; use `ash' instead

Note that each warning is emitted five times.  The same happens with
src/data-tests.el.  Some ERT quirk perhaps?

Second, wrapping the respective ert-deftest bodies in
(with-suppressed-warnings ((suspicious lsh)) ...) or
(with-no-warnings ...) does not actually silence the warnings.
Interestingly, suppressing warnings around the whole ert-deftest form
eliminates the duplicate warning lines, but still emits the originals.

Third, the docstring of with-suppressed-warnings says:

  The types that can be suppressed with this macro are
  `free-vars', `callargs', `redefine', `obsolete',
  `interactive-only', `lexical', `mapcar', `constants' and
  `suspicious'.

  For the `mapcar' case, only the `mapcar' function can be used in
  the symbol list.  For `suspicious', only `set-buffer' can be used.
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Fourth, the warnings seem to be nondeterministic, sometimes being
emitted only for one of the two files in question, and sometimes for
neither file (particularly with serial 'make check').

How can these issues be addressed?

Thanks,

-- 
Basil