16 aug. 2021 kl. 19.43 skrev Eli Zaretskii : >> I don't know how this could ever work. We loop through the markers in the current buffer? > > Yes. Why do you think this loop is broken? Because unless I misunderstood the code entirely, the current buffer has nothing to do with the operation at hand. It's easy to reproduce the original problem: run Emacs in a terminal and make a buffer with many markers. See how the text displays slower with more markers. I've attached a short example; try (make-test-buffer 1000). The attached patch fixes this problem.