GNU bug report logs -
#27397
[PATCH] New commands for bulk tracing of elisp functions
Previous Next
Full log
Message #73 received at 27397 <at> debbugs.gnu.org (full text, mbox):
On 20/06/17 00:05, Michael Albinus wrote:
> So we shall parse indead every function for the library it belongs to. It
> shouldn't be too hard, based on `autoloadp', `find-lisp-object-file-name'
> and friends, see the implementation in `describe-function-1'. Something
> like this is a very rudimentary implementation:
>
> (defun my-find-library (fun)
> "Find library FUN is defined in.
> In case of subroutines, return t"
> (when (fboundp fun)
> (let ((def (symbol-function fun)))
> (cond
> ((autoloadp def) (cadr def))
> ((subrp def) t)
> (t (file-name-base (find-lisp-object-file-name fun nil)))))))
Meanwhile I was experimenting with load-history along these lines:
(require 'seq)
(defun trace-library (library)
"Trace functions defined by LIBRARY."
(mapcar 'trace-function-background
(mapcar 'cdr (seq-filter
(lambda (x)
(and (consp x) (eq (car x) 'defun)))
(load-history-filename-element
(load-history-regexp library))))))
This bug report was last modified 2 years and 276 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.