summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/debug.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-04-12 03:19:09 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-04-12 03:19:09 +0000
commit6836bb6931b740770c3afb72f08228657df4c961 (patch)
treeb96b070e5d1ff66228640f4e3f23be2cbacc6eb9 /lisp/emacs-lisp/debug.el
parent667e0ba62f1484761104eeb42499417432401b4c (diff)
downloademacs-6836bb6931b740770c3afb72f08228657df4c961.tar.gz
(debug-on-entry): Use push.
(debugger-make-xrefs): Don't assume point-min == 1.
Diffstat (limited to 'lisp/emacs-lisp/debug.el')
-rw-r--r--lisp/emacs-lisp/debug.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 1f3f4b3f56c..8c81dbd0bd8 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -291,7 +291,7 @@ That buffer should be current already."
(set-buffer (or buffer (current-buffer)))
(setq buffer (current-buffer))
(let ((buffer-read-only nil)
- (old-end 1) (new-end 1))
+ (old-end (point-min)) (new-end (point-min)))
;; If we saved an old backtrace, find the common part
;; between the new and the old.
;; Compare line by line, starting from the end,
@@ -317,7 +317,7 @@ That buffer should be current already."
;; Now new-end is the position of the start of the
;; unchanged part in the current buffer, and old-end is
;; the position of that same text in the saved old
- ;; backtrace. But we must subtract 1 since strings are
+ ;; backtrace. But we must subtract (point-min) since strings are
;; indexed in origin 0.
;; Replace the unchanged part of the backtrace
@@ -327,7 +327,8 @@ That buffer should be current already."
;; the changed part of the backtrace.
(delete-region new-end (point-max))
(goto-char (point-max))
- (insert (substring debugger-previous-backtrace (1- old-end)))
+ (insert (substring debugger-previous-backtrace
+ (- old-end (point-min))))
;; Make the unchanged part of the backtrace inaccessible
;; so it won't be scanned.
(narrow-to-region (point-min) new-end)))
@@ -622,7 +623,7 @@ Redefining FUNCTION also cancels it."
(error "Definition of %s is not a list" function))
(fset function (debug-on-entry-1 function (symbol-function function) t))
(or (memq function debug-function-list)
- (setq debug-function-list (cons function debug-function-list)))
+ (push function debug-function-list))
function)
;;;###autoload