1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 18:00:40 -08:00
emacs/etc
Philipp Stephani 31fded0370 Reimplement module functions
Instead of a lambda, create a new type containing all data required to
call the function, and support it in the evaluator.  Because this type
now also needs to store the function documentation, it is too big for
Lisp_Misc; use a pseudovector instead.  That also has the nice benefit
that we don't have to add special support to the garbage collector.

Since the new type is user-visible, give it a predicate.

Now we can easily support 'help-function-args' and 'func-arity'; add
unit tests for these.

* src/lisp.h (allocate_module_function, MODULE_FUNCTIONP)
(XMODULE_FUNCTION): New pseudovector type 'module function'.

* src/eval.c (FUNCTIONP): Also treat module functions as functions.
(funcall_lambda, Ffuncall, eval_sub): Add support for calling module
functions.
(Ffunc_arity): Add support for detecting the arity of module
functions.

* src/emacs-module.c (module_make_function): Adapt to new structure.
Return module function object directly instead of wrapping it in a
lambda; remove FIXME.
(funcall_module): New function to call module functions.  Replaces
`internal--module-call' and is called directly from eval.c.
(syms_of_module): Remove internal helper function, which is no longer
needed.
(module_function_arity): New helper function.

* src/data.c (Ftype_of): Adapt to new implementation.
(Fmodule_function_p, syms_of_data): New user-visible function.  Now
that module functions are first-class objects, they deserve a
predicate.  Define it even if not compiled with --enable-modules so
that Lisp code doesn't have to check for the function's existence.

* src/doc.c (Fdocumentation): Support module functions.

* src/print.c (print_object): Adapt to new implementation.

* src/alloc.c (mark_object): Specialized garbage collector support is
no longer needed.

* lisp/help.el (help-function-arglist): Support module functions.
While there, simplify the arity calculation by using `func-arity',
which does the right thing for all kinds of functions.

* test/data/emacs-module/mod-test.c: Amend docstring so we can test
the argument list.

* test/src/emacs-module-tests.el (mod-test-sum-docstring): Adapt to
new docstring.
(mod-test-non-local-exit-signal-test): Because `internal--module-call'
is gone, the backtrace has changed and no longer leaks the
implementation.
(module--func-arity): New test for `func-arity'.
(module--help-function-arglist): New test for `help-function-arglist'.
2017-05-20 15:32:52 +02:00
..
charsets Update copyright year to 2017 2016-12-31 19:42:26 -08:00
e Prefer straight quoting in some etc text files 2015-08-26 14:09:07 -07:00
forms Update copyright year to 2017 2016-12-31 19:42:26 -08:00
gnus
images Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
nxml Update nXML to use Emacs's Unicode support, and lexical-binding 2016-01-15 10:29:20 -05:00
org Update copyright year to 2017 2016-12-31 19:42:26 -08:00
refcards Merge from origin/emacs-25 2017-01-17 07:34:25 -08:00
schema Update copyright year to 2017 2016-12-31 19:42:26 -08:00
srecode Update copyright year to 2017 2016-12-31 19:42:26 -08:00
themes ; Less error-like font-lock-variable-name-face 2017-02-22 18:31:02 +01:00
tutorials * etc/tutorials/TUTORIAL.sv: synced with TUTORIAL 2017-04-30 00:14:45 +02:00
AUTHORS ; Update contributor name 2017-05-06 18:38:18 -07:00
CALC-NEWS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
CENSORSHIP Make some files in etc obsolete 2014-03-22 16:47:20 -07:00
ChangeLog.1 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
compilation.txt Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
COPYING
DEBUG Replace QUIT with maybe_quit 2017-01-25 21:25:37 -08:00
DEVEL.HUMOR Prefer straight quoting in some etc text files 2015-08-26 14:09:07 -07:00
DISTRIB Update copyright year to 2017 2016-12-31 19:42:26 -08:00
edt-user.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
emacs-buffer.gdb Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
emacs.appdata.xml Update copyright year to 2017 2016-12-31 19:42:26 -08:00
emacs.desktop * etc/emacs.desktop: Add "Keywords". 2014-10-30 21:10:19 -07:00
emacs.icon
emacs.service Add --new-daemon, which runs in the foreground and does not fork 2016-11-15 23:28:47 -08:00
enriched.txt Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ERC-NEWS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ETAGS.EBNF Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ETAGS.README Update copyright year to 2017 2016-12-31 19:42:26 -08:00
FTP Make etc/FTP and etc/ORDERS obsolete 2014-01-09 21:44:51 -05:00
future-bug
GNU Update copyright year to 2015 2015-01-01 09:18:06 -08:00
GNUS-NEWS Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
gnus-tut.txt Update copyright year to 2017 2016-12-31 19:42:26 -08:00
grep.txt Update copyright year to 2017 2016-12-31 19:42:26 -08:00
HELLO Update copyright year to 2017 2016-12-31 19:42:26 -08:00
HISTORY Set Emacs version to 25.2 and update AUTHORS file 2017-04-20 17:29:11 +02:00
JOKES
LINUX-GNU Make some files in etc obsolete 2014-03-22 16:47:20 -07:00
MACHINES Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
MH-E-NEWS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
MORE.STUFF * etc/MORE.STUFF: Replace contents with pointer to efaq.info. 2014-01-09 14:14:28 -05:00
NEWS Reimplement module functions 2017-05-20 15:32:52 +02:00
NEWS.1-17 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.18 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.19 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.20 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.21 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.22 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.23 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.24 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.25 Fixups after merge from emacs-25 2017-03-19 12:39:16 -07:00
NEXTSTEP Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NXML-NEWS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ORDERS Make etc/FTP and etc/ORDERS obsolete 2014-01-09 21:44:51 -05:00
ORG-NEWS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
package-keyring.gpg * etc/package-keyring.gpg: New file. 2014-09-24 10:28:27 -04:00
PROBLEMS Merge from gnulib 2017-03-19 13:09:31 -07:00
ps-prin0.ps Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ps-prin1.ps Update copyright year to 2017 2016-12-31 19:42:26 -08:00
publicsuffix.txt Update publicsuffix.txt. 2016-02-06 16:11:18 +11:00
README Update copyright year to 2017 2016-12-31 19:42:26 -08:00
rgb.txt
ses-example.ses Update copyright year to 2017 2016-12-31 19:42:26 -08:00
spook.lines * etc/spook.lines: Minor commentary update 2013-08-28 21:05:19 -04:00
TERMS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
THE-GNU-PROJECT Make some files in etc obsolete 2014-03-22 16:47:20 -07:00
TODO Fix obsolete ‘test/automated’ references 2017-03-27 11:30:08 -07:00
WHY-FREE Make some files in etc obsolete 2014-03-22 16:47:20 -07:00
yow.lines Prefer straight quoting in some etc text files 2015-08-26 14:09:07 -07:00

This directory contains the architecture-independent files used by or
with Emacs.  This includes some text files of documentation for GNU
Emacs or of interest to Emacs users, and the file of dumped docstrings
for Emacs functions and variables.

COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES

File: emacs.icon
  Author: Sun Microsystems, Inc
  Copyright (C) 1999, 2001-2017 Free Software Foundation, Inc.
  License: GNU General Public License version 3 or later (see COPYING)