   :type 'hook
   :risky t)
 
+(defcustom ycmd-parse-delay 0.2
+  "Number of seconds to wait after buffer modification before re-parsing the contents."
+  :group 'ycmd
+  :type '(number))
+
 (defcustom ycmd-keepalive-period 30
   "Number of seconds between keepalive messages."
   :group 'ycmd
   :type '(number))
+
+(defvar-local ycmd--buffer-needs-parse nil
+  "Indicates if a buffer has been modified since its last parse.")
 
 (defun ycmd-open ()
   "Start a new ycmd server.

                       :parser 'json-read)
        (deferred:nextc it
          (lambda (results)
	    (run-hook-with-args 'ycmd-file-parse-result-hook results)))))))

(defun ycmd-display-raw-file-parse-results ()
  "Request file-parse results and display them in a buffer in raw form.

  (ycmd--kill-notification-timer)
  (setq ycmd--notification-timer
        (run-with-idle-timer
         ycmd-parse-delay t (lambda () (ycmd-notify-file-ready-to-parse)))))

(defun ycmd--kill-notification-timer ()
  (when ycmd--notification-timer
