GNU bug report logs - #56641
Deprecate `lsh`

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Tue, 19 Jul 2022 13:39:01 UTC

Severity: normal

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56641 in the body.
You can then email your comments to 56641 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Tue, 19 Jul 2022 13:39:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mattias Engdegård <mattiase <at> acm.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 19 Jul 2022 13:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Emacs Bug Report <bug-gnu-emacs <at> gnu.org>
Subject: Deprecate `lsh`
Date: Tue, 19 Jul 2022 15:38:29 +0200
The function `lsh` works almost like `ash` but is much slower, cannot be constant-folded by the compiler, and above all has confusing semantics for historical reasons. Using `lsh` instead of `ash` is always a mistake.

For these reasons we should deprecate `lsh`. It is not important to remove it as soon as possible, but to dissuade people from accidentally using it in their code.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Tue, 19 Jul 2022 13:53:03 GMT) Full text and rfc822 format available.

Message #8 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Tue, 19 Jul 2022 16:52:03 +0300
> From: Mattias Engdegård <mattiase <at> acm.org>
> Date: Tue, 19 Jul 2022 15:38:29 +0200
> 
> The function `lsh` works almost like `ash` but is much slower, cannot be constant-folded by the compiler, and above all has confusing semantics for historical reasons. Using `lsh` instead of `ash` is always a mistake.
> 
> For these reasons we should deprecate `lsh`. It is not important to remove it as soon as possible, but to dissuade people from accidentally using it in their code.

The ELisp manual already says that ash is a better alternative, but
lsh has its niche, and I see no reason to deprecate it more than the
manual already does.

So, no, please let's not.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Tue, 19 Jul 2022 14:45:02 GMT) Full text and rfc822 format available.

Message #11 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>,
 Mattias Engdegård <mattiase <at> acm.org>
Cc: 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Tue, 19 Jul 2022 10:44:18 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

> The ELisp manual already says that ash is a better alternative, but
> lsh has its niche,

When would I want to use `lsh' over `ash'?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Tue, 19 Jul 2022 15:42:02 GMT) Full text and rfc822 format available.

Message #14 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: mattiase <at> acm.org, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Tue, 19 Jul 2022 18:40:38 +0300
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Tue, 19 Jul 2022 10:44:18 -0400
> Cc: 56641 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > The ELisp manual already says that ash is a better alternative, but
> > lsh has its niche,
> 
> When would I want to use `lsh' over `ash'?

When you want the results that lsh gives you.

They don't yield the same results in all situations.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Tue, 19 Jul 2022 15:54:01 GMT) Full text and rfc822 format available.

Message #17 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Tue, 19 Jul 2022 17:53:48 +0200
19 juli 2022 kl. 16.44 skrev Stefan Kangas <stefankangas <at> gmail.com>:

> When would I want to use `lsh' over `ash'?

Never, of course, but we shouldn't remove `lsh` as long as it's needed for compatibility with old packages that make pre-bignum assumptions, which is the reason for its existence (and semantics) in the first place.

And that's fine -- `lsh` can be kept indefinitely. However, I just removed several calls to `lsh` from new code in Emacs so evidently we need to up our information efforts a notch.

Adding a few words to the doc string may suffice, but a byte-compiler warning would help.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Tue, 19 Jul 2022 16:21:02 GMT) Full text and rfc822 format available.

Message #20 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Tue, 19 Jul 2022 12:20:01 -0400
Mattias Engdegård <mattiase <at> acm.org> writes:

> Adding a few words to the doc string may suffice, but a byte-compiler
> warning would help.

What we have done in such cases is declare it obsolete but add a comment
that we want to keep it around for longer.  See `interactive-p', that
was not deleted in Emacs 28 despite having been obsolete for over a
decade.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Tue, 19 Jul 2022 16:40:02 GMT) Full text and rfc822 format available.

Message #23 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: mattiase <at> acm.org, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Tue, 19 Jul 2022 19:38:46 +0300
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Tue, 19 Jul 2022 12:20:01 -0400
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 56641 <at> debbugs.gnu.org
> 
> Mattias Engdegård <mattiase <at> acm.org> writes:
> 
> > Adding a few words to the doc string may suffice, but a byte-compiler
> > warning would help.
> 
> What we have done in such cases is declare it obsolete but add a comment
> that we want to keep it around for longer.  See `interactive-p', that
> was not deleted in Emacs 28 despite having been obsolete for over a
> decade.

This is not what "obsolete" means and is about, so let's not abuse it
for this purpose.

I'm okay with introducing some new special attribute for such cases,
i.e. when the use of a function or a variable is discouraged for
whatever reasons, so that the byte-compiler could warn about that.
Just let's not called them "obsolete", because they aren't.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Wed, 20 Jul 2022 01:27:01 GMT) Full text and rfc822 format available.

Message #26 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mattiase <at> acm.org, Stefan Kangas <stefankangas <at> gmail.com>,
 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Wed, 20 Jul 2022 09:25:49 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> I'm okay with introducing some new special attribute for such cases,
> i.e. when the use of a function or a variable is discouraged for
> whatever reasons, so that the byte-compiler could warn about that.
> Just let's not called them "obsolete", because they aren't.

Having the byte compiler warn when someone uses lsh would be very
annoying.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Wed, 20 Jul 2022 02:37:02 GMT) Full text and rfc822 format available.

Message #29 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: mattiase <at> acm.org, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Wed, 20 Jul 2022 05:36:30 +0300
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: Stefan Kangas <stefankangas <at> gmail.com>,  mattiase <at> acm.org,
>   56641 <at> debbugs.gnu.org
> Date: Wed, 20 Jul 2022 09:25:49 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > I'm okay with introducing some new special attribute for such cases,
> > i.e. when the use of a function or a variable is discouraged for
> > whatever reasons, so that the byte-compiler could warn about that.
> > Just let's not called them "obsolete", because they aren't.
> 
> Having the byte compiler warn when someone uses lsh would be very
> annoying.

If it's rare enough (as it should be), I don't see the annoyance.  Am
I missing something?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Wed, 20 Jul 2022 03:21:01 GMT) Full text and rfc822 format available.

Message #32 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mattiase <at> acm.org, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Wed, 20 Jul 2022 11:20:14 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> If it's rare enough (as it should be), I don't see the annoyance.  Am
> I missing something?

It might be rare, but there's nothing wrong with using lsh for its
intended purpose, which is handling negative numbers correctly in
several different situations.

Byte-compiler warnings are supposed to point out problems.  Using lsh is
not a problem, using lsh incorrectly is, so it should not issue warnings
for all uses of lsh.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Wed, 20 Jul 2022 11:26:02 GMT) Full text and rfc822 format available.

Message #35 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: mattiase <at> acm.org, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Wed, 20 Jul 2022 14:24:50 +0300
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: stefankangas <at> gmail.com,  mattiase <at> acm.org,  56641 <at> debbugs.gnu.org
> Date: Wed, 20 Jul 2022 11:20:14 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > If it's rare enough (as it should be), I don't see the annoyance.  Am
> > I missing something?
> 
> It might be rare, but there's nothing wrong with using lsh for its
> intended purpose, which is handling negative numbers correctly in
> several different situations.

The point is that people could use lsh because they don't realize they
could use ash instead.  If one really must use lsh, there's always
with-no-warnings, which is IMO fine for the rare situations where it's
needed.

> Byte-compiler warnings are supposed to point out problems.

And this could indeed be a problem: that the programmer is not aware
of a better alternative.

So I don't see a problem with warning in this case, I just don't want
us to pretend this function is "obsolete", because it isn't.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Wed, 20 Jul 2022 11:58:02 GMT) Full text and rfc822 format available.

Message #38 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Wed, 20 Jul 2022 13:57:27 +0200
20 juli 2022 kl. 05.20 skrev Po Lu <luangruo <at> yahoo.com>:

> It might be rare, but there's nothing wrong with using lsh for its
> intended purpose, which is handling negative numbers correctly in
> several different situations.

The purpose of `lsh` is not breaking old code. (It used to have a different purpose but it vanished when bignums were introduced.)
There is no reasonable use for it in new code. Even in the unlikely event of code that just happens to need that sort of quirky behaviour, it is much better implemented explicitly where it's used, in terms of `ash`.

> Byte-compiler warnings are supposed to point out problems.  Using lsh is
> not a problem

You are right that most uses of `lsh` are perfectly innocuous but that's because they are used in a way where `ash` would give the same result. This is often true even when the return values of `lsh` and `ash` differ, as in

  (logand (lsh x -16) #xff)

which would give the same result even for negative x if `lsh` were replaced with `ash`.

However there is a potential problem since the behaviour of `lsh` is strongly platform-dependent, and it's impossible to write correct code without taking that into account (consider replacing -16 with -24 above). Users may not be aware of how it works and mistakenly think it is the 'unsigned' or 'logical' shift that they know from other languages.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Wed, 20 Jul 2022 12:23:01 GMT) Full text and rfc822 format available.

Message #41 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Wed, 20 Jul 2022 20:21:59 +0800
Mattias Engdegård <mattiase <at> acm.org> writes:

> The purpose of `lsh` is not breaking old code. (It used to have a
> different purpose but it vanished when bignums were introduced.)
> There is no reasonable use for it in new code.

So you're saying there is no possible use for expecting the value of
this:

  (lsh most-negative-fixnum -1)

to become:

  #x1000000000000000

> Even in the unlikely event of code that just happens to need that sort
> of quirky behaviour, it is much better implemented explicitly where
> it's used, in terms of `ash`.

Why is that better? What business does the byte compiler, or some idea
of "platform independence" have in dictating that I should write extra
code (instead of using something built-in) to implement a network
protocol?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Wed, 20 Jul 2022 12:46:02 GMT) Full text and rfc822 format available.

Message #44 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: mattiase <at> acm.org, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Wed, 20 Jul 2022 15:44:50 +0300
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  stefankangas <at> gmail.com,
>   56641 <at> debbugs.gnu.org
> Date: Wed, 20 Jul 2022 20:21:59 +0800
> 
> What business does the byte compiler, or some idea of "platform
> independence" have in dictating that I should write extra code
> (instead of using something built-in) to implement a network
> protocol?

It isn't the byte compiler, it's us the Emacs developers.

And no, you don't need to write any extra code, as long as you are
prepared to ignore the warnings.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Wed, 20 Jul 2022 14:31:02 GMT) Full text and rfc822 format available.

Message #47 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Wed, 20 Jul 2022 16:30:25 +0200
20 juli 2022 kl. 14.21 skrev Po Lu <luangruo <at> yahoo.com>:

> So you're saying there is no possible use for expecting the value of
> this:
> 
>  (lsh most-negative-fixnum -1)
> 
> to become:
> 
>  #x1000000000000000

That is only true when Emacs has been built for 62-bit fixnums. And no, I don't see an obvious use other than for compatibility.

> What business does the byte compiler, or some idea
> of "platform independence" have in dictating that I should write extra
> code (instead of using something built-in) to implement a network
> protocol?

It sounds as if we are talking past one another. If you have a network protocol that is somehow defined in terms of the size of fixnums in a particular build of Emacs, then yes, I'd say that most people would think that your code should make that explicit.

But you certainly don't need lsh to handle arbitrary binary data; it's not even convenient. I'm not saying that you are wrong; perhaps I don't understand your needs.

We could add functions for depositing and extracting bit fields in an integer, basically encapsulating the common shift-and-mask operations. That would make bit field manipulation less error-prone without compromising speed or portability.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Thu, 21 Jul 2022 01:45:01 GMT) Full text and rfc822 format available.

Message #50 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Thu, 21 Jul 2022 09:43:44 +0800
Mattias Engdegård <mattiase <at> acm.org> writes:

> That is only true when Emacs has been built for 62-bit fixnums. And
> no, I don't see an obvious use other than for compatibility.

Which is the obvious use? For compatibility with programs (not
necessarily within Emacs) that expect different values based on the
number of VALBITs in the Emacs machine file?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Thu, 21 Jul 2022 07:48:02 GMT) Full text and rfc822 format available.

Message #53 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Thu, 21 Jul 2022 09:47:52 +0200
21 juli 2022 kl. 03.43 skrev Po Lu <luangruo <at> yahoo.com>:

> Which is the obvious use? For compatibility with programs (not
> necessarily within Emacs) that expect different values based on the
> number of VALBITs in the Emacs machine file?

Honestly I don't know. Even before Emacs 27, `lsh` seems a bit questionable since the width is both platform-dependent and unlike C, say, isn't a particularly useful size. It doesn't correspond to anything in hardware, isn't a power of two or anything like that.

It could be code that expects (lsh x -29) to return the sign bit as 1 or 0, as some kind of 'optimisation', what do I know.

Also see bug#32463 for some discussion about lsh during the transition to bignums. Basically everyone agreed that it's useless but that it probably needs to be kept for compatibility in some way.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Sat, 23 Jul 2022 07:27:01 GMT) Full text and rfc822 format available.

Message #56 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Sat, 23 Jul 2022 09:26:04 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> The function `lsh` works almost like `ash` but is much slower, cannot
> be constant-folded by the compiler, and above all has confusing
> semantics for historical reasons. Using `lsh` instead of `ash` is
> always a mistake.
>
> For these reasons we should deprecate `lsh`. It is not important to
> remove it as soon as possible, but to dissuade people from
> accidentally using it in their code.

I agree.  I think the presence of `lsh' just confuses people.  Even when
Emacs didn't have bignums it was pretty odd, but I have absolutely no
idea what any theoretical use case would be today.





Reply sent to Mattias Engdegård <mattiase <at> acm.org>:
You have taken responsibility. (Sat, 23 Jul 2022 10:33:02 GMT) Full text and rfc822 format available.

Notification sent to Mattias Engdegård <mattiase <at> acm.org>:
bug acknowledged by developer. (Sat, 23 Jul 2022 10:33:02 GMT) Full text and rfc822 format available.

Message #61 received at 56641-done <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 56641-done <at> debbugs.gnu.org, Wilson Snyder <wsnyder <at> wsnyder.org>
Subject: Re: bug#56641: Deprecate `lsh`
Date: Sat, 23 Jul 2022 12:32:24 +0200
There is now a compiler warning about calls to `lsh`.

Although we usually defer changes in verilog-mode.el to the maintainer for keeping in sync with the upstream version, I made the necessary (trivial) adjustments to keep warnings away.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Sat, 23 Jul 2022 11:21:02 GMT) Full text and rfc822 format available.

Message #64 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 'Eli Zaretskii' <eliz <at> gnu.org>, Wilson Snyder <wsnyder <at> wsnyder.org>,
 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Sat, 23 Jul 2022 13:20:22 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

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

Eli didn't agree with that, I think?  I was just expressing an opinion,
and not, er, like saying "go forth and deprecate".  :-/  Sorry for being
unclear.

Let's see what Eli says...





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Sat, 23 Jul 2022 13:19:02 GMT) Full text and rfc822 format available.

Message #67 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: mattiase <at> acm.org, wsnyder <at> wsnyder.org, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Sat, 23 Jul 2022 16:18:25 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: 56641 <at> debbugs.gnu.org,  Wilson Snyder <wsnyder <at> wsnyder.org>, "'Eli
>  Zaretskii'" <eliz <at> gnu.org>
> Date: Sat, 23 Jul 2022 13:20:22 +0200
> 
> Mattias Engdegård <mattiase <at> acm.org> writes:
> 
> > There is now a compiler warning about calls to `lsh`.
> 
> Eli didn't agree with that, I think?  I was just expressing an opinion,
> and not, er, like saying "go forth and deprecate".  :-/  Sorry for being
> unclear.
> 
> Let's see what Eli says...

No, I just said the warning shouldn't be about obsoletion.  What's in
the code is fine by me, it just says to use 'ash' instead.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Sat, 23 Jul 2022 13:21:02 GMT) Full text and rfc822 format available.

Message #70 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mattiase <at> acm.org, wsnyder <at> wsnyder.org, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Sat, 23 Jul 2022 15:20:20 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> No, I just said the warning shouldn't be about obsoletion.  What's in
> the code is fine by me, it just says to use 'ash' instead.

Ah, OK.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Sat, 23 Jul 2022 15:44:01 GMT) Full text and rfc822 format available.

Message #73 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: 56641 <at> debbugs.gnu.org
Cc: mattiase <at> acm.org
Subject: Re: bug#56641: Deprecate `lsh`
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Sat, 23 Jul 2022 16:52:01 GMT) Full text and rfc822 format available.

Message #76 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Sat, 23 Jul 2022 18:51:14 +0200
23 juli 2022 kl. 17.42 skrev Basil L. Contovounesios <contovob <at> tcd.ie>:

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

A serious conversation was held and some very frank words were pronounced.

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

That was made on purpose to really hammer the point home.

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

Clearly you aren't suspicious enough.

> How can these issues be addressed?

Why, `git pull` of course!

(Sorry about all this, and thanks a lot!)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56641; Package emacs. (Sun, 24 Jul 2022 03:39:02 GMT) Full text and rfc822 format available.

Message #79 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Sun, 24 Jul 2022 06:38:08 +0300
Mattias Engdegård [2022-07-23 18:51 +0200] wrote:

> 23 juli 2022 kl. 17.42 skrev Basil L. Contovounesios <contovob <at> tcd.ie>:
>
>> Thanks, but the warnings are being stubborn with and not listening to
>> me.  Could you please have a word with them?
>
> A serious conversation was held and some very frank words were pronounced.

Is there an RFC for that protocol?  It seems to be effective.

>> First, they are a bit repetitive in parallel 'make -j8 check':
>
> That was made on purpose to really hammer the point home.

Is it a bug that we don't consistently do that for all warnings?

>>  For the `mapcar' case, only the `mapcar' function can be used in
>>  the symbol list.  For `suspicious', only `set-buffer' can be used.
>>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Clearly you aren't suspicious enough.

But enough to not be suspiciously unsuspicious.

>> How can these issues be addressed?
>
> Why, `git pull` of course!

I picked some of that up from my local pharmacy, and...

> (Sorry about all this, and thanks a lot!)

...WFM, thanks!  No need to apologise,

-- 
Basil




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 21 Aug 2022 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.