giving up idle-timer.
- cannot avoid race - not friendly with cradle.
This commit is contained in:
parent
0bb71c2bfc
commit
69cacb0865
@ -99,11 +99,7 @@ unloaded modules are loaded")
|
|||||||
"Data.Maybe"
|
"Data.Maybe"
|
||||||
"System.Directory"
|
"System.Directory"
|
||||||
"System.FilePath"
|
"System.FilePath"
|
||||||
"System.IO"))
|
"System.IO")))
|
||||||
;; fixme :: ghc-sync-process uses a global var for syncing.
|
|
||||||
;; This may causes race.
|
|
||||||
;; (run-with-idle-timer ghc-idle-timer-interval 'repeat 'ghc-idle-timer)
|
|
||||||
)
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;
|
;;;
|
||||||
@ -247,9 +243,6 @@ unloaded modules are loaded")
|
|||||||
(not (member mod ghc-loaded-module))))
|
(not (member mod ghc-loaded-module))))
|
||||||
mods))
|
mods))
|
||||||
|
|
||||||
(defun ghc-load-module-all-buffers ()
|
|
||||||
(ghc-load-merge-modules (ghc-gather-import-modules-all-buffers)))
|
|
||||||
|
|
||||||
(defun ghc-load-module-buffer ()
|
(defun ghc-load-module-buffer ()
|
||||||
(ghc-load-merge-modules (ghc-gather-import-modules-buffer)))
|
(ghc-load-merge-modules (ghc-gather-import-modules-buffer)))
|
||||||
|
|
||||||
@ -273,26 +266,6 @@ unloaded modules are loaded")
|
|||||||
(defun ghc-module-keyword (mod)
|
(defun ghc-module-keyword (mod)
|
||||||
(symbol-value (ghc-module-symbol mod)))
|
(symbol-value (ghc-module-symbol mod)))
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(ghc-defstruct buffer name file)
|
|
||||||
|
|
||||||
(defun ghc-buffer-name-file (buf)
|
|
||||||
(ghc-make-buffer
|
|
||||||
:name (buffer-name buf)
|
|
||||||
:file (buffer-file-name buf)))
|
|
||||||
|
|
||||||
(defun ghc-gather-import-modules-all-buffers ()
|
|
||||||
(let ((bufs (mapcar 'ghc-buffer-name-file (buffer-list)))
|
|
||||||
ret file)
|
|
||||||
(save-excursion
|
|
||||||
(dolist (buf bufs (ghc-uniq-lol ret))
|
|
||||||
(setq file (ghc-buffer-get-file buf))
|
|
||||||
(when (and file (string-match "\\.hs$" file))
|
|
||||||
(set-buffer (ghc-buffer-get-name buf))
|
|
||||||
(ghc-add ret (ghc-gather-import-modules-buffer)))))))
|
|
||||||
|
|
||||||
(defun ghc-gather-import-modules-buffer ()
|
(defun ghc-gather-import-modules-buffer ()
|
||||||
(let (ret)
|
(let (ret)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
@ -307,6 +280,4 @@ unloaded modules are loaded")
|
|||||||
;;; Background Idle Timer
|
;;; Background Idle Timer
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(defalias 'ghc-idle-timer 'ghc-load-module-all-buffers)
|
|
||||||
|
|
||||||
(provide 'ghc-comp)
|
(provide 'ghc-comp)
|
||||||
|
Loading…
Reference in New Issue
Block a user