]> code.delx.au - gnu-emacs-elpa/commitdiff
Move to top of long documentation buffers.
authorNikolaj Schumacher <git@nschum.de>
Mon, 22 Feb 2010 14:23:29 +0000 (15:23 +0100)
committerNikolaj Schumacher <git@nschum.de>
Tue, 23 Feb 2010 14:17:08 +0000 (15:17 +0100)
company.el

index 37cd89362c329ca7a4991dd5a0309a8e13bf8aa2..f654039481a3cc078b5d1cc454502a7b52bfcfb3 100644 (file)
@@ -1448,9 +1448,12 @@ To show the number next to the candidates in some back-ends, enable
   "Temporarily show a buffer with the complete documentation for the selection."
   (interactive)
   (company--electric-do
-    (let ((selected (nth company-selection company-candidates)))
-      (display-buffer (or (company-call-backend 'doc-buffer selected)
-                          (error "No documentation available")) t))))
+    (let* ((selected (nth company-selection company-candidates))
+           (doc-buffer (or (company-call-backend 'doc-buffer selected)
+                           (error "No documentation available"))))
+      (with-current-buffer doc-buffer
+        (goto-char (point-min)))
+      (display-buffer doc-buffer t))))
 (put 'company-show-doc-buffer 'company-keep t)
 
 (defun company-show-location ()