GNU bug report logs - #14702
24.3.50; Byte-compiling called-interactively-p inside catch

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Mon, 24 Jun 2013 14:30:03 UTC

Severity: minor

Tags: wontfix

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 14702 <at> debbugs.gnu.org
Subject: bug#14702: 24.3.50; Byte-compiling called-interactively-p inside catch
Date: Mon, 24 Jun 2013 21:39:21 -0400
>    (defun baz ()
>      (interactive)
>      (catch 'test
>        (if (called-interactively-p 'any)

If it hurts, don't do that.
Internally, the byte-compiled form of catch ends up wrapping its body
inside a lambda, so the called-interactively-p test refers to the
implicit lambda added, rather than to the enclosing function
you defined.

It would be good to avoid this intermediate lambda for performance
reasons (which would incidentally also fix this particular issue), but
in the mean time (and more generally) either avoid
called-interactively-p (pass an extra argument instead), or avoid
placing it "deep" within your function (e.g. inside
a catch/unwind-protect/condition-case/save-foobar/...).


        Stefan




This bug report was last modified 11 years and 167 days ago.

Previous Next


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