Created
May 21, 2015 12:31
-
-
Save mklymyshyn/39af8b7b8651872fcdba to your computer and use it in GitHub Desktop.
This file contains 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
; change js3 indentation based on comment | |
(add-hook | |
'js3-mode-hook | |
(lambda() | |
(interactive) | |
(lexical-let | |
((buff (buffer-substring 1 512))) | |
(if | |
(string-match "\*\*[Ee][Mm][Aa][Cc][Ss]\*\.*\*\/" buff) | |
(mapcar | |
(lambda (e) | |
(if | |
(string-match "[A-Za-z0-9\-]+\:[A-Za-z0-9]+" e) | |
(lexical-let | |
((pair (split-string e ":"))) | |
(if (>= (length pair) 2) | |
(setq | |
(nth 0 pair) | |
'8) | |
;(string-to-number (nth 1 pair)) | |
;) | |
; (message (concat (nth 0 pair) "=" (nth 1 pair))) | |
nil | |
) | |
(message "DYNAMIC CONFIGS LOADED") | |
) | |
nil)) | |
(split-string buff)) | |
"No custom EMACS configuration found") | |
))) | |
; setq js3-indent-level 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment