<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/print.c, branch scratch/ns/performance</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Inhibit buffer hooks in temporary buffers</title>
<updated>2020-12-20T17:32:24+00:00</updated>
<author>
<name>Basil L. Contovounesios</name>
</author>
<published>2020-12-19T12:39:45+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=1a0a11f7d2d1dbecb9f754b1e129d50e489058e6'/>
<id>1a0a11f7d2d1dbecb9f754b1e129d50e489058e6</id>
<content type='text'>
Give get-buffer-create an optional argument to inhibit buffer hooks
in internal or temporary buffers for efficiency (bug#34765).

* etc/NEWS: Announce new parameter of get-buffer-create and
generate-new-buffer, and that with-temp-buffer and with-temp-file
now inhibit buffer hooks.

* doc/lispref/buffers.texi (Buffer Names): Fix typo.
(Creating Buffers): Document new parameter of get-buffer-create and
generate-new-buffer.
(Buffer List, Killing Buffers): Document when buffer hooks are
inhibited.
(Current Buffer):
* doc/lispref/files.texi (Writing to Files): Document that
with-temp-buffer and with-temp-file inhibit buffer hooks.
* doc/lispref/internals.texi (Buffer Internals): Document
inhibit_buffer_hooks flag.  Remove stale comment.
* doc/misc/gnus-faq.texi (FAQ 5-8):
* lisp/simple.el (shell-command-on-region): Fix indentation.

* lisp/files.el (kill-buffer-hook): Document when hook is inhibited.
(create-file-buffer):
* lisp/gnus/gnus-uu.el (gnus-uu-unshar-article):
* lisp/international/mule.el (load-with-code-conversion):
* lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image):
* lisp/net/imap.el (imap-open):
* lisp/net/mailcap.el (mailcap-maybe-eval):
* lisp/progmodes/flymake-proc.el
(flymake-proc--read-file-to-temp-buffer)
(flymake-proc--copy-buffer-to-temp-buffer): Simplify.

* lisp/subr.el (generate-new-buffer): Forward new optional argument
to inhibit buffer hooks to get-buffer-create.
(with-temp-file, with-temp-buffer, with-output-to-string):
* lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer
used.

* src/buffer.c (run_buffer_list_update_hook): New helper function.
(Fget_buffer_create): Use it.  Add optional argument to set
inhibit_buffer_hooks flag instead of comparing the buffer name to
Vcode_conversion_workbuf_name.  All callers changed.
(Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal)
(record_buffer): Use run_buffer_list_update_hook.
(Fkill_buffer): Document when buffer hooks are inhibited.  Use
run_buffer_list_update_hook.
(init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer.
(Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document
when hooks are inhibited.
* src/buffer.h (struct buffer): Update inhibit_buffer_hooks
commentary.
* src/coding.h (Vcode_conversion_workbuf_name):
* src/coding.c (Vcode_conversion_workbuf_name): Make static again
since it is no longer needed in src/buffer.c.
(code_conversion_restore, code_conversion_save, syms_of_coding):
Prefer boolean over integer constants.
* src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in
" *code-converting-work*" buffer.
* src/window.c (Fselect_window): Fix grammar.  Mention
window-selection-change-functions alongside buffer-list-update-hook.

* test/src/buffer-tests.el: Fix requires.
(buffer-tests-inhibit-buffer-hooks): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Give get-buffer-create an optional argument to inhibit buffer hooks
in internal or temporary buffers for efficiency (bug#34765).

* etc/NEWS: Announce new parameter of get-buffer-create and
generate-new-buffer, and that with-temp-buffer and with-temp-file
now inhibit buffer hooks.

* doc/lispref/buffers.texi (Buffer Names): Fix typo.
(Creating Buffers): Document new parameter of get-buffer-create and
generate-new-buffer.
(Buffer List, Killing Buffers): Document when buffer hooks are
inhibited.
(Current Buffer):
* doc/lispref/files.texi (Writing to Files): Document that
with-temp-buffer and with-temp-file inhibit buffer hooks.
* doc/lispref/internals.texi (Buffer Internals): Document
inhibit_buffer_hooks flag.  Remove stale comment.
* doc/misc/gnus-faq.texi (FAQ 5-8):
* lisp/simple.el (shell-command-on-region): Fix indentation.

* lisp/files.el (kill-buffer-hook): Document when hook is inhibited.
(create-file-buffer):
* lisp/gnus/gnus-uu.el (gnus-uu-unshar-article):
* lisp/international/mule.el (load-with-code-conversion):
* lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image):
* lisp/net/imap.el (imap-open):
* lisp/net/mailcap.el (mailcap-maybe-eval):
* lisp/progmodes/flymake-proc.el
(flymake-proc--read-file-to-temp-buffer)
(flymake-proc--copy-buffer-to-temp-buffer): Simplify.

* lisp/subr.el (generate-new-buffer): Forward new optional argument
to inhibit buffer hooks to get-buffer-create.
(with-temp-file, with-temp-buffer, with-output-to-string):
* lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer
used.

* src/buffer.c (run_buffer_list_update_hook): New helper function.
(Fget_buffer_create): Use it.  Add optional argument to set
inhibit_buffer_hooks flag instead of comparing the buffer name to
Vcode_conversion_workbuf_name.  All callers changed.
(Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal)
(record_buffer): Use run_buffer_list_update_hook.
(Fkill_buffer): Document when buffer hooks are inhibited.  Use
run_buffer_list_update_hook.
(init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer.
(Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document
when hooks are inhibited.
* src/buffer.h (struct buffer): Update inhibit_buffer_hooks
commentary.
* src/coding.h (Vcode_conversion_workbuf_name):
* src/coding.c (Vcode_conversion_workbuf_name): Make static again
since it is no longer needed in src/buffer.c.
(code_conversion_restore, code_conversion_save, syms_of_coding):
Prefer boolean over integer constants.
* src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in
" *code-converting-work*" buffer.
* src/window.c (Fselect_window): Fix grammar.  Mention
window-selection-change-functions alongside buffer-list-update-hook.

* test/src/buffer-tests.el: Fix requires.
(buffer-tests-inhibit-buffer-hooks): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix --enable-check-lisp-object-type build</title>
<updated>2020-11-06T16:00:54+00:00</updated>
<author>
<name>Glenn Morris</name>
</author>
<published>2020-11-06T16:00:54+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=6b77ad6e77a4812b05ee03360e853e0fcb822a96'/>
<id>6b77ad6e77a4812b05ee03360e853e0fcb822a96</id>
<content type='text'>
* src/print.c (syms_of_print) &lt;print-integers-as-characters&gt;:
Fix type.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/print.c (syms_of_print) &lt;print-integers-as-characters&gt;:
Fix type.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reduce integer-output-format to print-integers-as-characters</title>
<updated>2020-11-06T12:55:32+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2020-11-02T22:37:16+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=0c5eb1c7e798fdf16c3f2694285fe0d18367c6ea'/>
<id>0c5eb1c7e798fdf16c3f2694285fe0d18367c6ea</id>
<content type='text'>
The variable now only controls whether characters are printed, not
the radix.  Control chars are printed in human-readable syntax
only when special escapes such as ?\n are available.  Spaces,
formatting and combining chars are excluded (bug#44155).
Done in collaboration with Juri Linkov.

* src/character.c (graphic_base_p):
* src/print.c (named_escape): New functions.
(print_object): Change semantics as described above.
(syms_of_print): Rename integer-output-format.  Update doc string.
* doc/lispref/streams.texi (Output Variables):
* etc/NEWS:
* test/src/print-tests.el (print-integers-as-characters):
Rename and update according to new semantics.  The test now passes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The variable now only controls whether characters are printed, not
the radix.  Control chars are printed in human-readable syntax
only when special escapes such as ?\n are available.  Spaces,
formatting and combining chars are excluded (bug#44155).
Done in collaboration with Juri Linkov.

* src/character.c (graphic_base_p):
* src/print.c (named_escape): New functions.
(print_object): Change semantics as described above.
(syms_of_print): Rename integer-output-format.  Update doc string.
* doc/lispref/streams.texi (Output Variables):
* etc/NEWS:
* test/src/print-tests.el (print-integers-as-characters):
Rename and update according to new semantics.  The test now passes.
</pre>
</div>
</content>
</entry>
<entry>
<title>New variable integer-output-format to print integers as characters (bug#44155)</title>
<updated>2020-10-31T20:11:02+00:00</updated>
<author>
<name>Juri Linkov</name>
</author>
<published>2020-10-31T20:11:02+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=5d9e456c3ed3dcefe6bf48e24a1a8f275fc887cb'/>
<id>5d9e456c3ed3dcefe6bf48e24a1a8f275fc887cb</id>
<content type='text'>
* doc/lispref/streams.texi (Output Variables): Add integer-output-format.

* src/print.c (print_object): In case of Lisp_Int, print integers
as characters when Vinteger_output_format is Qt, and in hex format
when Vinteger_output_format is 16.
(Vinteger_output_format): New variable.

* test/src/print-tests.el (print-integer-output-format): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* doc/lispref/streams.texi (Output Variables): Add integer-output-format.

* src/print.c (print_object): In case of Lisp_Int, print integers
as characters when Vinteger_output_format is Qt, and in hex format
when Vinteger_output_format is 16.
(Vinteger_output_format): New variable.

* test/src/print-tests.el (print-integer-output-format): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add new Lisp implementation of substitute-command-keys</title>
<updated>2020-10-18T15:23:24+00:00</updated>
<author>
<name>Stefan Kangas</name>
</author>
<published>2019-07-08T16:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=dcf9cd47ae71e39eb616d77acb531ac11357391f'/>
<id>dcf9cd47ae71e39eb616d77acb531ac11357391f</id>
<content type='text'>
This is only the first step towards a full Lisp implementation, and
does not remove the old C code.  On the contrary, it is partly based
on using the old C code, which is to be replaced in steps.  This also
makes it easy to test that it produces the same output as the old.

* src/doc.c (Fsubstitute_command_keys_old): Rename from
Fsubstitute_command_keys.
(Fget_quoting_style): New defun to expose text_quoting_style to Lisp.
(syms_of_doc): Expose above symbols.
* lisp/help.el (substitute-command-keys): New Lisp version of
substitute-command-keys.  (Bug#8951)

* src/keymap.c
(Fdescribe_map_tree): New defun to expose describe_map_tree to Lisp.
(syms_of_keymap): New defsubr for Fdescribe_map_tree.

* src/keyboard.c (help_echo_substitute_command_keys):
* src/doc.c (Fdocumentation, Fdocumentation_property):
* src/print.c (print_error_message):
* src/syntax.c (Finternal_describe_syntax_value): Fix calls to use new
Lisp implementation of substitute-command-keys.

* test/src/doc-tests.el: Remove file.
* test/lisp/help-tests.el: Add tests for substitute-command-keys
copied from above file.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is only the first step towards a full Lisp implementation, and
does not remove the old C code.  On the contrary, it is partly based
on using the old C code, which is to be replaced in steps.  This also
makes it easy to test that it produces the same output as the old.

* src/doc.c (Fsubstitute_command_keys_old): Rename from
Fsubstitute_command_keys.
(Fget_quoting_style): New defun to expose text_quoting_style to Lisp.
(syms_of_doc): Expose above symbols.
* lisp/help.el (substitute-command-keys): New Lisp version of
substitute-command-keys.  (Bug#8951)

* src/keymap.c
(Fdescribe_map_tree): New defun to expose describe_map_tree to Lisp.
(syms_of_keymap): New defsubr for Fdescribe_map_tree.

* src/keyboard.c (help_echo_substitute_command_keys):
* src/doc.c (Fdocumentation, Fdocumentation_property):
* src/print.c (print_error_message):
* src/syntax.c (Finternal_describe_syntax_value): Fix calls to use new
Lisp implementation of substitute-command-keys.

* test/src/doc-tests.el: Remove file.
* test/lisp/help-tests.el: Add tests for substitute-command-keys
copied from above file.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve display of raw bytes in the echo-area</title>
<updated>2020-09-27T05:26:56+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2020-09-27T05:26:56+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=768676f74f093e75e2d7e04e18e1fd1836d1e7e9'/>
<id>768676f74f093e75e2d7e04e18e1fd1836d1e7e9</id>
<content type='text'>
* src/print.c (print_object): When printing a unibyte string,
convert non-ASCII bytes to their character code, before sending
them to 'printchar'.  (Bug#43632)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/print.c (print_object): When printing a unibyte string,
convert non-ASCII bytes to their character code, before sending
them to 'printchar'.  (Bug#43632)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix printing of hash tables with removed elements</title>
<updated>2020-09-20T10:24:16+00:00</updated>
<author>
<name>Pip Cet</name>
</author>
<published>2020-09-20T10:24:16+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=988f45a75b745dc1fee6315749ddb48f00b000eb'/>
<id>988f45a75b745dc1fee6315749ddb48f00b000eb</id>
<content type='text'>
* src/print.c (print_vectorlike): Keep track of the actual number
of elements printed rather than attempting to use hash bucket
indices (bug#38892).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/print.c (print_vectorlike): Keep track of the actual number
of elements printed rather than attempting to use hash bucket
indices (bug#38892).
</pre>
</div>
</content>
</entry>
<entry>
<title>Prefer more inline functions in character.h</title>
<updated>2020-04-17T16:17:35+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-04-17T14:57:25+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=27d101832ada36e431ae6cdecb5c82a180566377'/>
<id>27d101832ada36e431ae6cdecb5c82a180566377</id>
<content type='text'>
* src/buffer.h (fetch_char_advance, fetch_char_advance_no_check)
(buf_next_char_len, next_char_len, buf_prev_char_len)
(prev_char_len, inc_both, dec_both): New inline functions,
replacing the old character.h macros FETCH_CHAR_ADVANCE,
FETCH_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS, INC_POS, BUF_DEC_POS,
DEC_POS, INC_BOTH, DEC_BOTH respectively.  All callers changed.
These new functions all assume buffer primitives and so need
to be here rather than in character.h.
* src/casefiddle.c (make_char_unibyte): New static function,
replacing the old MAKE_CHAR_UNIBYTE macro.  All callers changed.
(do_casify_unibyte_string): Use SINGLE_BYTE_CHAR_P instead
of open-coding it.
* src/ccl.c (GET_TRANSLATION_TABLE): New static function,
replacing the old macro of the same name.
* src/character.c (string_char): Omit 2nd arg.  3rd arg can no
longer be NULL.  All callers changed.
* src/character.h (SINGLE_BYTE_CHAR_P): Move up.
(MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE, PREV_CHAR_BOUNDARY)
(STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE)
(FETCH_STRING_CHAR_ADVANCE)
(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
(FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
(FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
(DEC_BOTH, BUF_INC_POS, BUF_DEC_POS): Remove.
(make_char_multibyte): New static function, replacing
the old macro MAKE_CHAR_MULTIBYTE.  All callers changed.
(CHAR_STRING_ADVANCE): Remove; all callers changed to use
CHAR_STRING.
(NEXT_CHAR_BOUNDARY): Remove; it was unused.
(raw_prev_char_len): New inline function, replacing the
old PREV_CHAR_BOUNDARY macro.  All callers changed.
(string_char_and_length): New inline function, replacing the
old STRING_CHAR_AND_LENGTH macro.  All callers changed.
(STRING_CHAR): Rewrite in terms of string_char_and_length.
(string_char_advance): New inline function, replacing the old
STRING_CHAR_ADVANCE macro.  All callers changed.
(fetch_string_char_advance): New inline function, replacing the
old FETCH_STRING_CHAR_ADVANCE macro.  All callers changed.
(fetch_string_char_as_multibyte_advance): New inline function,
replacing the old FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE macro.
All callers changed.
(fetch_string_char_advance_no_check): New inline function,
replacing the old FETCH_STRING_CHAR_ADVANCE_NO_CHECK macro.  All
callers changed.
* src/regex-emacs.c (HEAD_ADDR_VSTRING): Remove; no longer used.
* src/syntax.c (scan_lists): Use dec_bytepos instead of
open-coding it.
* src/xdisp.c (string_char_and_length): Rename from
string_char_and_length to avoid name conflict with new function in
character.h.  All callers changed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/buffer.h (fetch_char_advance, fetch_char_advance_no_check)
(buf_next_char_len, next_char_len, buf_prev_char_len)
(prev_char_len, inc_both, dec_both): New inline functions,
replacing the old character.h macros FETCH_CHAR_ADVANCE,
FETCH_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS, INC_POS, BUF_DEC_POS,
DEC_POS, INC_BOTH, DEC_BOTH respectively.  All callers changed.
These new functions all assume buffer primitives and so need
to be here rather than in character.h.
* src/casefiddle.c (make_char_unibyte): New static function,
replacing the old MAKE_CHAR_UNIBYTE macro.  All callers changed.
(do_casify_unibyte_string): Use SINGLE_BYTE_CHAR_P instead
of open-coding it.
* src/ccl.c (GET_TRANSLATION_TABLE): New static function,
replacing the old macro of the same name.
* src/character.c (string_char): Omit 2nd arg.  3rd arg can no
longer be NULL.  All callers changed.
* src/character.h (SINGLE_BYTE_CHAR_P): Move up.
(MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE, PREV_CHAR_BOUNDARY)
(STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE)
(FETCH_STRING_CHAR_ADVANCE)
(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
(FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
(FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
(DEC_BOTH, BUF_INC_POS, BUF_DEC_POS): Remove.
(make_char_multibyte): New static function, replacing
the old macro MAKE_CHAR_MULTIBYTE.  All callers changed.
(CHAR_STRING_ADVANCE): Remove; all callers changed to use
CHAR_STRING.
(NEXT_CHAR_BOUNDARY): Remove; it was unused.
(raw_prev_char_len): New inline function, replacing the
old PREV_CHAR_BOUNDARY macro.  All callers changed.
(string_char_and_length): New inline function, replacing the
old STRING_CHAR_AND_LENGTH macro.  All callers changed.
(STRING_CHAR): Rewrite in terms of string_char_and_length.
(string_char_advance): New inline function, replacing the old
STRING_CHAR_ADVANCE macro.  All callers changed.
(fetch_string_char_advance): New inline function, replacing the
old FETCH_STRING_CHAR_ADVANCE macro.  All callers changed.
(fetch_string_char_as_multibyte_advance): New inline function,
replacing the old FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE macro.
All callers changed.
(fetch_string_char_advance_no_check): New inline function,
replacing the old FETCH_STRING_CHAR_ADVANCE_NO_CHECK macro.  All
callers changed.
* src/regex-emacs.c (HEAD_ADDR_VSTRING): Remove; no longer used.
* src/syntax.c (scan_lists): Use dec_bytepos instead of
open-coding it.
* src/xdisp.c (string_char_and_length): Rename from
string_char_and_length to avoid name conflict with new function in
character.h.  All callers changed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Shorten pointer printing code using a small helper function.</title>
<updated>2020-01-05T16:12:27+00:00</updated>
<author>
<name>Philipp Stephani</name>
</author>
<published>2020-01-05T16:04:17+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=26fde487cb3740cdc678e76c62f1320d47b4d6f5'/>
<id>26fde487cb3740cdc678e76c62f1320d47b4d6f5</id>
<content type='text'>
* src/print.c (print_pointer): New helper function.
(print_vectorlike): Use it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/print.c (print_pointer): New helper function.
(print_vectorlike): Use it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Also print function data when printing module functions.</title>
<updated>2020-01-05T15:07:28+00:00</updated>
<author>
<name>Philipp Stephani</name>
</author>
<published>2020-01-05T15:05:14+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=fc92c2d8942cf466aa6dbc422f2e798801b18408'/>
<id>fc92c2d8942cf466aa6dbc422f2e798801b18408</id>
<content type='text'>
This is especially useful in cases where modules only use a single
entry point and use the data to dispatch to the actual function.  Such
a design is common for languages such as Go and C++.

* src/emacs-module.c (module_function_data): New function.

* src/print.c (print_vectorlike): Use it to print module function data
if not NULL.
(print_object): Adapt size of buffer.

* test/data/emacs-module/mod-test.c (emacs_module_init): Pass some
non-NULL data to ‘mod-test-sum’.
(Fmod_test_sum): Check that correct data is passed through.

* test/src/emacs-module-tests.el (mod-test-sum-test)
(module-function-object): Adapt unit tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is especially useful in cases where modules only use a single
entry point and use the data to dispatch to the actual function.  Such
a design is common for languages such as Go and C++.

* src/emacs-module.c (module_function_data): New function.

* src/print.c (print_vectorlike): Use it to print module function data
if not NULL.
(print_object): Adapt size of buffer.

* test/data/emacs-module/mod-test.c (emacs_module_init): Pass some
non-NULL data to ‘mod-test-sum’.
(Fmod_test_sum): Check that correct data is passed through.

* test/src/emacs-module-tests.el (mod-test-sum-test)
(module-function-object): Adapt unit tests.
</pre>
</div>
</content>
</entry>
</feed>
