(discard-input) avoids getting stuck.
This commit is contained in:
		
							parent
							
								
									411a584bb8
								
							
						
					
					
						commit
						0d494f3c8e
					
				| @ -48,7 +48,8 @@ | ||||
| 	    (process-send-string pro cmd) | ||||
| 	    (when ghc-debug | ||||
| 	      (ghc-with-debug-buffer | ||||
| 	       (insert (format "%% %s" cmd)))))))))) | ||||
| 	       (insert (format "%% %s" cmd)))) | ||||
| 	    pro)))))) | ||||
| 
 | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
| 
 | ||||
| @ -100,9 +101,17 @@ | ||||
|   (setq ghc-process-rendezvous nil) | ||||
|   (setq ghc-process-results nil) | ||||
|   (setq ghc-process-num-of-results (or n 1)) | ||||
|   (ghc-with-process cmd 'ghc-process-callback nil hook) | ||||
|   (let ((pro (ghc-with-process cmd 'ghc-process-callback nil hook))) | ||||
|     (condition-case nil | ||||
| 	(while (null ghc-process-rendezvous) | ||||
|     (sit-for 0.1)) | ||||
| 	  ;; 0.1 is too fast for Emacs 24.4. | ||||
| 	  ;; (sit-for 0.1 t) may get stuck when tooltip is displayed. | ||||
| 	  (sit-for 0.1) | ||||
| 	  ;; (discard-input) avoids getting stuck. | ||||
| 	  (discard-input)) | ||||
|       (quit | ||||
|        (with-current-buffer (process-buffer pro) | ||||
| 	 (setq ghc-process-running nil))))) | ||||
|   ghc-process-results) | ||||
| 
 | ||||
| (defun ghc-process-callback (status) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Kazu Yamamoto
						Kazu Yamamoto