all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* idea: debug-on-entry to any function matching regexp
@ 2003-02-18  3:18 Dan Jacobson
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Jacobson @ 2003-02-18  3:18 UTC (permalink / raw)


Feature request: debug on entry to function whose name is a regular
expression.  E.g. I don't know which of them it is, I just want any
entry into any function with 'canlock' in the name to call up the
debugger.
-- 
http://jidanni.org/ Taiwan(04)25854780

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: idea: debug-on-entry to any function matching regexp
       [not found] <mailman.2055.1045549459.21513.bug-gnu-emacs@gnu.org>
@ 2003-02-18  8:11 ` Matt Swift
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Swift @ 2003-02-18  8:11 UTC (permalink / raw)
  Cc: bug-gnu-emacs

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-18  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2055.1045549459.21513.bug-gnu-emacs@gnu.org>
2003-02-18  8:11 ` idea: debug-on-entry to any function matching regexp Matt Swift
2003-02-18  3:18 Dan Jacobson

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.