From: Carsten Dominik <dominik@uva.nl>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Juanma Barranquero <lekktu@gmail.com>, emacs-devel@gnu.org
Subject: Re: called-interactively-p
Date: Mon, 9 Nov 2009 17:28:57 +0100 [thread overview]
Message-ID: <0758A105-5B09-413A-8F5A-9C46386669BD@uva.nl> (raw)
In-Reply-To: <jwvr5sclrli.fsf-monnier+emacs@gnu.org>
On Nov 5, 2009, at 8:13 PM, Stefan Monnier wrote:
>> Well, it turns out that I don't know a good way to take care of this.
>> I would like to have Org be compatible with Emacs 22 and also XEmacs,
>> and I don't know how I can do this with the new `called-
>> interactively',
>> except for creating diverging code bases.
>
> Yes, this is a problem. The best I can offer is to use a macro that
> expands to either of the alternatives (a function wouldn't work
> because
> it would cause interactive-p to always return nil).
And a macro will only work if the user runs compiled code, right?
- Carsten
>
> (defmacro org-called-interactively-p (kind)
> (condition-case nil
> (progn (called-interactively-p nil)
> ;; If the call didn't signal an error, then the new form
> ;; is supported: use it.
> `(called-interactively-p ,kind))
> (wrong-number-of-arguments
> ;; Probably Emacs-23.1.
> (if (equal (eval kind) 'interactive)
> `(interactive-p)
> `(called-interactively-p)))
> (error
> ;; called-interactively-p seems not to be supported, fallback
> ;; on the good ol' interactive-p.
> `(interactive-p))))
>
> Of course the above code is guaranteed 100% untested.
>
>
> Stefan
- Carsten
next prev parent reply other threads:[~2009-11-09 16:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 18:15 called-interactively-p Stefan Monnier
2009-10-02 3:59 ` called-interactively-p Juanma Barranquero
2009-10-09 8:50 ` called-interactively-p Carsten Dominik
2009-11-05 15:22 ` called-interactively-p Carsten Dominik
2009-11-05 19:13 ` called-interactively-p Stefan Monnier
2009-11-06 11:09 ` called-interactively-p Andreas Roehler
2009-11-09 16:28 ` Carsten Dominik [this message]
2009-11-09 22:00 ` called-interactively-p Stefan Monnier
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=0758A105-5B09-413A-8F5A-9C46386669BD@uva.nl \
--to=dominik@uva.nl \
--cc=emacs-devel@gnu.org \
--cc=lekktu@gmail.com \
--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.