def _element_fill_join(elements, width):
    """Create a multiline string with a maximum width from a list of strings,
    without breaking lines within the elements"""

    s = ''
    if(elements):
        L = 0
        for i in range(len(elements) - 1):
            s += str(elements[i]) + ', '
            L += len(elements[i]) + 2
            if(L + len(elements[i+1]) >= width - 2):
                s += '\n'
                L = 0
        s += elements[-1]

    return(s)