From 03748d48cd54a69dff5a57eba367d1043050abbf Mon Sep 17 00:00:00 2001 From: Gerry Agbobada Date: Tue, 14 Apr 2020 20:09:33 +0200 Subject: [PATCH] Add the explicit character at the beginning of the regexp --- modules/ui/pretty-code/config.el | 58 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/modules/ui/pretty-code/config.el b/modules/ui/pretty-code/config.el index 9c9d46300..8dd1463cb 100644 --- a/modules/ui/pretty-code/config.el +++ b/modules/ui/pretty-code/config.el @@ -99,35 +99,35 @@ Otherwise it builds `prettify-code-symbols-alist' according to (add-hook 'after-change-major-mode-hook #'+pretty-code-init-pretty-symbols-h) (defvar +prog-ligatures-alist - '((?! . ".\\(?:\\(==\\|[!=]\\)[!=]?\\)") - (?# . ".\\(?:\\(###?\\|_(\\|[(:=?[_{]\\)[#(:=?[_{]?\\)") - (?$ . ".\\(?:\\(>\\)>?\\)") - (?% . ".\\(?:\\(%\\)%?\\)") - (?& . ".\\(?:\\(&\\)&?\\)") - (?* . ".\\(?:\\(\\*\\*\\|[*>]\\)[*>]?\\)") - ;; (?* . ".\\(?:\\(\\*\\*\\|[*/>]\\).?\\)") - (?+ . ".\\(?:\\([>]\\)>?\\)") - ;; (?+ . ".\\(?:\\(\\+\\+\\|[+>]\\).?\\)") - (?- . ".\\(?:\\(-[->]\\|<<\\|>>\\|[-<>|~]\\)[-<>|~]?\\)") - ;; (?. . ".\\(?:\\(\\.[.<]\\|[-.=]\\)[-.<=]?\\)") - (?. . ".\\(?:\\(\\.<\\|[-=]\\)[-<=]?\\)") - (?/ . ".\\(?:\\(//\\|==\\|[=>]\\)[/=>]?\\)") - ;; (?/ . ".\\(?:\\(//\\|==\\|[*/=>]\\).?\\)") - (?0 . ".\\(?:\\(x[a-fA-F0-9]\\).?\\)") - (?: . ".\\(?:\\(::\\|[:<=>]\\)[:<=>]?\\)") - (59 . ".\\(?:\\(;\\);?\\)") ;; 59 is ; - (?< . ".\\(?:\\(!--\\|\\$>\\|\\*>\\|\\+>\\|-[-<>|]\\|/>\\|<[-<=]\\|=[<>|]\\|==>?\\||>\\||||?\\|~[>~]\\|[$*+/:<=>|~-]\\)[$*+/:<=>|~-]?\\)") - (?= . ".\\(?:\\(!=\\|/=\\|:=\\|<<\\|=[=>]\\|>>\\|[=>]\\)[=<>]?\\)") - (?> . ".\\(?:\\(->\\|=>\\|>[-=>]\\|[-:=>]\\)[-:=>]?\\)") - (?? . ".\\(?:\\([.:=?]\\)[.:=?]?\\)") - (91 . ".\\(?:\\(|\\)[]|]?\\)") ;; 91 is [ - ;; (?\ . ".\\(?:\\([\\n]\\)[\\]?\\)") - (?^ . ".\\(?:\\(=\\)=?\\)") - (?_ . ".\\(?:\\(|_\\|[_]\\)_?\\)") - (?w . ".\\(?:\\(ww\\)w?\\)") - (?{ . ".\\(?:\\(|\\)[|}]?\\)") - (?| . ".\\(?:\\(->\\|=>\\||[-=>]\\||||*>\\|[]=>|}-]\\).?\\)") - (?~ . ".\\(?:\\(~>\\|[-=>@~]\\)[-=>@~]?\\)")) + '((?! . "!\\(?:\\(==\\|[!=]\\)[!=]?\\)") + (?# . "#\\(?:\\(###?\\|_(\\|[(:=?[_{]\\)[#(:=?[_{]?\\)") + (?$ . "$\\(?:\\(>\\)>?\\)") + (?% . "%\\(?:\\(%\\)%?\\)") + (?& . "&\\(?:\\(&\\)&?\\)") + (?* . "*\\(?:\\(\\*\\*\\|[*>]\\)[*>]?\\)") + ;; (?* . "*\\(?:\\(\\*\\*\\|[*/>]\\).?\\)") + (?+ . "+\\(?:\\([>]\\)>?\\)") + ;; (?+ . "+\\(?:\\(\\+\\+\\|[+>]\\).?\\)") + (?- . "-\\(?:\\(-[->]\\|<<\\|>>\\|[-<>|~]\\)[-<>|~]?\\)") + ;; (?. . "\\.\\(?:\\(\\.[.<]\\|[-.=]\\)[-.<=]?\\)") + (?. . "\\.\\(?:\\(\\.<\\|[-=]\\)[-<=]?\\)") + (?/ . "/\\(?:\\(//\\|==\\|[=>]\\)[/=>]?\\)") + ;; (?/ . "/\\(?:\\(//\\|==\\|[*/=>]\\).?\\)") + (?0 . "0\\(?:\\(x[a-fA-F0-9]\\).?\\)") + (?: . ":\\(?:\\(::\\|[:<=>]\\)[:<=>]?\\)") + (59 . ";\\(?:\\(;\\);?\\)") ;; 59 is ; + (?< . "<\\(?:\\(!--\\|\\$>\\|\\*>\\|\\+>\\|-[-<>|]\\|/>\\|<[-<=]\\|=[<>|]\\|==>?\\||>\\||||?\\|~[>~]\\|[$*+/:<=>|~-]\\)[$*+/:<=>|~-]?\\)") + (?= . "=\\(?:\\(!=\\|/=\\|:=\\|<<\\|=[=>]\\|>>\\|[=>]\\)[=<>]?\\)") + (?> . ">\\(?:\\(->\\|=>\\|>[-=>]\\|[-:=>]\\)[-:=>]?\\)") + (?? . "?\\(?:\\([.:=?]\\)[.:=?]?\\)") + (91 . "\\[\\(?:\\(|\\)[]|]?\\)") ;; 91 is [ + ;; (?\ . "\\\\\\(?:\\([\\n]\\)[\\]?\\)") + (?^ . "^\\(?:\\(=\\)=?\\)") + (?_ . "_\\(?:\\(|_\\|[_]\\)_?\\)") + (?w . "w\\(?:\\(ww\\)w?\\)") + (?{ . "{\\(?:\\(|\\)[|}]?\\)") + (?| . "|\\(?:\\(->\\|=>\\||[-=>]\\||||*>\\|[]=>|}-]\\).?\\)") + (?~ . "~\\(?:\\(~>\\|[-=>@~]\\)[-=>@~]?\\)")) "An alist containing all the ligatures used when in a `+prog-ligatures-modes' mode. The car is the character ASCII number, cdr is a regex which will call `font-shape-gstring'