/[emacs]/emacs/lisp/emacs-lisp/debug.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/debug.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.87 by lute, Tue Jun 14 12:00:50 2005 UTC revision 1.88 by lute, Thu Jun 23 08:20:33 2005 UTC
# Line 653  functions to break on entry." Line 653  functions to break on entry."
653        nil        nil
654      (funcall debugger 'debug)))      (funcall debugger 'debug)))
655    
656    (defun debugger-special-form-p (symbol)
657      "Return whether SYMBOL is a special form."
658      (and (fboundp symbol)
659           (subrp (symbol-function symbol))
660           (eq (cdr (subr-arity (symbol-function symbol))) 'unevalled)))
661    
662  ;;;###autoload  ;;;###autoload
663  (defun debug-on-entry (function)  (defun debug-on-entry (function)
664    "Request FUNCTION to invoke debugger each time it is called.    "Request FUNCTION to invoke debugger each time it is called.
# Line 668  primitive functions only works when that Line 674  primitive functions only works when that
674    
675  Use \\[cancel-debug-on-entry] to cancel the effect of this command.  Use \\[cancel-debug-on-entry] to cancel the effect of this command.
676  Redefining FUNCTION also cancels it."  Redefining FUNCTION also cancels it."
677    (interactive "aDebug on entry (to function): ")    (interactive
678    (when (and (subrp (symbol-function function))     (let ((fn (function-called-at-point)) val)
679               (eq (cdr (subr-arity (symbol-function function))) 'unevalled))       (when (debugger-special-form-p fn)
680           (setq fn nil))
681         (setq val (completing-read
682                    (if fn
683                        (format "Debug on entry to function (default %s): " fn)
684                      "Debug on entry to function: ")
685                    obarray
686                    #'(lambda (symbol)
687                        (and (fboundp symbol)
688                             (not (debugger-special-form-p symbol))))
689                    t nil nil (symbol-name fn)))
690         (list (if (equal val "") fn (intern val)))))
691      (when (debugger-special-form-p function)
692      (error "Function %s is a special form" function))      (error "Function %s is a special form" function))
693    (if (or (symbolp (symbol-function function))    (if (or (symbolp (symbol-function function))
694            (subrp (symbol-function function)))            (subrp (symbol-function function)))

Legend:
Removed from v.1.87  
changed lines
  Added in v.1.88

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26