all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Eric M. Ludlam" <eric@siege-engine.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: called-interactively-p, cedet, and Emacs 23.1 and earlier
Date: Thu, 25 Mar 2010 19:16:16 -0400	[thread overview]
Message-ID: <4BABEEC0.4030902@siege-engine.com> (raw)
In-Reply-To: <jwveij94nlt.fsf-monnier+emacs@gnu.org>

On 03/24/2010 01:51 PM, Stefan Monnier wrote:
>> We have recently stumbled over called-interactively-p, which is now used
>> with an argument throughout the Emacs versions of the CEDET code.
>> My externally maintained code I would like to have work in Emacs 22 and 23.1
>> which does not support the argument, and XEmacs which is missing the feature
>> completely, and is thus easy to make work in this case. Could some kind soul
>> help me define some advice, or other trick I can install in older Emacs to
>> allow this form to work?
>
> How 'bout
>
> (condition-case nil
>      (called-interactively-p nil)
>    (defmacro called-interactively-p (arg)
>      (case arg
>        (interactive `(interactive-p))
>        ((any nil) `(called-interactively-p)))))

Hi Stefan

I've adapted the above into this:

(if (not (fboundp 'called-interactively-p))
     (defsubst called-interactively-p (&optional arg)
       "Compat function.  Calls `interactive-p'"
       (interactive-p))
   ;; Else, it is defined, but perhaps too old?
   (condition-case nil
       (called-interactively-p nil)
     (error
      (defmacro called-interactively-p (&optional arg)
        "Macro to support optional input arg for built-in."
        (case arg
	 (interactive `(interactive-p))
	 ((any nil) `(called-interactively-p))))
      )))

an in Emacs 23.1, it now emits this:

Invalid function: called-interactively-p

and I have to kill from the command prompt, because it is used so much.

I had similar issues trying to figure out how advice in this case would 
work before I emailed the first time.

Any other thoughts?
Thanks
Eric




  parent reply	other threads:[~2010-03-25 23:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-24 16:45 called-interactively-p, cedet, and Emacs 23.1 and earlier Eric M. Ludlam
2010-03-24 17:51 ` Stefan Monnier
2010-03-25 14:33   ` Lluís
2010-03-25 23:16   ` Eric M. Ludlam [this message]
2010-03-26 15:33     ` Davis Herring
2010-03-26 16:06       ` Eric M. Ludlam
2010-03-27 14:11         ` Eric M. Ludlam
2010-03-27 18:18           ` Stefan Monnier
2010-04-26 15:28             ` Bruce Stephens
2010-04-26 17:58               ` Stefan Monnier
2010-04-26 18:27                 ` Bruce Stephens
2010-04-27  3:08                   ` Stefan Monnier
2010-04-27 11:22                     ` Bruce Stephens
2010-04-27 13:56                       ` Stefan Monnier
2010-03-24 17:53 ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BABEEC0.4030902@siege-engine.com \
    --to=eric@siege-engine.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.