aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-09-13 17:13:10 -0400
committerGlenn Morris2011-09-13 17:13:10 -0400
commit5f66aa05d482ebb786d5941e78d95b74e4561465 (patch)
tree78f0fd9e22c49f4fb5c92a439872bba97f81db1e
parent8e39b2e837bb3de939eda51074b6c6f95aaef5f2 (diff)
downloademacs-5f66aa05d482ebb786d5941e78d95b74e4561465.tar.gz
emacs-5f66aa05d482ebb786d5941e78d95b74e4561465.zip
Tabify previous change.
-rw-r--r--lisp/emacs-lisp/debug.el124
1 files changed, 62 insertions, 62 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 6533721054c..16258a5a3a1 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -345,68 +345,68 @@ That buffer should be current already."
345 (save-excursion 345 (save-excursion
346 (setq buffer (current-buffer)) 346 (setq buffer (current-buffer))
347 (let ((inhibit-read-only t) 347 (let ((inhibit-read-only t)
348 (old-end (point-min)) (new-end (point-min))) 348 (old-end (point-min)) (new-end (point-min)))
349 ;; If we saved an old backtrace, find the common part 349 ;; If we saved an old backtrace, find the common part
350 ;; between the new and the old. 350 ;; between the new and the old.
351 ;; Compare line by line, starting from the end, 351 ;; Compare line by line, starting from the end,
352 ;; because that's the part that is likely to be unchanged. 352 ;; because that's the part that is likely to be unchanged.
353 (if debugger-previous-backtrace 353 (if debugger-previous-backtrace
354 (let (old-start new-start (all-match t)) 354 (let (old-start new-start (all-match t))
355 (goto-char (point-max)) 355 (goto-char (point-max))
356 (with-temp-buffer 356 (with-temp-buffer
357 (insert debugger-previous-backtrace) 357 (insert debugger-previous-backtrace)
358 (while (and all-match (not (bobp))) 358 (while (and all-match (not (bobp)))
359 (setq old-end (point)) 359 (setq old-end (point))
360 (forward-line -1) 360 (forward-line -1)
361 (setq old-start (point)) 361 (setq old-start (point))
362 (with-current-buffer buffer 362 (with-current-buffer buffer
363 (setq new-end (point)) 363 (setq new-end (point))
364 (forward-line -1) 364 (forward-line -1)
365 (setq new-start (point))) 365 (setq new-start (point)))
366 (if (not (zerop 366 (if (not (zerop
367 (let ((case-fold-search nil)) 367 (let ((case-fold-search nil))
368 (compare-buffer-substrings 368 (compare-buffer-substrings
369 (current-buffer) old-start old-end 369 (current-buffer) old-start old-end
370 buffer new-start new-end)))) 370 buffer new-start new-end))))
371 (setq all-match nil)))) 371 (setq all-match nil))))
372 ;; Now new-end is the position of the start of the 372 ;; Now new-end is the position of the start of the
373 ;; unchanged part in the current buffer, and old-end is 373 ;; unchanged part in the current buffer, and old-end is
374 ;; the position of that same text in the saved old 374 ;; the position of that same text in the saved old
375 ;; backtrace. But we must subtract (point-min) since strings are 375 ;; backtrace. But we must subtract (point-min) since strings are
376 ;; indexed in origin 0. 376 ;; indexed in origin 0.
377 377
378 ;; Replace the unchanged part of the backtrace 378 ;; Replace the unchanged part of the backtrace
379 ;; with the text from debugger-previous-backtrace, 379 ;; with the text from debugger-previous-backtrace,
380 ;; since that already has the proper xrefs. 380 ;; since that already has the proper xrefs.
381 ;; With this optimization, we only need to scan 381 ;; With this optimization, we only need to scan
382 ;; the changed part of the backtrace. 382 ;; the changed part of the backtrace.
383 (delete-region new-end (point-max)) 383 (delete-region new-end (point-max))
384 (goto-char (point-max)) 384 (goto-char (point-max))
385 (insert (substring debugger-previous-backtrace 385 (insert (substring debugger-previous-backtrace
386 (- old-end (point-min)))) 386 (- old-end (point-min))))
387 ;; Make the unchanged part of the backtrace inaccessible 387 ;; Make the unchanged part of the backtrace inaccessible
388 ;; so it won't be scanned. 388 ;; so it won't be scanned.
389 (narrow-to-region (point-min) new-end))) 389 (narrow-to-region (point-min) new-end)))
390 390
391 ;; Scan the new part of the backtrace, inserting xrefs. 391 ;; Scan the new part of the backtrace, inserting xrefs.
392 (goto-char (point-min)) 392 (goto-char (point-min))
393 (while (progn 393 (while (progn
394 (goto-char (+ (point) 2)) 394 (goto-char (+ (point) 2))
395 (skip-syntax-forward "^w_") 395 (skip-syntax-forward "^w_")
396 (not (eobp))) 396 (not (eobp)))
397 (let* ((beg (point)) 397 (let* ((beg (point))
398 (end (progn (skip-syntax-forward "w_") (point))) 398 (end (progn (skip-syntax-forward "w_") (point)))
399 (sym (intern-soft (buffer-substring-no-properties 399 (sym (intern-soft (buffer-substring-no-properties
400 beg end))) 400 beg end)))
401 (file (and sym (symbol-file sym 'defun)))) 401 (file (and sym (symbol-file sym 'defun))))
402 (when file 402 (when file
403 (goto-char beg) 403 (goto-char beg)
404 ;; help-xref-button needs to operate on something matched 404 ;; help-xref-button needs to operate on something matched
405 ;; by a regexp, so set that up for it. 405 ;; by a regexp, so set that up for it.
406 (re-search-forward "\\(\\sw\\|\\s_\\)+") 406 (re-search-forward "\\(\\sw\\|\\s_\\)+")
407 (help-xref-button 0 'help-function-def sym file))) 407 (help-xref-button 0 'help-function-def sym file)))
408 (forward-line 1)) 408 (forward-line 1))
409 (widen)) 409 (widen))
410 (setq debugger-previous-backtrace (buffer-string))))) 410 (setq debugger-previous-backtrace (buffer-string)))))
411 411
412(defun debugger-step-through () 412(defun debugger-step-through ()