Subject: bug#40750: Use error face for errors

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 23 May 2022 13:55:12 +0200

Stefan Kangas <[email-masked]> writes:

> Of course, the error face should not just remove any faces that are
> already there; that precludes making e.g. keybindings stand out with the
> `help-key-binding' face.  So you would need to give the error-message
> face lower priority.

I started poking at this a bit, and I realised that I've never actually
seen an error message that has any kind of face.  And that's because
print_error_message uses princ on the strings we give error/signal, and
princ discards all text properties.

So there's nothing here to merge, really -- the strings, when they come
out of Ferror_message_string, are property-less.

I think.

And users can already alter the look of the error message by just using
command-error-function:

(setq command-error-function
      (lambda (data _ _)
	(message "%s" (propertize (error-message-string data)
				  'face 'error))))

So I don't think there's anything much here to implement, really, unless
we really want to start defaulting error messages to use a particular
face.  And I don't think we want that?

So I'm adding some more pointers to command-error-function from relevant
doc strings, because finding that variable wasn't trivial, and I'm
closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no