]> code.delx.au - gnu-emacs-elpa/blobdiff - company.el
Buf was unused
[gnu-emacs-elpa] / company.el
index a95f7f32ed4d9370a65be818fd36dd9715295b5f..4c2c1504031bf05b866b09484ea8ed9370f72428 100644 (file)
@@ -2147,13 +2147,22 @@ If SHOW-VERSION is non-nil, show the version in the echo area."
                           thereis (let ((company-backend b))
                                     (setq backend b)
                                     (company-call-backend 'prefix))))
-         cc)
+         cc annotations)
     (when (stringp prefix)
-      (setq cc (let ((company-backend backend))
-                 (company-call-backend 'candidates prefix))))
+      (let ((company-backend backend))
+        (setq cc (company-call-backend 'candidates prefix)
+              annotations
+              (mapcar
+               (lambda (c) (cons c (company-call-backend 'annotation c)))
+               cc))))
     (pop-to-buffer (get-buffer-create "*company-diag*"))
     (setq buffer-read-only nil)
     (erase-buffer)
+    (insert (format "Emacs %s (%s) of %s on %s"
+                    emacs-version system-configuration
+                    (format-time-string "%Y-%m-%d" emacs-build-time)
+                    emacs-build-system))
+    (insert "\nCompany " (company-version) "\n\n")
     (insert "company-backends: " (pp-to-string bb))
     (insert "\n")
     (insert "Used backend: " (pp-to-string backend))
@@ -2163,13 +2172,11 @@ If SHOW-VERSION is non-nil, show the version in the echo area."
     (insert (message  "Completions:"))
     (unless cc (insert " none"))
     (save-excursion
-      (let ((company-backend backend))
-        (dolist (c cc)
-          (insert "\n  " (prin1-to-string c))
-          (let ((ann (company-call-backend 'annotation)))
-            (when ann
-              (insert " " (prin1-to-string ann))))))
-      (special-mode))))
+      (dolist (c annotations)
+        (insert "\n  " (prin1-to-string (car c)))
+        (when (cdr c)
+          (insert " " (prin1-to-string (cdr c))))))
+    (special-mode)))
 
 ;;; pseudo-tooltip ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;