summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1993-02-08 20:46:10 +0000
committerRoland McGrath <roland@gnu.org>1993-02-08 20:46:10 +0000
commitbd3910fef239ce85f43dbf7e981b4f344a372c46 (patch)
tree00ffd639a81036461fa2bc54fdd9f67b1c509c2c /lisp
parentb5ff800400a7d4f984dd111980e213f2007bfdf7 (diff)
downloademacs-bd3910fef239ce85f43dbf7e981b4f344a372c46.tar.gz
(compilation-forget-errors): Just set
compilation-directory-stack to nil; no need to loop through it. (next-error): For a non-numeric prefix arg, pass nil for compile-reinitialize-errors's FIND-AT-LEAST arg. (next-error): When getting marker for error source location, be sure to examine buffer local value of compilation-old-error-list before switching to source file buffer.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/compile.el26
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 3c47657c918..999427e2610 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -632,7 +632,11 @@ See variables `compilation-parse-errors-function' and
\`compilation-error-regexp-alist' for customization ideas."
(interactive "P")
(setq compilation-last-buffer (compilation-find-buffer))
- (compile-reinitialize-errors argp nil (1- (prefix-numeric-value argp)))
+ (compile-reinitialize-errors argp nil
+ ;; We want to pass a number here only if
+ ;; we got a numeric prefix arg, not just C-u.
+ (and (not (consp argp))
+ (1- (prefix-numeric-value argp))))
;; Make ARGP nil if the prefix arg was just C-u,
;; since that means to reparse the errors, which the
;; compile-reinitialize-errors call just did.
@@ -688,12 +692,15 @@ See variables `compilation-parse-errors-function' and
;; Look for the next error.
t)
;; We found the file. Get a marker for this error.
- (set-buffer buffer)
- (save-excursion
- (save-restriction
- (widen)
- (let ((errors compilation-old-error-list)
- (last-line (cdr (cdr next-error))))
+ ;; compilation-old-error-list is a buffer-local
+ ;; variable, so we must be careful to extract its value
+ ;; before switching to the source file buffer.
+ (let ((errors compilation-old-error-list)
+ (last-line (cdr (cdr next-error))))
+ (set-buffer buffer)
+ (save-excursion
+ (save-restriction
+ (widen)
(goto-line last-line)
(beginning-of-line)
(setcdr next-error (point-marker))
@@ -793,9 +800,8 @@ See variables `compilation-parse-errors-function' and
(if (markerp (cdr next-error))
(set-marker (cdr next-error) nil)))
(setq compilation-old-error-list (cdr compilation-old-error-list)))
- (setq compilation-error-list nil)
- (while (cdr compilation-directory-stack)
- (setq compilation-directory-stack (cdr compilation-directory-stack))))
+ (setq compilation-error-list nil
+ compilation-directory-stack nil))
(defun count-regexp-groupings (regexp)