-
-
Save hitode909/7164976 to your computer and use it in GitHub Desktop.
functionを寿にする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This function is quoted from this page. Thanks to Tomohiro Matsuyama. | |
;; http://dev.ariel-networks.com/Members/matsuyama/pretty-lambda-in-emacs/ | |
(defun set-pretty-patterns (patterns) | |
(loop for (glyph . pairs) in patterns do | |
(loop for (regexp . major-modes) in pairs do | |
(loop for major-mode in major-modes do | |
(let ((major-mode (intern (concat (symbol-name major-mode) "-mode"))) | |
(n (if (string-match "\\\\([^?]" regexp) 1 0))) | |
(font-lock-add-keywords major-mode | |
`((,regexp (0 (prog1 () | |
(compose-region (match-beginning ,n) | |
(match-end ,n) | |
,glyph))))))))))) | |
(set-pretty-patterns '((?寿 ("\\<function\\>" js)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment