From 6d3c3a37f70307110dfb7ad83f773e1689430483 Mon Sep 17 00:00:00 2001 From: Arthur Miller Date: Mon, 4 Oct 2021 16:01:52 +0200 Subject: [PATCH 2/2] ELP Rename Instrumented Predicate * lisp/emacs-lisp/elp.el (elp--instrumented-p): Add docs. Renamed 'elp--instrumented-p' to 'elp-instrumented-p'. Update all callers to use renamed function. --- lisp/emacs-lisp/elp.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index 8c33b7c994..891f58582a 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el @@ -251,8 +251,9 @@ elp-instrument-function (advice-add funsym :around (elp--make-wrapper funsym) `((name . ,elp--advice-name) (depth . -99))))) -(defun elp--instrumented-p (sym) - (advice-member-p elp--advice-name sym)) +(defun elp-instrumented-p (symbol) + "Whether SYMBOL is instrumented for emacs lisp profiler." + (advice-member-p elp--advice-name symbol)) (defun elp-restore-function (funsym) "Restore an instrumented function to its original definition. @@ -261,7 +262,7 @@ elp-restore-function (list (intern (completing-read "Function to restore: " obarray - #'elp--instrumented-p t)))) + #'elp-instrumented-p t)))) ;; If the function was the master, reset the master. (if (eq funsym elp-master) (setq elp-master nil @@ -342,12 +343,12 @@ elp-set-master (intern (let ((default (if elp-master (symbol-name elp-master)))) (completing-read (format-prompt "Master function" default) - obarray #'elp--instrumented-p t nil nil default))))) + obarray #'elp-instrumented-p t nil nil default))))) ;; When there's a master function, recording is turned off by default. (setq elp-master funsym elp-record-p nil) ;; Make sure master function is instrumented. - (or (elp--instrumented-p funsym) + (or (elp-instrumented-p funsym) (elp-instrument-function funsym))) (defun elp-unset-master () @@ -516,7 +517,7 @@ elp-results ) ; end let* (mapatoms (lambda (funsym) - (when (elp--instrumented-p funsym) + (when (elp-instrumented-p funsym) (let* ((info (get funsym elp-timer-info-property)) (symname (format "%s" funsym)) (cc (aref info 0)) -- 2.33.0