emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu 5380f0a232 3/3: corfu-popupinfo: Minor cleanup


From: ELPA Syncer
Subject: [elpa] externals/corfu 5380f0a232 3/3: corfu-popupinfo: Minor cleanup
Date: Sat, 19 Nov 2022 23:57:35 -0500 (EST)

branch: externals/corfu
commit 5380f0a232561f8268f494044379a778895f5659
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    corfu-popupinfo: Minor cleanup
---
 extensions/corfu-popupinfo.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index 57db7bad66..1839eeaf18 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -158,7 +158,7 @@ all values are in pixels relative to the origin. See
           (when-let* ((fun (plist-get corfu--extra :company-location))
                       ;; BUG: company-location may throw errors if location is 
not found
                       (loc (ignore-errors (funcall fun candidate)))
-                      (buf (or (and (bufferp (car loc)) (car loc))
+                      (res (or (and (bufferp (car loc)) (car loc))
                                (get-file-buffer (car loc))
                                (let ((inhibit-message t)
                                      (enable-dir-local-variables nil)
@@ -166,7 +166,7 @@ all values are in pixels relative to the origin. See
                                      (non-essential t)
                                      (delay-mode-hooks t))
                                  (setq cleanup (find-file-noselect (car loc) 
t))))))
-            (with-current-buffer buf
+            (with-current-buffer res
               (save-excursion
                 (save-restriction
                   (widen)
@@ -179,10 +179,9 @@ all values are in pixels relative to the origin. See
                     (forward-line (* 10 corfu-popupinfo-max-height))
                     (when jit-lock-mode
                       (jit-lock-fontify-now beg (point)))
-                    (let ((res (buffer-substring beg (point))))
-                      (and (not (string-blank-p res)) res))))))))
-    (unless (bufferp (car loc))
-      (kill-buffer buf))))))
+                    (setq res (buffer-substring beg (point)))
+                    (and (not (string-blank-p res)) res)))))))
+      (when cleanup (kill-buffer cleanup)))))
 
 (defun corfu-popupinfo--get-documentation (candidate)
   "Get the documentation for CANDIDATE."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]