mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
(ecomplete-add-item): Preserve the more complete text
Avoid replacing "John Doe <john@doe.ch>" with "john@doe.ch". * lisp/ecomplete.el (ecomplete-add-item): Keep the longest text
This commit is contained in:
parent
68cdb95019
commit
93c2daa33d
1 changed files with 5 additions and 1 deletions
|
|
@ -103,7 +103,11 @@ string that was matched."
|
|||
(unless elems
|
||||
(push (setq elems (list type)) ecomplete-database))
|
||||
(if (setq entry (assoc key (cdr elems)))
|
||||
(setcdr entry (list (1+ (cadr entry)) now text))
|
||||
(pcase-let ((`(,_key ,count ,_time ,oldtext) entry))
|
||||
(setcdr entry (list (1+ count) now
|
||||
;; Preserve the "more complete" text.
|
||||
(if (>= (length text) (length oldtext))
|
||||
text oldtext))))
|
||||
(nconc elems (list (list key 1 now text))))))
|
||||
|
||||
(defun ecomplete-get-item (type key)
|
||||
|
|
|
|||
Loading…
Reference in a new issue