GNU bug report logs - #27397
[PATCH] New commands for bulk tracing of elisp functions

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Fri, 16 Jun 2017 13:34:02 UTC

Severity: wishlist

Tags: moreinfo, patch

Merged with 1343, 6464

Full log


Message #73 received at 27397 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
Date: Tue, 20 Jun 2017 00:17:38 +1200
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.