branch: externals/orderless
commit 7f79dc2233947fafb710ae98bc3fa3971f1d9295
Author: Omar Antolín <[email protected]>
Commit: Omar Antolín <[email protected]>
Don't move point unless actually completing
---
orderless.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/orderless.el b/orderless.el
index b77a0dce40..de21508f65 100644
--- a/orderless.el
+++ b/orderless.el
@@ -146,11 +146,12 @@ If there are no matches, it returns nil. In any other
case it
(let* ((limit (car (completion-boundaries string table pred "")))
(prefix (substring string 0 limit))
(all (orderless-all-completions string table pred point)))
- (cl-flet ((measured (string) (cons string (length string))))
- (cond
- ((null all) nil)
- ((atom (cdr all)) (measured (concat prefix (car all))))
- (t (measured string))))))
+ (cond
+ ((null all) nil)
+ ((atom (cdr all))
+ (let ((full (concat prefix (car all))))
+ (cons full (length full))))
+ (t (cons string point)))))
(cl-pushnew '(orderless
orderless-try-completion orderless-all-completions