diff options
Diffstat (limited to 'modules/elisp/elisp.c')
| -rw-r--r-- | modules/elisp/elisp.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/modules/elisp/elisp.c b/modules/elisp/elisp.c new file mode 100644 index 00000000000..aabb24e01c6 --- /dev/null +++ b/modules/elisp/elisp.c | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #include <string.h> | ||
| 2 | #include <config.h> | ||
| 3 | #include <lisp.h> | ||
| 4 | |||
| 5 | int plugin_is_GPL_compatible; | ||
| 6 | |||
| 7 | static Lisp_Object Qelisp, Qreplace_regexp_in_string; | ||
| 8 | |||
| 9 | #define MAKE_STRING(s) (make_string (s, sizeof(s)-1)) | ||
| 10 | |||
| 11 | EXFUN (Felisp_test, 0); | ||
| 12 | DEFUN ("elisp-test", Felisp_test, Selisp_test, 0, 0, 0, | ||
| 13 | doc: "Eval some lisp.") | ||
| 14 | (void) | ||
| 15 | { | ||
| 16 | Lisp_Object string = MAKE_STRING ("no-more-dash"); | ||
| 17 | Lisp_Object regex = MAKE_STRING ("[-]"); | ||
| 18 | Lisp_Object replace = MAKE_STRING (" "); | ||
| 19 | Lisp_Object res; | ||
| 20 | |||
| 21 | struct gcpro gcpro1, gcpro2, gcpro3; | ||
| 22 | GCPRO3 (string, regex, replace); | ||
| 23 | res = call3 (Qreplace_regexp_in_string, regex, replace, string); | ||
| 24 | UNGCPRO; | ||
| 25 | |||
| 26 | return res; | ||
| 27 | } | ||
| 28 | |||
| 29 | |||
| 30 | void init () | ||
| 31 | { | ||
| 32 | DEFSYM (Qelisp, "elisp"); | ||
| 33 | DEFSYM (Qreplace_regexp_in_string, "replace-regexp-in-string"); | ||
| 34 | |||
| 35 | defsubr (&Selisp_test); | ||
| 36 | |||
| 37 | Fprovide (Qelisp, Qnil); | ||
| 38 | } | ||