summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorDima Kogan <dima@secretsauce.net>2016-12-05 21:42:20 -0800
committerDima Kogan <dima@secretsauce.net>2017-01-30 21:04:11 -0800
commitf3c77d11af65f3b319b1784b4c3cf08c51aa7997 (patch)
tree5d2224f3846946129154ea45493d5650fd89edd2 /lisp/emacs-lisp
parent3c941b900007c9e79c00af0f21d88154f6d8af1a (diff)
downloademacs-f3c77d11af65f3b319b1784b4c3cf08c51aa7997.tar.gz
stash
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/debug.el54
1 files changed, 54 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index cb77148c285..faa323f733a 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -816,6 +816,60 @@ Redefining FUNCTION also cancels it."
'((depth . -100)))
function)
+;;;###autoload
+;; (defun debug-on-set (symbol)
+;; "Request FUNCTION to invoke debugger each time it is called.
+
+;; When called interactively, prompt for FUNCTION in the minibuffer.
+
+;; This works by modifying the definition of FUNCTION. If you tell the
+;; debugger to continue, FUNCTION's execution proceeds. If FUNCTION is a
+;; normal function or a macro written in Lisp, you can also step through
+;; its execution. FUNCTION can also be a primitive that is not a special
+;; form, in which case stepping is not possible. Break-on-entry for
+;; 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
+;; (let ((v (variable-at-point))
+;; (enable-recursive-minibuffers t)
+;; (orig-buffer (current-buffer))
+;; val)
+;; (setq val (completing-read
+;; (if (symbolp v)
+;; (format
+;; "Debug on set to symbol (default %s): " v)
+;; "Debug on set to symbol: ")
+;; #'help--symbol-completion-table
+;; (lambda (vv)
+;; ;; In case the variable only exists in the buffer
+;; ;; the command we switch back to that buffer before
+;; ;; we examine the variable.
+;; (with-current-buffer orig-buffer
+;; (or (get vv 'variable-documentation)
+;; (and (boundp vv) (not (keywordp vv))))))
+;; t nil nil
+;; (if (symbolp v) (symbol-name v))))
+;; (list (if (equal val "")
+;; v (intern val)))))
+
+
+
+;; (interactive
+;; (let* ((var-default (variable-at-point))
+;; (var (completing-read
+;; (if var-default
+;; (format "Debug on set to symbol (default %s): " var-default)
+;; "Debug on set to symbol: ")
+;; nil
+;; #'boundp
+;; t nil nil (symbol-name var-default))))
+;; (list (if (equal var "") var-default (intern var)))))
+;; (advice-add function :before #'debug--implement-debug-on-entry
+;; '((depth . -100)))
+;; function)
+
(defun debug--function-list ()
"List of functions currently set for debug on entry."
(let ((funs '()))