emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New unwind-protect byte-compiler warning


From: Mattias Engdegård
Subject: Re: New unwind-protect byte-compiler warning
Date: Tue, 4 Apr 2023 13:20:59 +0200

4 apr. 2023 kl. 12.32 skrev Robert Pluim <rpluim@gmail.com>:

>    In mouse-wheel-global-text-scale:
>    mwheel.el:450:6: Warning: ‘unwind-protect’ without unwind forms
> 
> is because weʼre protecting against errors from
> `global-text-scale-adjust', but unlike `text-scale-{in,de}crease',
> that doesnʼt signal an error when you reach the scale limit.
> 
> Juri, we can add an unwind form of `t'

Note that `unwind-protect` does not itself "protect against errors". An error 
signalled by the protected form will still be signalled after execution of the 
unwind forms. An unwind form of `t` makes no more sense than none at all; the 
value is just thrown away.

Evidently there are a few cases of

   (unwind-protect FORM CONSTANT)

in the Emacs tree (and GNU ELPA); it probably makes sense to warn about them as 
well since they often arise from a misunderstanding of what `unwind-protect` 
does.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]