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: bug#123: Potential fix Date: Fri, 13 Sep 2013 03:24:19 -0700 Message-ID: <5232E7D3.4050603@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 1379067922 10596 80.91.229.3 (13 Sep 2013 10:25:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Sep 2013 10:25:22 +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 12:25:24 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 1VKQZ1-0000FT-Uf for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Sep 2013 12:25:24 +0200 Original-Received: from localhost ([::1]:45850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKQZ1-0005PS-FV for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Sep 2013 06:25:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKQYs-0005Nd-CF for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 06:25:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKQYk-00034z-0a for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 06:25:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKQYj-00034o-UJ for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 06:25:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VKQYh-0001vf-FH for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 06:25:04 -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 10:25:03 +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.13790678757361 (code B ref 3984); Fri, 13 Sep 2013 10:25:03 +0000 Original-Received: (at 3984) by debbugs.gnu.org; 13 Sep 2013 10:24:35 +0000 Original-Received: from localhost ([127.0.0.1]:60911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKQYE-0001ue-7M for submit@debbugs.gnu.org; Fri, 13 Sep 2013 06:24:34 -0400 Original-Received: from mail-pd0-f170.google.com ([209.85.192.170]:51448) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKQYA-0001uN-9G for 3984@debbugs.gnu.org; Fri, 13 Sep 2013 06:24:31 -0400 Original-Received: by mail-pd0-f170.google.com with SMTP id x10so1079597pdj.1 for <3984@debbugs.gnu.org>; Fri, 13 Sep 2013 03:24:24 -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=UyutshlbqcBhursMFRMZDSYjhKVvRx1QHQVgrGZawVWP3SqV7aRKEJq3nR+qGyOCQv f1qUiB9biKxqRGy5k/iEfGpB5MTaAiDwEb0qQbXHmVVHRotGnBbZ6DM7rCxkzuTg/1BB KB+LtcXWuwfgP7FuxiHzTBzIixzQvG5V2rryuoaPYoIqpGcq40QNgo6JjtleFZbF8woh gEcEyUtozW/TTC33XMmMYAYFIimZYG5o4xxqUr/l66USZ+DADurUBq2GQXvBZHr7xc/3 V0cRDluls8KcJsRkyHuTLxVRtHS2pCM2w6jDJgWMQ2+eF5Qmp1DkHGCQ0r1cpNjnjKPU IeIA== X-Gm-Message-State: ALoCoQmBhn0Yf/+F9RANtweZ749blcuqas/QLLgdlva53VWraWOrDDLlK65b0cN4VZ9HthpKhtpy X-Received: by 10.68.9.3 with SMTP id v3mr12447651pba.84.1379067864196; Fri, 13 Sep 2013 03:24: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 os4sm10765583pbb.25.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 03:24:22 -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:78330 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