Function: cc-bytecomp-defun

cc-bytecomp-defun is a macro defined in cc-bytecomp.el.gz.

Signature

(cc-bytecomp-defun FUN)

Documentation

Bind the symbol FUN as a function during compilation of the file.

This can be used to silence the byte compiler. Don't use within eval-when-compile.

If the symbol already is bound as a function, it will keep that definition. That means that this macro will not shut up warnings about incorrect number of arguments. It's dangerous to try to replace existing functions since the byte compiler might need the definition at compile time, e.g. for macros and inline functions.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-bytecomp.el.gz
(defmacro cc-bytecomp-defun (fun)
  "Bind the symbol FUN as a function during compilation of the file.
This can be used to silence the byte compiler.  Don't use within
`eval-when-compile'.

If the symbol already is bound as a function, it will keep that
definition.  That means that this macro will not shut up warnings
about incorrect number of arguments.  It's dangerous to try to replace
existing functions since the byte compiler might need the definition
at compile time, e.g. for macros and inline functions."
  (declare (debug nil))
  `(eval-when-compile
     (if (fboundp ',fun)
	 (cc-bytecomp-debug-msg
	  "cc-bytecomp-defun: %s bound already as function" ',fun)
       (if (not (assq ',fun cc-bytecomp-original-functions))
	   (progn
	     (cc-bytecomp-debug-msg
	      "cc-bytecomp-defun: Saving %s (as unbound)" ',fun)
	     (setq cc-bytecomp-original-functions
		   (cons (list ',fun nil 'unbound)
			 cc-bytecomp-original-functions))))
       (if (cc-bytecomp-is-compiling)
	   (progn
	     (fset ',fun (intern (concat "cc-bytecomp-ignore-fun:"
					 (symbol-name ',fun))))
	     (cc-bytecomp-debug-msg
	      "cc-bytecomp-defun: Covered function %s" ',fun))))))