|
From: | Stefan Monnier |
Subject: | Re: [Emacs-diffs] /srv/bzr/emacs/trunk r111105: gmm-utils.el (gmm-called-interactively-p): New function. |
Date: | Wed, 05 Dec 2012 10:00:43 -0500 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> -;; `flet' and `labels' got obsolete since Emacs 24.3. > +;; `interactive-p' is obsolete since Emacs 23.2. > +(defalias 'gmm-called-interactively-p > + (condition-case nil > + (progn > + (eval '(called-interactively-p 'any)) > + ;; Emacs >=23.2 > + 'called-interactively-p) > + ;; Emacs <23.2 > + (wrong-number-of-arguments '(lambda (kind) (called-interactively-p))) > + ;; XEmacs > + (void-function '(lambda (kind) (interactive-p))))) This won't work: interactive-p will tell you whether or not gmm-called-interactively-p (rather than its caller) was called interactively (i.e. it will always return nil). (defalias 'gmm-called-interactively-p 'interactive-p) probably wouldn't work either, because of details of how interactive-p is implemented (it's a really fiddly feature). The only reliable option I know is to make it a macro. Stefan
[Prev in Thread] | Current Thread | [Next in Thread] |