diff options
| author | Stefan Monnier | 2004-05-02 20:44:55 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-05-02 20:44:55 +0000 |
| commit | e3bef839dd6c7c7da8caaec0eb1dc06b83bce621 (patch) | |
| tree | 1c3f1913d170cfb6b946f901283e796ea905f88b | |
| parent | 55f2eb7e341cbf56388f2d0fadca14e58df93f02 (diff) | |
| download | emacs-e3bef839dd6c7c7da8caaec0eb1dc06b83bce621.tar.gz emacs-e3bef839dd6c7c7da8caaec0eb1dc06b83bce621.zip | |
(compilation-gcpro): New var
(compilation-fake-loc): Use it.
(compilation-forget-errors): Reset it.
| -rw-r--r-- | lisp/progmodes/compile.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index da05a7ff8bb..e2d3e94e80a 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -1457,6 +1457,10 @@ Use this command in a compilation log buffer. Sets the mark at point there." | |||
| 1457 | (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc)) | 1457 | (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc)) |
| 1458 | (setcdr (nthcdr 3 loc) t))) ; Set this one as visited. | 1458 | (setcdr (nthcdr 3 loc) t))) ; Set this one as visited. |
| 1459 | 1459 | ||
| 1460 | (defvar compilation-gcpro nil | ||
| 1461 | "Internal variable used to keep some values from being GC'd.") | ||
| 1462 | (make-variable-buffer-local 'compilation-gcpro) | ||
| 1463 | |||
| 1460 | (defun compilation-fake-loc (marker file &optional line col) | 1464 | (defun compilation-fake-loc (marker file &optional line col) |
| 1461 | "Preassociate MARKER with FILE. | 1465 | "Preassociate MARKER with FILE. |
| 1462 | FILE should be ABSOLUTE-FILENAME or (RELATIVE-FILENAME . DIRNAME). | 1466 | FILE should be ABSOLUTE-FILENAME or (RELATIVE-FILENAME . DIRNAME). |
| @@ -1476,6 +1480,11 @@ call this several times, once each for the last line of one | |||
| 1476 | region and the first line of the next region." | 1480 | region and the first line of the next region." |
| 1477 | (or (consp file) (setq file (list file))) | 1481 | (or (consp file) (setq file (list file))) |
| 1478 | (setq file (compilation-get-file-structure file)) | 1482 | (setq file (compilation-get-file-structure file)) |
| 1483 | ;; Between the current call to compilation-fake-loc and the first occurrence | ||
| 1484 | ;; of an error message referring to `file', the data is only kept is the | ||
| 1485 | ;; weak hash-table compilation-locs, so we need to prevent this entry | ||
| 1486 | ;; in compilation-locs from being GC'd away. --Stef | ||
| 1487 | (push file compilation-gcpro) | ||
| 1479 | (let ((loc (compilation-assq (or line 1) (cdr file)))) | 1488 | (let ((loc (compilation-assq (or line 1) (cdr file)))) |
| 1480 | (setq loc (compilation-assq col loc)) | 1489 | (setq loc (compilation-assq col loc)) |
| 1481 | (if (cdr loc) | 1490 | (if (cdr loc) |
| @@ -1730,6 +1739,7 @@ FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME)." | |||
| 1730 | ;; In case we hit the same file/line specs, we want to recompute a new | 1739 | ;; In case we hit the same file/line specs, we want to recompute a new |
| 1731 | ;; marker for them, so flush our cache. | 1740 | ;; marker for them, so flush our cache. |
| 1732 | (setq compilation-locs (make-hash-table :test 'equal :weakness 'value)) | 1741 | (setq compilation-locs (make-hash-table :test 'equal :weakness 'value)) |
| 1742 | (setq compilation-gcpro nil) | ||
| 1733 | ;; FIXME: the old code reset the directory-stack, so maybe we should | 1743 | ;; FIXME: the old code reset the directory-stack, so maybe we should |
| 1734 | ;; put a `directory change' marker of some sort, but where? -stef | 1744 | ;; put a `directory change' marker of some sort, but where? -stef |
| 1735 | ;; | 1745 | ;; |