Make compat macro mh-display-completion-list obsolete

* lisp/mh-e/mh-compat.el (mh-display-completion-list): Make compat
macro obsolete.  Update callers.
This commit is contained in:
Stefan Kangas 2022-08-06 20:32:59 +02:00
parent b9c65203d0
commit db2b5e784b
2 changed files with 12 additions and 10 deletions

View file

@ -69,6 +69,7 @@ The optional argument COMMON-SUBSTRING, if non-nil, should be a string
specifying a common substring for adding the faces
`completions-first-difference' and `completions-common-part' to
the completions."
(declare (obsolete nil "29.1"))
`(display-completion-list
(completion-hilit-commonality ,completions
,(length common-substring) nil)))

View file

@ -864,16 +864,17 @@ Any match found replaces the text from BEGIN to END."
((stringp completion)
(if (equal word completion)
(with-output-to-temp-buffer completions-buffer
(mh-display-completion-list
(all-completions word choices)
;; The `common-substring' arg only works if it's a prefix.
(unless (and (functionp choices)
(let ((bounds
(funcall choices
word nil '(boundaries . ""))))
(and (eq 'boundaries (car-safe bounds))
(< 0 (cadr bounds)))))
word)))
(display-completion-list
(completion-hilit-commonality
(all-completions word choices)
;; The `common-substring' arg only works if it's a prefix.
(unless (and (functionp choices)
(let ((bounds
(funcall choices
word nil '(boundaries . ""))))
(and (eq 'boundaries (car-safe bounds))
(< 0 (cadr bounds)))))
word))))
(ignore-errors
(kill-buffer completions-buffer))
(delete-region begin end)