Created
January 15, 2013 21:54
-
-
Save prakashk/4542481 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
(require 'generic-x) | |
;; pkc mode keywords | |
(setq pkc-keywords-list '("compute" "count" "dedupe" "embed" "file" "frequency" "function" | |
"join" "keep" "macro" "minus" "print" "project" "result" "select" "union" "use")) | |
(require 'mmm-auto) | |
(setq mmm-global-mode 'maybe) | |
(mmm-add-classes | |
'((embedded-c++ | |
:submode c++-mode | |
:face mmm-default-submode-face | |
:front "{{{" | |
:front-offset -1 | |
:back "}}}" | |
:back-offset 1))) | |
(define-generic-mode | |
'pkc-mode ;; name of the mode to create | |
'("//" ("/*" . "*/")) ;; comments start with | |
pkc-keywords-list ;; some keywords | |
'(("^\\s-*macro\\s-+\\([A-Za-z0-9_]+\\)" | |
(1 font-lock-function-name-face)) | |
("\\$\\([A-Za-z0-9_]+\\)" | |
(0 font-lock-variable-name-face))) | |
'("\\.pkc$") ;; files for which to activate this mode | |
;; other functions to call | |
'((lambda () | |
(require 'mmm-vars) | |
(mmm-add-mode-ext-class 'pkc-mode nil 'embedded-c++) | |
(message "pkc-mode[mmm] is on"))) | |
"A mode for pkc script files" ;; doc string for this mode | |
) |
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
use "some-file.pkc" | |
embed {{{ | |
// C++ code | |
int incr(int x) | |
{ | |
return x + 1; | |
} | |
}}} | |
// some pkc code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment