lang/web: fix Emacs<26 incompatibility #806

The regexp argument for string-trim-right was introduced in 26.1.
This commit is contained in:
Henrik Lissner 2018-08-15 19:51:33 +02:00
parent 11b8ee55a1
commit 40a900f533
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -38,7 +38,10 @@
(cl-loop for pair in (cdr alist)
unless (string-match-p "^[a-z-]" (cdr pair))
collect (cons (car pair)
(string-trim-right (cdr pair) "\\(?:>\\|]\\|}\\)+")))))
;; TODO Replace with `string-trim-right' (Emacs 26+)
(if (string-match "\\(?:>\\|]\\|}\\)+\\'" string)
(replace-match "" t t string)
string)))))
(setf (alist-get nil web-mode-engines-auto-pairs) nil))
(map! :map web-mode-map