all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: Robert Pluim <rpluim@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>, Juri Linkov <juri@linkov.net>
Subject: Re: New unwind-protect byte-compiler warning
Date: Tue, 4 Apr 2023 13:20:59 +0200	[thread overview]
Message-ID: <02132809-BAFB-4C1F-BC32-B6C510F3B4E3@gmail.com> (raw)
In-Reply-To: <87fs9ghr96.fsf@gmail.com>

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	other threads:[~2023-04-04 11:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  8:01 New unwind-protect byte-compiler warning Mattias Engdegård
2023-03-30 10:08 ` Emanuel Berg
2023-04-01 22:56 ` Basil L. Contovounesios
2023-04-04 10:32 ` Robert Pluim
2023-04-04 11:20   ` Mattias Engdegård [this message]
2023-04-04 12:26     ` Robert Pluim
2023-04-04 12:32   ` Gregory Heytings
2023-04-04 16:10   ` Juri Linkov
2023-04-07 17:40 ` Mattias Engdegård
2023-04-09 14:20   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02132809-BAFB-4C1F-BC32-B6C510F3B4E3@gmail.com \
    --to=mattias.engdegard@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.