GNU bug report logs - #17446
24.4.50; What is the situation around `called-interactively-p'?

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>

Date: Fri, 9 May 2014 12:31:01 UTC

Severity: wishlist

Found in version 24.4.50

Fixed in version 25.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


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

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 17446 <at> debbugs.gnu.org
Subject: Re: bug#17446: 24.4.50;
 What is the situation around `called-interactively-p'?
Date: Sat, 10 May 2014 10:41:53 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>> BTW, for older Emacsen, you can probably use a hack along the lines of
>> the guaranteed 100% untested code below:
>
> I tried to make it work:
>
>    (defun funcall-interactively (fun &rest args)
>      (setq fun (indirect-function fun))
>      (call-interactively
>        (cond
>         ((consp fun)
>          (mapcar (lambda (x)
>                    (if (eq (car-safe x) 'interactive)
>                        `(interactive ',args) x))
>                  fun))
>         ((byte-code-function-p fun)
>          (apply #'make-byte-code
>                 (aref fun 0)
>                 (aref fun 1)
>                 (aref fun 2)
>                 (aref fun 3)
>                 (aref fun 4)
>                 (aref fun 5)
>                 args)))))
>
> Works at least with the count-words case:
>
>   (funcall-interactively 'count-words nil nil) ==> something useful

Great, works also with `count-words-region'.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





This bug report was last modified 8 years and 123 days ago.

Previous Next


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