aboutsummaryrefslogtreecommitdiffstats
path: root/modules/modhelp.py
diff options
context:
space:
mode:
authorPaul Eggert2015-11-19 11:31:45 -0800
committerPaul Eggert2015-11-19 11:32:21 -0800
commitc8a972b0c3082edfcca4a85562224499f75bfe9b (patch)
tree6266e9c2d1d168e49ef6de34e800435162cca2d4 /modules/modhelp.py
parent7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad (diff)
downloademacs-c8a972b0c3082edfcca4a85562224499f75bfe9b.tar.gz
emacs-c8a972b0c3082edfcca4a85562224499f75bfe9b.zip
Style fixes for indenting etc. in module code
This is mostly indenting and spacing changes. Also, remove some unnecessary static decls instead of bothering to reindent them. * src/module.h (EMACS_EXTERN_C_BEGIN): Remove, and do this inline, as most other Emacs files do for this sort of thing.
Diffstat (limited to 'modules/modhelp.py')
-rwxr-xr-xmodules/modhelp.py31
1 files changed, 20 insertions, 11 deletions
diff --git a/modules/modhelp.py b/modules/modhelp.py
index 5afe8f24e95..45b849ee747 100755
--- a/modules/modhelp.py
+++ b/modules/modhelp.py
@@ -56,7 +56,8 @@ def cmd_test(args):
56 print '[*] %s: running test' % m 56 print '[*] %s: running test' % m
57 testpath = os.path.join(m, 'test.el') 57 testpath = os.path.join(m, 'test.el')
58 if os.path.isfile(testpath): 58 if os.path.isfile(testpath):
59 emacs_cmd = [EMACS, '-batch', '-L', '.', '-l', 'ert', '-l', testpath, '-f', 'ert-run-tests-batch-and-exit'] 59 emacs_cmd = [EMACS, '-batch', '-L', '.', '-l', 'ert',
60 '-l', testpath, '-f', 'ert-run-tests-batch-and-exit']
60 print ' '.join(emacs_cmd) 61 print ' '.join(emacs_cmd)
61 r = sp.call(emacs_cmd) 62 r = sp.call(emacs_cmd)
62 if r != 0: 63 if r != 0:
@@ -111,13 +112,16 @@ def main():
111 subp = mainp.add_subparsers() 112 subp = mainp.add_subparsers()
112 113
113 testp = subp.add_parser('test', help='run tests') 114 testp = subp.add_parser('test', help='run tests')
114 testp.add_argument('-f', '--force', action='store_true', help='force regeneration (make -B)') 115 testp.add_argument('-f', '--force', action='store_true',
115 testp.add_argument('module', nargs='*', help='path to module to test (default all)') 116 help='force regeneration (make -B)')
117 testp.add_argument('module', nargs='*',
118 help='path to module to test (default all)')
116 testp.set_defaults(func=cmd_test) 119 testp.set_defaults(func=cmd_test)
117 120
118 initp = subp.add_parser('init', help='create a test module from a template') 121 initp = subp.add_parser('init', help='create a test module from a template')
119 initp.add_argument('module', help='name of the new module') 122 initp.add_argument('module', help='name of the new module')
120 initp.add_argument('-f', '--fun', default='fun', help='overide name of the default function') 123 initp.add_argument('-f', '--fun', default='fun',
124 help='overide name of the default function')
121 initp.set_defaults(func=cmd_init) 125 initp.set_defaults(func=cmd_init)
122 126
123 args = mainp.parse_args() 127 args = mainp.parse_args()
@@ -149,13 +153,15 @@ all: ${module}.so ${module}.doc
149 153
150int plugin_is_GPL_compatible; 154int plugin_is_GPL_compatible;
151 155
152static emacs_value ${c_func} (emacs_env *env, int nargs, emacs_value args[], void *data) 156static emacs_value
157${c_func} (emacs_env *env, int nargs, emacs_value args[], void *data)
153{ 158{
154 return env->intern (env, "t"); 159 return env->intern (env, "t");
155} 160}
156 161
157/* Binds NAME to FUN */ 162/* Bind NAME to FUN. */
158static void bind_function (emacs_env *env, const char *name, emacs_value Sfun) 163static void
164bind_function (emacs_env *env, const char *name, emacs_value Sfun)
159{ 165{
160 emacs_value Qfset = env->intern (env, "fset"); 166 emacs_value Qfset = env->intern (env, "fset");
161 emacs_value Qsym = env->intern (env, name); 167 emacs_value Qsym = env->intern (env, name);
@@ -164,8 +170,9 @@ static void bind_function (emacs_env *env, const char *name, emacs_value Sfun)
164 env->funcall (env, Qfset, 2, args); 170 env->funcall (env, Qfset, 2, args);
165} 171}
166 172
167/* Provide FEATURE to Emacs */ 173/* Provide FEATURE to Emacs. */
168static void provide (emacs_env *env, const char *feature) 174static void
175provide (emacs_env *env, const char *feature)
169{ 176{
170 emacs_value Qfeat = env->intern (env, feature); 177 emacs_value Qfeat = env->intern (env, feature);
171 emacs_value Qprovide = env->intern (env, "provide"); 178 emacs_value Qprovide = env->intern (env, "provide");
@@ -174,10 +181,12 @@ static void provide (emacs_env *env, const char *feature)
174 env->funcall (env, Qprovide, 1, args); 181 env->funcall (env, Qprovide, 1, args);
175} 182}
176 183
177int emacs_module_init (struct emacs_runtime *ert) 184int
185emacs_module_init (struct emacs_runtime *ert)
178{ 186{
179 emacs_env *env = ert->get_environment (ert); 187 emacs_env *env = ert->get_environment (ert);
180 bind_function (env, "${lisp_func}", env->make_function (env, 1, 1, ${c_func}, "doc", NULL)); 188 bind_function (env, "${lisp_func}",
189 env->make_function (env, 1, 1, ${c_func}, "doc", NULL));
181 provide (env, "${module}"); 190 provide (env, "${module}");
182 return 0; 191 return 0;
183} 192}