fix(emacs/lean-type): problem with lean-eldoc-nay-retry-time

If (current-idle-time) is non-zero, we need to set a timer to run
eldoc-documentation-function again when idle-time = (current-idle-time)
+ retry-delay.
This commit is contained in:
Soonho Kong 2014-08-26 23:58:02 -07:00
parent a1a14cf425
commit 224a4feba2
3 changed files with 24 additions and 21 deletions

View file

@ -501,6 +501,7 @@ Take out \"BEGININFO\" and \"ENDINFO\" and Use \"ACK\" as a delim."
(defun lean-get-info-record (file-name line-number column-number) (defun lean-get-info-record (file-name line-number column-number)
"Get info list from lean server using file-name and line-number" "Get info list from lean server using file-name and line-number"
(when (and file-name line-number column-number)
(lean-server-check-current-file file-name) (lean-server-check-current-file file-name)
(lean-server-send-cmd (lean-cmd-info line-number)) (lean-server-send-cmd (lean-cmd-info line-number))
(while (not lean-global-server-message-to-process) (while (not lean-global-server-message-to-process)
@ -516,7 +517,7 @@ Take out \"BEGININFO\" and \"ENDINFO\" and Use \"ACK\" as a delim."
(lean-server-log "%s" pre) (lean-server-log "%s" pre)
(lean-server-log "Something other than INFO detected: %S" type) (lean-server-log "Something other than INFO detected: %S" type)
;; (lean-server-log "Body: %S" body) ;; (lean-server-log "Body: %S" body)
(setq lean-global-server-message-to-process nil)))) (setq lean-global-server-message-to-process nil)))))
(defun lean-get-info-record-at-point () (defun lean-get-info-record-at-point ()
"Get info-record at the current point" "Get info-record at the current point"

View file

@ -45,7 +45,7 @@
:group 'lean :group 'lean
:type 'boolean) :type 'boolean)
(defcustom lean-eldoc-nay-retry-time 0.1 (defcustom lean-eldoc-nay-retry-time 0.3
"When eldoc-function had nay, try again after this amount of time.") "When eldoc-function had nay, try again after this amount of time.")
(defcustom lean-flycheck-checker-name "lmake" (defcustom lean-flycheck-checker-name "lmake"

View file

@ -35,8 +35,10 @@
info-string) info-string)
(cond (cond
((and info-record (lean-info-record-nay info-record)) ((and info-record (lean-info-record-nay info-record))
(lean-server-log "NAY Detected") (run-with-idle-timer
(run-with-idle-timer lean-eldoc-nay-retry-time (if (current-idle-time)
(time-add (seconds-to-time lean-eldoc-nay-retry-time) (current-idle-time))
lean-eldoc-nay-retry-time)
nil nil
'lean-eldoc-documentation-function) 'lean-eldoc-documentation-function)
nil) nil)