unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Roehler <andreas.roehler@online.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Juanma Barranquero <lekktu@gmail.com>,
	dominik@uva.nl, emacs-devel@gnu.org
Subject: Re: called-interactively-p
Date: Fri, 06 Nov 2009 12:09:13 +0100	[thread overview]
Message-ID: <4AF403D9.7010800@online.de> (raw)
In-Reply-To: <jwvr5sclrli.fsf-monnier+emacs@gnu.org>

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).
> 
> (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
> 
> 
> 


Remember thread "interactive-p and called-interactively-p".
Think Drew Adams was right and your first response too.

Otherwise we see things going still more complicated.

Cheers
Andreas






  reply	other threads:[~2009-11-06 11:09 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         ` Andreas Roehler [this message]
2009-11-09 16:28         ` called-interactively-p Carsten Dominik
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=4AF403D9.7010800@online.de \
    --to=andreas.roehler@online.de \
    --cc=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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).