|
From: | Eric M. Ludlam |
Subject: | Re: called-interactively-p, cedet, and Emacs 23.1 and earlier |
Date: | Fri, 26 Mar 2010 12:06:18 -0400 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.3a1pre) Gecko/20091222 Shredder/3.1a1pre |
On 03/26/2010 11:33 AM, Davis Herring wrote:
an in Emacs 23.1, it now emits this: Invalid function: called-interactively-pPerhaps you have compiled code calling called-interactively-p, and then are redefining it as a macro? That won't work. If you're going to have to make it a macro, you'll have to also then recompile any code that calls it.
Ah, That won't be possible since Emacs 23 has lots of code that is compiled using this already.
I saved off the old symbol function for called-interactively-p and used it in a new version of the function. This appears to now work.
I've checked this into my CEDET CVS repository, so now Lluis should be able to safely finish merging Emacs changes into CEDET, and things will keep working in Emacs 23.1 and eaerlier, and in XEmacs.
Thanks Eric ------------ (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 ;; This condition case also prevents this from running twice. (called-interactively-p nil) (error (defvar cedet-compat-called-interactively-p (let ((tmp (symbol-function 'called-interactively-p))) (if (subrp tmp) tmp ;; Did someone else allready override it? (or cedet-compat-clled-interactively-p tmp))) "Built-in called interactively function.") ;; Create a new one (defun cedet-called-interactively-p (&optional arg) "Revised from the built-in version to accept an optional arg." (case arg (interactive (interactive-p)) ((any nil) (funcall cedet-compat-called-interactively-p)))) ;; Override (fset 'called-interactively-p 'cedet-called-interactively-p) )))
[Prev in Thread] | Current Thread | [Next in Thread] |