summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-02-27 09:57:51 +0000
committerRichard M. Stallman <rms@gnu.org>2005-02-27 09:57:51 +0000
commite29824bddcc3e5bb25e75115f72cd2bc6344c327 (patch)
tree9491b068df8c9555ce4a78b495db534588f43711 /lisp/emacs-lisp
parent91f1fd029f448b723a4c58c85c10f2c89324a057 (diff)
downloademacs-e29824bddcc3e5bb25e75115f72cd2bc6344c327.tar.gz
emacs-e29824bddcc3e5bb25e75115f72cd2bc6344c327.tar.bz2
emacs-e29824bddcc3e5bb25e75115f72cd2bc6344c327.zip
(debug-on-entry-1): If function body is empty, add nil as body form.
Diffstat (limited to 'lisp/emacs-lisp')
-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))