diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 315f2d369a..31d7be3441 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1785,14 +1800,7 @@ completion--insert-strings (when prefix (let ((beg (point)) (end (progn (insert prefix) (point)))) - (put-text-property beg end 'mouse-face nil) - ;; When both prefix and suffix are added - ;; by the caller via affixation-function, - ;; then allow the caller to decide - ;; what faces to put on prefix and suffix. - (unless prefix - (font-lock-prepend-text-property - beg end 'face 'completions-annotations)))) + (put-text-property beg end 'mouse-face nil))) (put-text-property (point) (progn (insert (car str)) (point)) 'mouse-face 'highlight) (let ((beg (point)) @@ -1800,7 +1808,12 @@ completion--insert-strings (put-text-property beg end 'mouse-face nil) ;; Put the predefined face only when suffix ;; is added via annotation-function. - (unless prefix + ;; Otherwise, when only suffix is added + ;; by the caller via annotation-function, + ;; then allow the caller to decide + ;; what faces to put on suffix. + (unless (or prefix (text-property-not-all + 0 (length suffix) 'face nil suffix)) (font-lock-prepend-text-property beg end 'face 'completions-annotations))))) (cond