       s
     (encode-coding-string s 'utf-8 t)))
 
-(defun ycmd--standard-content (&optional buffer pos)
+(defun ycmd--standard-content (buffer pos)
   "Generate the 'standard' content for ycmd posts.
 
-This extracts a bunch of information from BUFFER.  If BUFFER is
-nil, this uses the current buffer."
-  (with-current-buffer (or buffer (current-buffer))
+This extracts a bunch of information from BUFFER at POS.  If
+BUFFER is nil, this uses the current buffer."
+  (with-current-buffer buffer
     (let* ((column-num (+ 1 (ycmd--column-in-bytes)))
-           (line-num (line-number-at-pos (or pos (point))))
+           (line-num (line-number-at-pos pos))
            (full-path (ycmd--encode-string (or (buffer-file-name) "")))
            (file-contents (ycmd--encode-string
                            (buffer-substring-no-properties

and blocks until the request has finished."
  (when ycmd-mode
    (let* ((buffer (current-buffer))
           (extra-content (and ycmd-force-semantic-completion
                               'force-semantic))
           (content (ycmd--standard-content-with-extras
                     buffer extra-content)))
      (ycmd--request
       "/completions"
       content

        ("line_num" . ,line-num)
        ("column_num" . ,column-num)))))

(defun ycmd--standard-content-with-extras (buffer pos &optional extras)
  "Generate 'standard' content for BUFFER at POS with EXTRAS."
  (let ((standard-content (ycmd--standard-content buffer pos)))
    (unless (listp extras)
      (setq extras (list extras)))
    (dolist (extra extras standard-content)
