GNU bug report logs - #23963
25.0.95; Feature request: setup-unwind-protect, complementing unwind-protect

Previous Next

Package: emacs;

Reported by: Markus Triska <triska <at> metalevel.at>

Date: Wed, 13 Jul 2016 06:29:01 UTC

Severity: wishlist

Found in version 25.0.95

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Markus Triska <triska <at> metalevel.at>
Cc: 23963 <at> debbugs.gnu.org
Subject: bug#23963: 25.0.95; Feature request: setup-unwind-protect, complementing unwind-protect
Date: Sat, 27 Jan 2018 16:17:19 -0500
Markus Triska <triska <at> metalevel.at> writes:

> With this primitive, we could write the example above as:
>
>     (setup-unwind-protect
>         (setq process (ftp-...))
>      (progn
>        ;; use process ...
>      (delete-process process))

Given my dislike of `setq` I'd rather use something else.

This said, we also have another problem: if the user hits C-g twice
in a row, the second may interrupt the `delete-process` itself.

So I think what we "really" want is more like

    (let ((oi inhibit-quit)
          (inhibit-quit t))
      (let ((process (ftp-...)))
         (unwind-protect
             (let ((inhibit-quit oi))
               ..use process..)
           (delete-process process))))

At the same time, any function whose name starts with "ftp-" is likely
a bad candidate for running it in a context where it can't be
interrupted (it's likely that in various circumstances it could hang, in
which case the user should be able to hit C-g).


        Stefan




This bug report was last modified 7 years and 140 days ago.

Previous Next


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