Here is an updated patch that includes a test case. I was able to test it in my *scratch* buffer. Please double-check that it works as intended. On Sun, Jan 15, 2023 at 3:14 PM GNU bug Tracking System < help-debbugs@gnu.org> wrote: > Thank you for filing a new bug report with debbugs.gnu.org. > > This is an automatically generated reply to let you know your message > has been received. > > Your message is being forwarded to the package maintainers and other > interested parties for their attention; they will reply in due course. > > Your message has been sent to the package maintainer(s): > bug-gnu-emacs@gnu.org > > If you wish to submit further information on this problem, please > send it to 60832@debbugs.gnu.org. > > Please do not send mail to help-debbugs@gnu.org unless you wish > to report a problem with the Bug-tracking system. > > -- > 60832: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60832 > GNU Bug Tracking System > Contact help-debbugs@gnu.org with problems >