Lua primitives: count_lines()
When in message-mode, set with global_mode, the user interface consists of the display of a single message.
The count_lines() function will count the number of lines in that message body.
-- Show the message msg( "This message is " .. count_lines() .. " long" );
This function has been available since version 0.16.