From e05f3ec739b715a9aa89c52ed5e535f2153acd97 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 5 Aug 2018 22:45:28 +0200 Subject: [PATCH] Add python & enh-ruby support to hes-mode --- core/core-ui.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/core-ui.el b/core/core-ui.el index 3510af655..431e5e404 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -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.