From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Frank Fischer Newsgroups: gmane.emacs.help Subject: Re: defadvice and called-interactively-p Date: Wed, 6 Jun 2012 07:35:51 +0000 (UTC) Message-ID: References: <874nqozyrv.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338968188 4385 80.91.229.3 (6 Jun 2012 07:36:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2012 07:36:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 06 09:36:27 2012 Return-path: Envelope-to: geh-help-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 1ScAn4-00063b-Fq for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jun 2012 09:36:26 +0200 Original-Received: from localhost ([::1]:39356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScAn4-0002Os-A2 for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jun 2012 03:36:26 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScAmv-0002Ny-Io for help-gnu-emacs@gnu.org; Wed, 06 Jun 2012 03:36:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScAmq-00077N-Nm for help-gnu-emacs@gnu.org; Wed, 06 Jun 2012 03:36:17 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScAmq-00075S-Gj for help-gnu-emacs@gnu.org; Wed, 06 Jun 2012 03:36:12 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ScAmi-0005JB-W8 for help-gnu-emacs@gnu.org; Wed, 06 Jun 2012 09:36:04 +0200 Original-Received: from mordred.mathematik.tu-chemnitz.de ([134.109.40.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Jun 2012 09:36:04 +0200 Original-Received: from frank-fischer by mordred.mathematik.tu-chemnitz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Jun 2012 09:36:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: mordred.mathematik.tu-chemnitz.de User-Agent: slrn/0.9.9p1 (Linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85128 Archived-At: On 2012-06-06, Eric Abrahamsen wrote: > On Wed, Jun 06 2012, Frank Fischer wrote: > >> Hi, >> >> I have a problem when advising a function/command that uses >> `called-interactively-p' but I have not been able to find a solution. >> >> Suppose you have a command calling `called-interactively-p' >> >> (defun myfunc () >> (interactive) >> (message "MYFUNC %s" (called-interactively-p 'any))) >> >> Now, when executing M-x myfunc RET the message line shows "MYFUNC t" >> as expected. But when that function is advised >> >> (defadvice myfunc (around around-myfunc activate) >> ad-do-it) > > While you're waiting for an answer from someone who really understand > how all this works, I've found that I need to add an (interactive) > statement to the defadvice form as well, in order to preserve > interactive state. Give it a shot, anyway! I've tried this and it does not make a difference. And according to the elisp manual it should not do: 17.10 states The interactive form is present if the original function or some piece of advice specifies one. Anyway, the result is the same. Frank