martin rudalics writes: >> [1] Compare: >> >> (let ((prompt "foobar ")) >> (add-face-text-property 3 6 'warning nil prompt) >> (yes-or-no-p prompt)) >> >> With: >> >> (let ((prompt "foobar ")) >> (add-face-text-property 3 6 'warning nil prompt) >> (y-or-n-p prompt)) > > 'y-or-n-p' propertizes the prompt rigidly as > > (read-key (propertize (if (memq answer scroll-actions) > prompt > (concat "Please answer y or n. " > prompt)) > 'face 'minibuffer-prompt))))) > > while 'yes-or-no-p' carefully applies 'minibuffer-prompt-properties' > to any text properties provided with PROMPT. Well, that's interesting. I dug into yes-or-no-p until I came across `read_minibuf()'; is this the code you are referring to? if (PT > BEG) { Fput_text_property (make_fixnum (BEG), make_fixnum (PT), Qfront_sticky, Qt, Qnil); Fput_text_property (make_fixnum (BEG), make_fixnum (PT), Qrear_nonsticky, Qt, Qnil); Fput_text_property (make_fixnum (BEG), make_fixnum (PT), Qfield, Qt, Qnil); if (CONSP (Vminibuffer_prompt_properties)) { /* We want to apply all properties from `minibuffer-prompt-properties' to the region normally, but if the `face' property is present, add that property to the end of the face properties to avoid overwriting faces. */ Lisp_Object list = Vminibuffer_prompt_properties; while (CONSP (list)) { Lisp_Object key = XCAR (list); list = XCDR (list); if (CONSP (list)) { Lisp_Object val = XCAR (list); list = XCDR (list); if (EQ (key, Qface)) Fadd_face_text_property (make_fixnum (BEG), make_fixnum (PT), val, Qt, Qnil); else Fput_text_property (make_fixnum (BEG), make_fixnum (PT), key, val, Qnil); } } } } If one were to fix the issue of y-or-n-p hardcoding the face property, what would be the best way to go? 1. Make a C DEFUN out of this snippet, and have it called by `read_minibuf()' and `y-or-n-p'. 2. Re-implement this snippet as an Elisp defun, and have it called by `read_minibuf()' and `y-or-n-p'. 3. (Re-implement this snippet within `y-or-n-p'.) (FWIW, the attached patch seems to work as a workaround, but I assume solutions 1 or 2 would be better, by virtue of reusing code)