[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu bedd0fa5be 1/5: corfu-popupinfo: Compare candidat
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu bedd0fa5be 1/5: corfu-popupinfo: Compare candidates with equal-including-properties (Fix #476) |
Date: |
Wed, 10 Jul 2024 06:57:44 -0400 (EDT) |
branch: externals/corfu
commit bedd0fa5bec33a853b4f9ef140f463a586eee5bc
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
corfu-popupinfo: Compare candidates with equal-including-properties (Fix
#476)
---
corfu.el | 18 +++++++++++-------
extensions/corfu-popupinfo.el | 3 ++-
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/corfu.el b/corfu.el
index edb1a7a6f2..660704d335 100644
--- a/corfu.el
+++ b/corfu.el
@@ -590,6 +590,16 @@ FRAME is the existing frame."
(eq t (compare-strings word 0 len it 0 len
completion-ignore-case))))))
+(defalias 'corfu--equal-including-properties
+ ;; bug#6581: `equal-including-properties' uses `eq' to compare
+ ;; properties until 29.1. Approximate by comparing
+ ;; `text-properties-at' position 0.
+ (static-if (< emacs-major-version 29)
+ (lambda (x y)
+ (and (equal x y)
+ (equal (text-properties-at 0 x) (text-properties-at 0 y))))
+ #'equal-including-properties))
+
(defun corfu--delete-dups (list)
"Delete `equal-including-properties' consecutive duplicates from LIST."
(let ((beg list))
@@ -602,13 +612,7 @@ FRAME is the existing frame."
(while (not (eq beg end))
(let ((dup beg))
(while (not (eq (cdr dup) end))
- ;; bug#6581: `equal-including-properties' uses `eq' to compare
- ;; properties until 29.1. Approximate by comparing
- ;; `text-properties-at' position 0.
- (if (static-if (< emacs-major-version 29)
- (equal (text-properties-at 0 (car beg))
- (text-properties-at 0 (cadr dup)))
- (equal-including-properties (car beg) (cadr dup)))
+ (if (corfu--equal-including-properties (car beg) (cadr dup))
(setcdr dup (cddr dup))
(pop dup))))
(pop beg)))))
diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index 3a0991132f..2d336723eb 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -345,7 +345,8 @@ form (X Y WIDTH HEIGHT DIR)."
(when (and (corfu-popupinfo--visible-p corfu--frame))
(let* ((cand-changed
(not (and (corfu-popupinfo--visible-p)
- (equal candidate corfu-popupinfo--candidate))))
+ (corfu--equal-including-properties
+ candidate corfu-popupinfo--candidate))))
(new-coords (frame-edges corfu--frame 'inner-edges))
(coords-changed (not (equal new-coords
corfu-popupinfo--coordinates))))
(when cand-changed
- [elpa] externals/corfu updated (03558e1935 -> c1d75d3cd1), ELPA Syncer, 2024/07/10
- [elpa] externals/corfu 062e4f08d6 4/5: Call completion-metadata-get without advices, ELPA Syncer, 2024/07/10
- [elpa] externals/corfu 2cd4bba3c7 3/5: Minor cleanup, reduce allocations, ELPA Syncer, 2024/07/10
- [elpa] externals/corfu b7099b4b71 2/5: Formatting, ELPA Syncer, 2024/07/10
- [elpa] externals/corfu c1d75d3cd1 5/5: Update comment, ELPA Syncer, 2024/07/10
- [elpa] externals/corfu bedd0fa5be 1/5: corfu-popupinfo: Compare candidates with equal-including-properties (Fix #476),
ELPA Syncer <=