From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Newsgroups: gmane.emacs.bugs Subject: bug#3984: Fix for #3984 Date: Fri, 13 Sep 2013 01:56:19 -0700 Message-ID: <5232D333.8030206@thompsonclan.org> References: <20E00C7675E64356BF2F0B2A7E0ABDB1@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1379062636 15738 80.91.229.3 (13 Sep 2013 08:57:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Sep 2013 08:57:16 +0000 (UTC) To: 3984@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 13 10:57:17 2013 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 1VKPBl-00078f-8N for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Sep 2013 10:57:17 +0200 Original-Received: from localhost ([::1]:45519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKPBk-0001nT-S2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Sep 2013 04:57:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKPBc-0001nJ-I6 for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 04:57:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKPBW-0003yq-Ij for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 04:57:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKPBW-0003yf-Fj for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 04:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VKPBV-00085i-U4 for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 04:57:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <20E00C7675E64356BF2F0B2A7E0ABDB1@us.oracle.com> Resent-From: Ryan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Sep 2013 08:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3984 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 3984-submit@debbugs.gnu.org id=B3984.137906259331066 (code B ref 3984); Fri, 13 Sep 2013 08:57:01 +0000 Original-Received: (at 3984) by debbugs.gnu.org; 13 Sep 2013 08:56:33 +0000 Original-Received: from localhost ([127.0.0.1]:60789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKPB3-000850-0R for submit@debbugs.gnu.org; Fri, 13 Sep 2013 04:56:33 -0400 Original-Received: from mail-pd0-f180.google.com ([209.85.192.180]:43513) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKPB1-00084k-DX for 3984@debbugs.gnu.org; Fri, 13 Sep 2013 04:56:32 -0400 Original-Received: by mail-pd0-f180.google.com with SMTP id y10so985323pdj.11 for <3984@debbugs.gnu.org>; Fri, 13 Sep 2013 01:56:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=Uxj7FkJwXW4p/teeIiXq0H6XZpExQQx1A6HzrYVFuMU=; b=OwL1FEWk8HiA0HYaYTdh155/vdVH+DK03I8CVLny0HB6p423B4fp+eKDTypw0FMnaE bo6Ort7FYy3RMUGiJHMXsz2WCdqY05fuMQdPIsguQFUoA4oUx0QWbaJhQ226+qyBq838 mofAuS0r8pW6BwjuLI4MRMhvnv4NnkxJYIgW12iJoOoMMIPikhrO4dRrRGFbtUdyPGPs 9dEHAv5xMtRW1eb1iN28FUemxO4bHlOWOHNeTtsbzKnt/MZyRwFxQ3XYouWwepbiRp64 sfqhE/kBXK6FdjbAhzSJiQh3g/FjNzhFu4k5Fdlnsl0pImqRVIhBHILuIe/9eyRvRfV3 M39A== X-Gm-Message-State: ALoCoQnk7n3/543UVAApFZNxFBjMaCwdfzjx/YDMKiNanw1BMRHdEgEtBQU6V88AZ/5+YocGDeu0 X-Received: by 10.67.1.228 with SMTP id bj4mr7498374pad.157.1379062584974; Fri, 13 Sep 2013 01:56:24 -0700 (PDT) Original-Received: from [192.168.10.2] (user-0c9ha1q.cable.mindspring.com. [24.152.168.58]) by mx.google.com with ESMTPSA id zq10sm16566314pab.6.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 01:56:23 -0700 (PDT) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 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:78327 Archived-At: Dear all, I "fixed" this in my ido-ubiquitous package by completely reimplementing "called-interactively-p" and "interactive-p" in pure elisp: https://github.com/DarwinAwardWinner/ido-ubiquitous/commit/f0c42e289a614071e22ad2c08297a7ebd60ba1cc Apart from simply translating the C code in elisp, I made two key adjustments to the logic: first, I filter out all evidence of advice from the call stack before checking if the caller is "call-interactively". Second, I relax the definition of "caller is call-interactively" to include any symbol with the same "symbol-function" as call-interactively, or any function that is the same as the symbol-function of call-interactively. Combined, these adjustments mean that defining advice on call-interactively no longer results in erroneous return values from these two interactivity-testing functions. I have implemented this in elisp because that is the only way to redefine functions in a running emacs session, but there's no reason that the C code couldn't be adapted to use the same logic. -Ryan