branch: elpa/adoc-mode
commit 0ee41756ac78c248adb04ad00acdfa6cb7b44ec8
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Replace looking-back without limit in line-break template
looking-back without a LIMIT argument scans the entire buffer
backwards, which is slow and generates a byte-compiler warning.
Use (eq (char-before) ?\s) instead, which is both faster and
more precise.
---
adoc-mode.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/adoc-mode.el b/adoc-mode.el
index ac9090c1e7..84ca890e07 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -2832,7 +2832,7 @@ which can be truthy even without an active region."
(adoc-tempo-define "adoc-subscript" '("~" (r "text" text) "~"))
;; Text formatting - misc
-(adoc-tempo-define "adoc-line-break" '((if (looking-back " ") "" " ") "+" %)
nil adoc-help-line-break)
+(adoc-tempo-define "adoc-line-break" '((if (eq (char-before) ?\s) "" " ") "+"
%) nil adoc-help-line-break)
(adoc-tempo-define "adoc-page-break" '(bol "<<<" %) nil adoc-help-page-break)
(adoc-tempo-define "adoc-ruler-line" '(bol "---" %) nil adoc-help-ruler-line)