Janneke Nieuwenhuizen writes: Hello! > [.] > >>> To reproduce, a >>> single character (that is not '.') and a newline suffices, typing >>> something like: >>> >>> PS1='0\n$ ' >>> >>> in an emacs shell and typing M-RET reproduces the problem. >> >> Can you suggest how to solve this? > > Good question! When I tried to add (message ...) debugging this > morning, it started (and kept) looping; so I had no idea how to proceed. > However, I tried again and got better results this time and have created > a patch that "works for me" (see attached). [..] Snip rationale that still holds...but ...initially I only used `seq-filter' in my patch, so I removed the stripping of the optional final newline. When I added the fall-back to takk the last element of the list, we'd need to bring back that final newline removal. Version 2 attached. Greetings, Janneke