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

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

[elpa] externals/consult 8554973526 1/3: consult--line-candidates: Minor


From: ELPA Syncer
Subject: [elpa] externals/consult 8554973526 1/3: consult--line-candidates: Minor cleanup
Date: Thu, 2 Feb 2023 07:57:26 -0500 (EST)

branch: externals/consult
commit 8554973526275b91d8e1ba13009fc9ee2953ad7d
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    consult--line-candidates: Minor cleanup
---
 consult.el | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/consult.el b/consult.el
index 42b770ac1a..e44039bf17 100644
--- a/consult.el
+++ b/consult.el
@@ -3164,13 +3164,14 @@ CURR-LINE is the current line number."
         (when (and (not default-cand) (>= line curr-line))
           (setq default-cand candidates)))
       (cl-incf line))
-    (when candidates
-      (nreverse
-       (if (or top (not default-cand))
-           candidates
-         (let ((before (cdr default-cand)))
-           (setcdr default-cand nil)
-           (nconc before candidates)))))))
+    (unless candidates
+      (user-error "No lines"))
+    (nreverse
+     (if (or top (not default-cand))
+         candidates
+       (let ((before (cdr default-cand)))
+         (setcdr default-cand nil)
+         (nconc before candidates))))))
 
 (defun consult--line-point-placement (selected candidates highlighted &rest 
ignored-faces)
   "Find point position on matching line.
@@ -3217,9 +3218,8 @@ and the last `isearch-string' is added to the future 
history."
   (interactive (list nil (not (not current-prefix-arg))))
   (let* ((curr-line (line-number-at-pos (point) consult-line-numbers-widen))
          (top (not (eq start consult-line-start-from-top)))
-         (candidates (or (consult--with-increased-gc
-                          (consult--line-candidates top curr-line))
-                         (user-error "No lines"))))
+         (candidates (consult--with-increased-gc
+                      (consult--line-candidates top curr-line))))
     (consult--read
      candidates
      :prompt (if top "Go to line from top: " "Go to line: ")



reply via email to

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