From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matt Swift Newsgroups: gmane.emacs.bugs Subject: Re: idea: debug-on-entry to any function matching regexp Date: Tue, 18 Feb 2003 03:11:28 -0500 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045555896 14099 80.91.224.249 (18 Feb 2003 08:11:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 18 Feb 2003 08:11:36 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18l2px-0003dH-00 for ; Tue, 18 Feb 2003 09:10:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18l2rd-0003mG-02 for gnu-bug-gnu-emacs@m.gmane.org; Tue, 18 Feb 2003 03:12:29 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18l2rQ-0003kq-00 for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2003 03:12:16 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18l2rO-0003im-00 for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2003 03:12:15 -0500 Original-Received: from pool-68-160-54-133.bos.east.verizon.net ([68.160.54.133] helo=beth.swift.xxx) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18l2qw-0003Kw-00 for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2003 03:11:46 -0500 Original-Received: from beth.swift.xxx (swift@localhost [127.0.0.1]) h1I8BSBH013953verify=FAIL); Tue, 18 Feb 2003 03:11:29 -0500 Original-Received: (from swift@localhost) by beth.swift.xxx (8.12.6/8.12.6/Debian-8) id h1I8BSsr013951; Tue, 18 Feb 2003 03:11:28 -0500 Original-To: Dan Jacobson In-Reply-To: (Dan Jacobson's message of "Tue, 18 Feb 2003 11:18:42 +0800") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 X-Mailscanner: clean (beth.swift.xxx) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4485 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4485 >> "D" == Dan wrote: D> Feature request: debug on entry to function whose name is a regular D> expression. E.g. I don't know which of them it is, I just want any D> entry into any function with 'canlock' in the name to call up the D> debugger. You are probably going to go to Nested Debugger Hell if you do that, because all those functions are probably going to call each other lots, and you are going to go down and down.... This function will take you there. It might work for your purposes without being too annoying. (defun re-debug-on-entry (regexp) "Debug functions matching REGEXP on entry. Return new value of `debug-function-list'." (mapatoms (function (lambda (sym) (if (string-match regexp (symbol-name sym)) ;; Brute force. ;; Elegant soln. would duplicate most of ;; `debug-on-entry' (condition-case nil (debug-on-entry sym) (error) ))))) debug-function-list) ;; Try it out: (re-debug-on-entry "delete-.*") (cancel-debug-on-entry)