Function: edebug--unwrap*-symbol-function

edebug--unwrap*-symbol-function is a byte-compiled function defined in edebug.el.gz.

Signature

(edebug--unwrap*-symbol-function SYMBOL)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/edebug.el.gz
(defun edebug--unwrap*-symbol-function (symbol)
  ;; Try to unwrap SYMBOL's `symbol-function'.  The result is suitable
  ;; to be fbound back to SYMBOL with `defalias'.  When no unwrapping
  ;; could be done return nil.
  (pcase (symbol-function symbol)
    ((or (and `(macro . ,f) (let was-macro t))
         (and  f            (let was-macro nil)))
     ;; `defalias' takes care of advises so we must strip them
     (let* ((orig-f (advice--cd*r f))
            (unwrapped (edebug-unwrap* orig-f)))
       (cond
        ((equal unwrapped orig-f) nil)
        (was-macro               `(macro . ,unwrapped))
        (t                       unwrapped))))))