fixing infloop.
This commit is contained in:
parent
62df0fa871
commit
649a35ab72
@ -11,6 +11,7 @@
|
|||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(defvar ghc-ins-mod-rendezvous nil)
|
(defvar ghc-ins-mod-rendezvous nil)
|
||||||
|
(defvar ghc-ins-mod-results nil)
|
||||||
|
|
||||||
(defun ghc-insert-module ()
|
(defun ghc-insert-module ()
|
||||||
(interactive)
|
(interactive)
|
||||||
@ -52,12 +53,13 @@
|
|||||||
|
|
||||||
(defun ghc-function-to-modules (fun)
|
(defun ghc-function-to-modules (fun)
|
||||||
(setq ghc-ins-mod-rendezvous nil)
|
(setq ghc-ins-mod-rendezvous nil)
|
||||||
|
(setq ghc-ins-mod-results nil)
|
||||||
(ghc-with-process
|
(ghc-with-process
|
||||||
(lambda () (ghc-ins-mod-send fun))
|
(lambda () (ghc-ins-mod-send fun))
|
||||||
'ghc-ins-mod-callback)
|
'ghc-ins-mod-callback)
|
||||||
(while (null ghc-ins-mod-rendezvous)
|
(while (null ghc-ins-mod-rendezvous)
|
||||||
(sit-for 0.01))
|
(sit-for 0.01))
|
||||||
ghc-ins-mod-rendezvous)
|
ghc-ins-mod-results)
|
||||||
|
|
||||||
(defun ghc-ins-mod-send (fun)
|
(defun ghc-ins-mod-send (fun)
|
||||||
(concat "find " fun "\n"))
|
(concat "find " fun "\n"))
|
||||||
@ -69,8 +71,7 @@
|
|||||||
(forward-line)
|
(forward-line)
|
||||||
(setq line (buffer-substring-no-properties beg (1- (point))))
|
(setq line (buffer-substring-no-properties beg (1- (point))))
|
||||||
(setq lines (cons line lines)))
|
(setq lines (cons line lines)))
|
||||||
(with-current-buffer ghc-process-original-buffer
|
(setq ghc-ins-mod-rendezvous t)
|
||||||
(setq ghc-ins-mod-rendezvous
|
(setq ghc-ins-mod-results (nreverse (cdr lines))))) ;; removing "OK"
|
||||||
(nreverse (cdr lines)))))) ;; removing "OK"
|
|
||||||
|
|
||||||
(provide 'ghc-ins-mod)
|
(provide 'ghc-ins-mod)
|
||||||
|
Loading…
Reference in New Issue
Block a user