Function: mh-funcall-if-exists

mh-funcall-if-exists is an autoloaded macro defined in mh-acros.el.gz.

This macro is obsolete since 29.1; use (when (fboundp foo) (foo))' instead.

Signature

(mh-funcall-if-exists FUNCTION &rest ARGS)

Documentation

Call FUNCTION with ARGS as parameters if it exists.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-acros.el.gz
;;;###mh-autoload
(defmacro mh-funcall-if-exists (function &rest args)
  "Call FUNCTION with ARGS as parameters if it exists."
  (declare (obsolete "use `(when (fboundp 'foo) (foo))' instead." "29.1")
           (debug (symbolp body)))
  ;; FIXME: Not clear when this should be used.  If the function happens
  ;; not to exist at compile-time (e.g. because the corresponding package
  ;; wasn't loaded), then it won't ever be used :-(
  (when (fboundp function)
    `(when (fboundp ',function)
       (funcall ',function ,@args))))