From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#17446: 24.4.50; What is the situation around `called-interactively-p'? Date: Fri, 9 May 2014 06:39:06 -0700 (PDT) Message-ID: References: <87tx8z6sp2.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1399642835 20428 80.91.229.3 (9 May 2014 13:40:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 May 2014 13:40:35 +0000 (UTC) To: Thierry Volpiatto , 17446@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 09 15:40:26 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wil2F-0006dl-Vr for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 May 2014 15:40:24 +0200 Original-Received: from localhost ([::1]:52601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wil2F-0003ds-Ei for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 May 2014 09:40:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wil23-0003Sn-PC for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 09:40:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wil1w-0004lg-I6 for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 09:40:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wil1w-0004kD-Fk for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 09:40:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wil1v-00087n-A3 for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 09:40:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 May 2014 13:40:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17446-submit@debbugs.gnu.org id=B17446.139964276031167 (code B ref 17446); Fri, 09 May 2014 13:40:03 +0000 Original-Received: (at 17446) by debbugs.gnu.org; 9 May 2014 13:39:20 +0000 Original-Received: from localhost ([127.0.0.1]:56638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wil1D-00086c-Fe for submit@debbugs.gnu.org; Fri, 09 May 2014 09:39:20 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:44042) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wil19-00086K-1g for 17446@debbugs.gnu.org; Fri, 09 May 2014 09:39:15 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s49Dd8Bq018873 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 9 May 2014 13:39:08 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s49Dd6bV020665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 May 2014 13:39:07 GMT Original-Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s49Dd67k014009; Fri, 9 May 2014 13:39:06 GMT In-Reply-To: <87tx8z6sp2.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88817 Archived-At: > I recently had to use `called-interactively-p-functions' to fix a > command similar to `repeat-complex-command'. > I used similar hack than the one found in `repeat-complex-command', > but as mentionned in `called-interactively-p' this is not working with > code compiled (I use lexical-binding), thus `dont-compile' have been > made obsolete. >=20 > So what to do actually to fix such issues ? >=20 > Do you plan to make something better around the terrible > `called-interactively-p' ? >=20 > What about a special var to force `called-interactively-p' to return > true when it find this var (Actually this is crashing emacs) ? >=20 > It seems the only reason `dont-compile' have been made obsolete is > to force people fixing their code to make it working compiled; > That's ok, but what to do when nothing else is possible ? > IOW why is this obsolete ? >=20 > Ref: https://github.com/emacs-helm/helm/issues/489 FWIW (I think this is related; apologies if not), this is what I did: ;; Same as `repeat-complex-command--called-interactively-skip' ;; in `simple.el', but tests for `icicle-repeat-complex-command', ;; not `repeat-complex-command'. (when (> emacs-major-version 23) (defun icicle-repeat-complex-command--called-interactively-skip (i _frame1 frame2) "If currently `icicle-repeat-complex-command', return 1 to skip over it= ." (and (eq 'eval (cadr frame2)) (eq 'icicle-repeat-complex-command (cadr (backtrace-frame i #'called-interactively-p))) 1)) (byte-compile 'icicle-repeat-complex-command)) The reason for the `byte-compile' is that I found that it does not work when interpreted. (That seems opposite to what you are saying (?). I do not have non-nil `lexical-binding', however.) I agree that this all seems complicated & fragile. Dunno what the solution is.