summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/debug.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2005-06-24 01:59:52 +0000
committerMiles Bader <miles@gnu.org>2005-06-24 01:59:52 +0000
commit3f0607e49476578a260289a51a84639b1885c161 (patch)
tree076023228279f15587ea24a5a7f9adb499ee969c /lisp/emacs-lisp/debug.el
parent82cf95134905ffe09000888e86e88c9a400a4468 (diff)
parentff71329437a5195b60799e019871181c916024ff (diff)
downloademacs-3f0607e49476578a260289a51a84639b1885c161.tar.gz
emacs-3f0607e49476578a260289a51a84639b1885c161.tar.bz2
emacs-3f0607e49476578a260289a51a84639b1885c161.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-65
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 425-445) - Remove "-face" suffix from gnus faces - Update from CVS - Remove "-face" suffix from MH-E faces - Remove "-face" suffix from cc-mode faces - Remove "-face" suffix from eshell faces - Remove "-face" suffix from ediff faces - Implement tty vertical-divider face - Rename vertical-divider face to vertical-border - Change escape-glyph color on dark backgrounds back to cyan - Update reference to renamed Buffer-menu-buffer face
Diffstat (limited to 'lisp/emacs-lisp/debug.el')
-rw-r--r--lisp/emacs-lisp/debug.el24
1 files changed, 21 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 0ee67355bf4..e543932d8b4 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -653,6 +653,12 @@ functions to break on entry."
nil
(funcall debugger 'debug)))
+(defun debugger-special-form-p (symbol)
+ "Return whether SYMBOL is a special form."
+ (and (fboundp symbol)
+ (subrp (symbol-function symbol))
+ (eq (cdr (subr-arity (symbol-function symbol))) 'unevalled)))
+
;;;###autoload
(defun debug-on-entry (function)
"Request FUNCTION to invoke debugger each time it is called.
@@ -668,9 +674,21 @@ primitive functions only works when that function is called from Lisp.
Use \\[cancel-debug-on-entry] to cancel the effect of this command.
Redefining FUNCTION also cancels it."
- (interactive "aDebug on entry (to function): ")
- (when (and (subrp (symbol-function function))
- (eq (cdr (subr-arity (symbol-function function))) 'unevalled))
+ (interactive
+ (let ((fn (function-called-at-point)) val)
+ (when (debugger-special-form-p fn)
+ (setq fn nil))
+ (setq val (completing-read
+ (if fn
+ (format "Debug on entry to function (default %s): " fn)
+ "Debug on entry to function: ")
+ obarray
+ #'(lambda (symbol)
+ (and (fboundp symbol)
+ (not (debugger-special-form-p symbol))))
+ t nil nil (symbol-name fn)))
+ (list (if (equal val "") fn (intern val)))))
+ (when (debugger-special-form-p function)
(error "Function %s is a special form" function))
(if (or (symbolp (symbol-function function))
(subrp (symbol-function function)))