[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mon, 9 Nov 2009 17:28:57 +0100
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-
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
it would cause interactive-p to always return nil).
And a macro will only work if the user runs compiled code, right?
(defmacro org-called-interactively-p (kind)
(progn (called-interactively-p nil)
;; If the call didn't signal an error, then the new form
;; is supported: use it.
;; Probably Emacs-23.1.
(if (equal (eval kind) 'interactive)
;; called-interactively-p seems not to be supported, fallback
;; on the good ol' interactive-p.
Of course the above code is guaranteed 100% untested.