diff --git a/modules/ui/pretty-code/config.el b/modules/ui/pretty-code/config.el index cf02e7ed1..00a68e211 100644 --- a/modules/ui/pretty-code/config.el +++ b/modules/ui/pretty-code/config.el @@ -100,35 +100,32 @@ Otherwise it builds `prettify-code-symbols-alist' according to ;;; Automatic font-specific ligatures (defvar +prog-ligatures-alist - '((?! . "!\\(?:\\(==\\|[!=]\\)[!=]?\\)") - (?# . "#\\(?:\\(###?\\|_(\\|[(:=?[_{]\\)[#(:=?[_{]?\\)") - (?$ . "$\\(?:\\(>\\)>?\\)") - (?% . "%\\(?:\\(%\\)%?\\)") - (?& . "&\\(?:\\(&\\)&?\\)") - (?* . "*\\(?:\\(\\*\\*\\|[*>]\\)[*>]?\\)") - ;; (?* . "*\\(?:\\(\\*\\*\\|[*/>]\\).?\\)") - (?+ . "+\\(?:\\([>]\\)>?\\)") - ;; (?+ . "+\\(?:\\(\\+\\+\\|[+>]\\).?\\)") - (?- . "-\\(?:\\(-[->]\\|<<\\|>>\\|[-<>|~]\\)[-<>|~]?\\)") - ;; (?. . "\\.\\(?:\\(\\.[.<]\\|[-.=]\\)[-.<=]?\\)") - (?. . "\\.\\(?:\\(\\.<\\|[-=]\\)[-<=]?\\)") - (?/ . "/\\(?:\\(//\\|==\\|[=>]\\)[/=>]?\\)") - ;; (?/ . "/\\(?:\\(//\\|==\\|[*/=>]\\).?\\)") - (?0 . "0\\(?:\\(x[a-fA-F0-9]\\).?\\)") - (?: . ":\\(?:\\(::\\|[:<=>]\\)[:<=>]?\\)") - (59 . ";\\(?:\\(;\\);?\\)") ;; 59 is ; - (?< . "<\\(?:\\(!--\\|\\$>\\|\\*>\\|\\+>\\|-[-<>|]\\|/>\\|<[-<=]\\|=[<>|]\\|==>?\\||>\\||||?\\|~[>~]\\|[$*+/:<=>|~-]\\)[$*+/:<=>|~-]?\\)") - (?= . "=\\(?:\\(!=\\|/=\\|:=\\|<<\\|=[=>]\\|>>\\|[=>]\\)[=<>]?\\)") - (?> . ">\\(?:\\(->\\|=>\\|>[-=>]\\|[-:=>]\\)[-:=>]?\\)") - (?? . "?\\(?:\\([.:=?]\\)[.:=?]?\\)") - (91 . "\\[\\(?:\\(|\\)[]|]?\\)") ;; 91 is [ - ;; (?\ . "\\\\\\(?:\\([\\n]\\)[\\]?\\)") - (?^ . "^\\(?:\\(=\\)=?\\)") - (?_ . "_\\(?:\\(|_\\|[_]\\)_?\\)") - (?w . "w\\(?:\\(ww\\)w?\\)") - (?{ . "{\\(?:\\(|\\)[|}]?\\)") - (?| . "|\\(?:\\(->\\|=>\\||[-=>]\\||||*>\\|[]=>|}-]\\).?\\)") - (?~ . "~\\(?:\\(~>\\|[-=>@~]\\)[-=>@~]?\\)")) + `((?! . ,(regexp-opt '("!!" "!=" "!=="))) + (?# . ,(regexp-opt '("##" "###" "####" "#(" "#:" "#=" "#?" "#[" "#_" "#_(" "#{"))) + (?$ . ,(regexp-opt '("$>" "$>>"))) + (?% . ,(regexp-opt '("%%" "%%%"))) + (?& . ,(regexp-opt '("&&" "&&&"))) + (?* . ,(regexp-opt '("*" "**" "***" "**/" "*/" "*>"))) + (?+ . ,(regexp-opt '("+" "++" "+++" "+>"))) + (?- . ,(regexp-opt '("--" "---" "-->" "-<" "-<<" "->" "->>" "-}" "-~"))) + (?. . ,(regexp-opt '(".-" ".." "..." "..<" ".="))) + (?/ . ,(regexp-opt '("/*" "/**" "//" "///" "/=" "/==" "/>"))) + (?: . ,(regexp-opt '(":" "::" ":::" ":=" ":<" ":=" ":>"))) + (?0 . "0\\(?:\\(x[a-fA-F0-9]\\).?\\)") ; Tries to match the x in 0xDEADBEEF + ;; (?x . ,(regexp-opt '("x"))) ; Also tries to match the x in 0xDEADBEEF + (?\; . ,(regexp-opt '(";;"))) + (?< . ,(regexp-opt '("