Skip to content

Commit

Permalink
improve compat of called-interactively-p macro
Browse files Browse the repository at this point in the history
including trunk (to be 24.3)
and versions with only `interactive-p`
  • Loading branch information
rolandwalker committed Nov 26, 2012
1 parent 95e2cba commit dbd9d6b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions osx-browse.el
Expand Up @@ -310,9 +310,15 @@ The format for key sequences is as defined by `kbd'."
Optional KIND is as documented at `called-interactively-p'
in GNU Emacs 24.1 or higher."
(if (eq 0 (cdr (subr-arity (symbol-function 'called-interactively-p))))
'(called-interactively-p)
`(called-interactively-p ,kind)))
(cond
((not (fboundp 'called-interactively-p))
'(interactive-p))
((condition-case nil
(progn (called-interactively-p 'any) t)
(error nil))
`(called-interactively-p ,kind))
(t
'(called-interactively-p))))

;;; compatibility functions

Expand Down

0 comments on commit dbd9d6b

Please sign in to comment.