[MLton-commit] r5696
Vesa Karvonen
vesak at mlton.org
Fri Jun 29 06:28:58 PDT 2007
Do not load the same duf multiple times.
----------------------------------------------------------------------
U mlton/trunk/ide/emacs/esml-du-mlton.el
----------------------------------------------------------------------
Modified: mlton/trunk/ide/emacs/esml-du-mlton.el
===================================================================
--- mlton/trunk/ide/emacs/esml-du-mlton.el 2007-06-29 13:13:13 UTC (rev 5695)
+++ mlton/trunk/ide/emacs/esml-du-mlton.el 2007-06-29 13:28:57 UTC (rev 5696)
@@ -62,14 +62,17 @@
0.5 nil
(function
(lambda (duf)
- (let ((ctx (esml-du-ctx (def-use-file-truename duf))))
- (esml-du-load ctx)
- (def-use-add-dus
- (function esml-du-title)
- (function esml-du-sym-at-ref)
- (function esml-du-sym-to-uses)
- (function esml-du-finalize)
- ctx))))
+ (let ((duf (def-use-file-truename duf)))
+ (unless (member duf esml-du-live-dufs)
+ (let ((ctx (esml-du-ctx duf)))
+ (esml-du-load ctx)
+ (add-to-list 'esml-du-live-dufs duf)
+ (def-use-add-dus
+ (function esml-du-title)
+ (function esml-du-sym-at-ref)
+ (function esml-du-sym-to-uses)
+ (function esml-du-finalize)
+ ctx))))))
duf))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -190,12 +193,18 @@
(when buffer
(kill-buffer buffer))))
+(defvar esml-du-live-dufs nil)
+
(defun esml-du-finalize (ctx)
(esml-du-stop-parsing ctx)
(let ((timer (esml-du-ctx-poll-timer ctx)))
(when timer
(compat-delete-timer timer)
- (esml-du-ctx-set-poll-timer nil ctx))))
+ (esml-du-ctx-set-poll-timer nil ctx)))
+ (setq esml-du-live-dufs
+ (remove* (esml-du-ctx-duf ctx)
+ esml-du-live-dufs
+ :test (function equal))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Context
More information about the MLton-commit
mailing list