summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/debug.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/debug.el')
-rw-r--r--lisp/emacs-lisp/debug.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 1a6ed584548..58fb3b4a1b8 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -704,6 +704,10 @@ If argument is nil or an empty string, cancel for all functions."
;; Skip the interactive form.
(if (eq 'interactive (car-safe (car tail))) (setq tail (cdr tail)))
(unless (eq flag (equal (car tail) '(debug 'debug)))
+ ;; If the function has no body, add nil as a body element.
+ (when (null tail)
+ (setq tail (list nil))
+ (nconc defn tail))
;; Add/remove debug statement as needed.
(if (not flag)
(progn (setcar tail (cadr tail))