 
 (defun ycmd-open ()
   (interactive)
+
+  (setq ycmd-hmac-secret (ycmd-generate-hmac-secret))
+  
   (let ((proc-buff (get-buffer-create "*ycmd-server*")))
     (set-buffer proc-buff)
     (erase-buffer)

  "The actual port being used by the ycmd server. This is set
  based on the output from the server itself.")

(defconst ycmd-hmac-secret "1234123412341234") ; TODO: Create real secret code.

(defconst ycmd-server-process "ycmd-server")

(defun ycmd-json-encode (obj)
  "A version of json-encode that uses {} instead of null for nil
values. This produces output for empty alists that ycmd expects."
  (flet ((json-encode-keyword (k) (cond ((eq k t)          "true")
                                        ((eq k json-false) "false")
                                        ((eq k json-null)  "{}"))))

	    (incf cont)
	    (when (< 3000 cont) ; timeout after 3 seconds
	      (error "Server timeout.")))))))))

;; TODO: ycmd-close

(defun ycmd-display-completions (pos)
  (interactive "d")
