The echon and echohl commands are very useful for outputting lines of text with multiple highlight groups within the same line. This can be used to for instance create nice status messages for plugins.In a plugin I am working on, I am using this exact method of outputting colored status messages. However, sometimes I would want to add these messages to the message-history in a similar way to  what you get with echomsg. Is this somehow possible? I don't believe there are any intrinsic functionality for this, but perhaps one could add the functionality with vim script?
`echon` for `echomsg`
statusline;highlight
This is not currently possible in Vim.Internally, :echomsg is implemented as :execute, except that when invoked as :echomsg the result of execution is displayed with the attribute of the last :echohl and saved to the message list (reference src/eval.c functions ex_echohl and ex_execute), which is how you get any color on a saved message.The actual message history is a collection (linked list) of strings with attributes, and is stored and retrieved in src/message.c. Each string is a message (consisting of one or more lines), and the attribute determines, among other things, the highlight group to use for display. Because of this, each message must be highlighted as a whole (single highlight group), and no more than one message may be on the same line. (reference src/message.c structure msg_hist and function ex_messages)I cannot find any way around this (I thought of using :echohl and :echon to display a message, but store a plain message in history. Unfortunately, the ability to add to the history without also displaying the message doesn't appear to be exposed to any ex-commands) without modifying the Vim source code.