1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-13 09:32:47 +00:00

Speed up shr-insert slightly

* lisp/net/shr.el (shr-insert): Speed up regularising spaces --
the vast majority of the spaces are already OK, so transforming
" " to " " just takes time.
This commit is contained in:
Lars Ingebrigtsen 2020-09-22 16:02:37 +02:00
parent 69b5d54311
commit 096f5956be

View File

@ -678,8 +678,11 @@ size, and full-buffer size."
(goto-char start)
(when (looking-at "[ \t\n\r]+")
(replace-match "" t t))
(while (re-search-forward "[ \t\n\r]+" nil t)
(while (re-search-forward "[\t\n\r]+" nil t)
(replace-match " " t t))
(goto-char start)
(while (re-search-forward " +" nil t)
(replace-match " " t t))
(shr--translate-insertion-chars)
(goto-char (point-max)))
;; We may have removed everything we inserted if it was just