From 2b7b50e96b90052e9f4ea4960b5e4b214fd42b89 Mon Sep 17 00:00:00 2001 From: Colton Ward Date: Tue, 13 Nov 2018 06:22:40 -0600 Subject: [PATCH] Updated Emacs instructions (markdown) --- Emacs-instructions.md | 59 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/Emacs-instructions.md b/Emacs-instructions.md index 263fa34..984861c 100644 --- a/Emacs-instructions.md +++ b/Emacs-instructions.md @@ -198,6 +198,65 @@ On some systems, `==` will appear incorrectly as a blank space in certain modes (set-default-coding-systems 'utf-8) ``` +After piecing together a few things (namely [Hasklig-Mode](https://github.com/minad/hasklig-mode)) I managed to come up with this: + +```elisp +(defun fira-code-mode--make-alist (list) + "Generate prettify-symbols alist from LIST." + (let ((idx -1)) + (mapcar + (lambda (s) + (setq idx (1+ idx)) + (let* ((code (+ #Xe100 idx)) + (width (string-width s)) + (prefix ()) + (suffix '(?\s (Br . Br))) + (n 1)) + (while (< n width) + (setq prefix (append prefix '(?\s (Br . Bl)))) + (setq n (1+ n))) + (cons s (append prefix suffix (list (decode-char 'ucs code)))))) + list))) + +(defconst fira-code-mode--ligatures + '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\" + "{-" "[]" "::" ":::" ":=" "!!" "!=" "!==" "-}" + "--" "---" "-->" "->" "->>" "-<" "-<<" "-~" + "#{" "#[" "##" "###" "####" "#(" "#?" "#_" "#_(" + ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*" + "/**" "/=" "/==" "/>" "//" "///" "&&" "||" "||=" + "|=" "|>" "^=" "$>" "++" "+++" "+>" "=:=" "==" + "===" "==>" "=>" "=>>" "<=" "=<<" "=/=" ">-" ">=" + ">=>" ">>" ">>-" ">>=" ">>>" "<*" "<*>" "<|" "<|>" + "<$" "<$>" "