return the symbol's function definition."
(or (and (symbolp func)
(featurep 'nadvice)
- (let ((ofunc (advice--symbol-function func)))
+ (let ((ofunc (symbol-function func)))
(if (advice--p ofunc)
(advice--cd*r ofunc)
ofunc)))
(defun find-function-library (function &optional lisp-only verbose)
"Return the pair (ORIG-FUNCTION . LIBRARY) for FUNCTION.
-ORIG-FUNCTION is the original name, after removing all advice and
-resolving aliases. LIBRARY is an absolute file name, a relative
+ORIG-FUNCTION is the original name, after resolving aliases.
+LIBRARY is an absolute file name, a relative
file name inside the C sources directory, or a name of an
autoloaded feature.
(advice-remove #'mark-sexp 'my-message))
(ert-deftest find-func-tests--find-library-verbose ()
+ (unwind-protect
+ (progn
+ (advice-add 'dired :before #'ignore)
+ ;; bug#41104
+ (should (equal (find-function-library #'dired) '(dired . "dired"))))
+ (advice-remove 'dired #'ignore))
+
(find-function-library #'join-line nil t)
(with-current-buffer "*Messages*"
(save-excursion