From 5e8642d331ba29fce627779f2193e2dbb6b485d9 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 12 Nov 2013 12:20:18 +0900 Subject: [PATCH] add func my-real-function-subr-p --- emacs.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/emacs.el b/emacs.el index ebf2c88..2a0f6a9 100644 --- a/emacs.el +++ b/emacs.el @@ -2093,7 +2093,26 @@ this is test, does not rename files" (concat my-system-info (ad-get-arg 0))))) +;; (subrp (symbol-function 'read-from-minibuffer)) + ;; (defadvice completing-read (before info-in-prompt activate) ;; (ad-set-arg 0 ;; (concat my-system-info ;; (ad-get-arg 0)))) + +(defun my-real-function-subr-p (function) + "Return t if function is a built-in function even if it is advised." + (let* ((advised (and (symbolp function) + (featurep 'advice) + (ad-get-advice-info function))) + (real-function + (or (and advised (let ((origname (cdr (assq 'origname advised)))) + (and (fboundp origname) + origname))) + function)) + (def (if (symbolp real-function) + (symbol-function real-function) + function))) + (subrp def))) + +;; (my-real-function-subr-p 'my-real-function-subr-p)