On 03/26/2010 11:33 AM, Davis Herring wrote:
an in Emacs 23.1, it now emits this:
Invalid function: called-interactively-p
Perhaps 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 already 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)
)))