bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46177: 27.1; Display problem with minibuffer overlay when using disp


From: Clemens
Subject: bug#46177: 27.1; Display problem with minibuffer overlay when using display property
Date: Fri, 29 Jan 2021 21:26:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

That's a feature: Emacs treats display strings and overlay strings
differently for the purposes of face merging.


Okay, thanks. I have a problem with this when displaying completion candidates in the minibuffer. The candidates are displayed via `after-string` overlay. The candidates are provided by the caller and can contain the `display` property. Right now I "inline" any parts of the string that use `display` to avoid this:


(defun selectrum--display-string (str)
  "Return display string of STR."
  (let ((len (length str))
        (display "")
        (start 0)
        (end 0))
    (while (not (eq len end))
      (setq end (next-single-property-change start 'display str len))
      (let ((val  (get-text-property start 'display str)))
        (if (and val (stringp val))
            (setq display (concat display val))
          (setq display (concat display (substring str start end)))))
      (setq start end))
    display))


Is there a better way?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]