aboutsummaryrefslogtreecommitdiffstats
path: root/modules/elisp
diff options
context:
space:
mode:
authorAurélien Aptel2014-12-02 16:17:10 -0500
committerTed Zlatanov2014-12-04 19:54:16 -0500
commitae901ddbfff04e8b1b0d63c452a6ca3f4c81fb17 (patch)
treeb806504944c633be45255321d1203bbcc2504781 /modules/elisp
parentdd601050e7db69f322eea09d99751d8e6363b153 (diff)
downloademacs-old-branches/dynamic-modules-rc2.tar.gz
emacs-old-branches/dynamic-modules-rc2.zip
* configure.ac: Add libtool support and module Makefiles. * src/Makefile.in: Support libtool. * src/alloc.c (mark_object): Mark the doc field of Lisp_Subr as object. * src/doc.c (doc_is_from_module_p, get_doc_string, reread_doc_file) (store_function_docstring, build_file_p, Fsnarf_documentation): Support docstrings for external modules. * src/lisp.h: Make the doc field of Lisp_Subr a Lisp_Object. * src/lread.c (Fget_load_suffixes, Fload_module, string_suffixes_p) (string_suffix_p, Fload, intern_c_string_1, defsubr) (syms_of_lread): Add loading of external modules and the docstrings of their functions. * modules/curl: New module. * modules/elisp: New module. * modules/fmod: New module. * modules/opaque: New module. * modules/yaml: New module.
Diffstat (limited to 'modules/elisp')
-rw-r--r--modules/elisp/Makefile.in12
-rw-r--r--modules/elisp/elisp.c38
2 files changed, 50 insertions, 0 deletions
diff --git a/modules/elisp/Makefile.in b/modules/elisp/Makefile.in
new file mode 100644
index 00000000000..8df325e76b7
--- /dev/null
+++ b/modules/elisp/Makefile.in
@@ -0,0 +1,12 @@
1ROOT = ../..
2
3all: elisp.so elisp.doc
4
5%.so: %.o
6 gcc -shared -o $@ $<
7
8%.o: %.c
9 gcc -ggdb3 -Wall -I$(ROOT)/src -I$(ROOT)/lib -fPIC -c $<
10
11%.doc: %.c
12 $(ROOT)/lib-src/make-docfile $< > $@
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
5int plugin_is_GPL_compatible;
6
7static Lisp_Object Qelisp, Qreplace_regexp_in_string;
8
9#define MAKE_STRING(s) (make_string (s, sizeof(s)-1))
10
11EXFUN (Felisp_test, 0);
12DEFUN ("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
30void 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}