all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matt Swift <swift@alum.mit.edu>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: idea: debug-on-entry to any function matching regexp
Date: Tue, 18 Feb 2003 03:11:28 -0500	[thread overview]
Message-ID: <m2bs1aknyn.fsf@beth.swift.xxx> (raw)
In-Reply-To: <mailman.2055.1045549459.21513.bug-gnu-emacs@gnu.org> (Dan Jacobson's message of "Tue, 18 Feb 2003 11:18:42 +0800")

>> "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)

       reply	other threads:[~2003-02-18  8:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.2055.1045549459.21513.bug-gnu-emacs@gnu.org>
2003-02-18  8:11 ` Matt Swift [this message]
2003-02-18  3:18 idea: debug-on-entry to any function matching regexp Dan Jacobson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2bs1aknyn.fsf@beth.swift.xxx \
    --to=swift@alum.mit.edu \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.