Implement emacs-style join_lines