Add python & enh-ruby support to hes-mode

This commit is contained in:
Henrik Lissner 2018-08-05 22:45:28 +02:00
parent 8d26879f99
commit e05f3ec739
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -145,7 +145,20 @@ Also see `doom-exit-buffer-hook'.")
;; `highlight-escape-sequences'
(def-package! highlight-escape-sequences
:after-call after-find-file
:config (hes-mode +1))
:config
(defconst hes-python-escape-sequence-re
(rx (submatch
(and ?\\ (submatch
(or (repeat 1 3 (in "0-7"))
(and ?x (repeat 2 xdigit))
(and ?u (repeat 4 xdigit))
(and ?U (repeat 8 xdigit))
(and ?N "{" (one-or-more alpha) "}")
(any "\"\'\\abfnrtv")))))))
(add-to-list 'hes-mode-alist `(python-mode . ,hes-python-escape-sequence-re))
(add-to-list 'hes-mode-alist `(enh-ruby-mode . ,hes-ruby-escape-sequence-keywords))
(hes-mode +1))
;; `rainbow-delimiters' Helps us distinguish stacked delimiter pairs. Especially
;; in parentheses-drunk languages like Lisp.