<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/lisp.h, branch scratch/albinus</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>Remove CHECK_FIXNUM_CAR etc.</title>
<updated>2018-12-10T01:11:37+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2018-12-10T01:07:16+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=48d7720993283a3387807fa5582bb10b1636bba5'/>
<id>48d7720993283a3387807fa5582bb10b1636bba5</id>
<content type='text'>
* src/coding.c (CHECK_FIXNAT_CAR, CHECK_FIXNAT_CDR):
* src/lisp.h (CHECK_FIXNUM_CAR, CHECK_FIXNUM_CDR):
Remove.  All uses removed.  These seem to have been based on
the assumption that the argument cons needs to be modified,
an assumption that is incorrect for fixnums.
(Fdefine_coding_system_internal): Use CHECK_RANGED_INTEGER
instead of a special diagnostic for graphic register numbers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/coding.c (CHECK_FIXNAT_CAR, CHECK_FIXNAT_CDR):
* src/lisp.h (CHECK_FIXNUM_CAR, CHECK_FIXNUM_CDR):
Remove.  All uses removed.  These seem to have been based on
the assumption that the argument cons needs to be modified,
an assumption that is incorrect for fixnums.
(Fdefine_coding_system_internal): Use CHECK_RANGED_INTEGER
instead of a special diagnostic for graphic register numbers.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add make_vector and make_nil_vector</title>
<updated>2018-12-09T08:23:55+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2018-12-09T08:18:36+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=d79bb75683ceb4eee2f753eb38fa8db99aff4568'/>
<id>d79bb75683ceb4eee2f753eb38fa8db99aff4568</id>
<content type='text'>
This makes the callers a bit easier to read, and doubtless
improves efficiency very slightly.  It also simplifies
possible future changes to allow bignum indexes to buffers.
* src/alloc.c (allocate_vectorlike):
Prefer ptrdiff_t to size_t when either will do.
(make_vector): New function.
(Fmake_vector): Use it.
* src/buffer.c (syms_of_buffer):
* src/bytecode.c (syms_of_bytecode):
* src/category.c (Fmake_category_table, init_category_once):
* src/ccl.c (syms_of_ccl):
* src/character.c (syms_of_character):
* src/charset.c (Fdefine_charset_internal)
(Ffind_charset_region, Ffind_charset_string):
* src/chartab.c (copy_char_table):
* src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
* src/composite.c (get_composition_id, Fcomposition_get_gstring):
* src/composite.h (LGLYPH_NEW):
* src/fns.c (concat, Flocale_info, make_hash_table):
* src/font.c (font_otf_ValueRecord, font_otf_anchor)
(build_style_table, syms_of_font):
* src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
(dump_fontset, syms_of_fontset):
* src/image.c (xpm_make_color_table_v):
* src/keyboard.c (modify_event_symbol, menu_bar_items)
(parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
(syms_of_keyboard):
* src/keymap.c (Fdefine_key, describe_map, describe_vector):
* src/lread.c (read_vector):
* src/macfont.m (macfont_shape):
* src/menu.c (init_menu_items):
* src/nsfns.m (ns_make_monitor_attribute_list):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
* src/profiler.c (make_log):
* src/window.c (Fcurrent_window_configuration):
* src/xdisp.c (with_echo_area_buffer_unwind_data)
(format_mode_line_unwind_data):
* src/xfaces.c (Finternal_make_lisp_face)
(Fface_attributes_as_vector):
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list):
* src/xfont.c (syms_of_xfont):
* src/xselect.c (x_handle_dnd_message):
* src/xwidget.c (save_script_callback):
Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
* src/callint.c (Fcall_interactively):
* src/charset.c (load_charset_map):
* src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
* src/composite.c (get_composition_id)
* src/dispnew.c (Fframe_or_buffer_changed_p)
(syms_of_display):
* src/fns.c (make_hash_table, maybe_resize_hash_table):
* src/font.c (font_style_to_value):
* src/fontset.c (FONTSET_ADD, fontset_add):
* src/json.c (json_to_lisp):
* src/keymap.c (syms_of_keymap):
* src/lread.c (init_obarray):
* src/profiler.c (make_log, Fprofiler_cpu_log):
* src/term.c (term_get_fkeys_1):
Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
* src/font.c (build_style_table):
* src/macfont.m (macfont_shape):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
Prefer make_uninit_vector if the vector will be initialized soon.
* src/lisp.h (make_nil_vector): New function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes the callers a bit easier to read, and doubtless
improves efficiency very slightly.  It also simplifies
possible future changes to allow bignum indexes to buffers.
* src/alloc.c (allocate_vectorlike):
Prefer ptrdiff_t to size_t when either will do.
(make_vector): New function.
(Fmake_vector): Use it.
* src/buffer.c (syms_of_buffer):
* src/bytecode.c (syms_of_bytecode):
* src/category.c (Fmake_category_table, init_category_once):
* src/ccl.c (syms_of_ccl):
* src/character.c (syms_of_character):
* src/charset.c (Fdefine_charset_internal)
(Ffind_charset_region, Ffind_charset_string):
* src/chartab.c (copy_char_table):
* src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
* src/composite.c (get_composition_id, Fcomposition_get_gstring):
* src/composite.h (LGLYPH_NEW):
* src/fns.c (concat, Flocale_info, make_hash_table):
* src/font.c (font_otf_ValueRecord, font_otf_anchor)
(build_style_table, syms_of_font):
* src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
(dump_fontset, syms_of_fontset):
* src/image.c (xpm_make_color_table_v):
* src/keyboard.c (modify_event_symbol, menu_bar_items)
(parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
(syms_of_keyboard):
* src/keymap.c (Fdefine_key, describe_map, describe_vector):
* src/lread.c (read_vector):
* src/macfont.m (macfont_shape):
* src/menu.c (init_menu_items):
* src/nsfns.m (ns_make_monitor_attribute_list):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
* src/profiler.c (make_log):
* src/window.c (Fcurrent_window_configuration):
* src/xdisp.c (with_echo_area_buffer_unwind_data)
(format_mode_line_unwind_data):
* src/xfaces.c (Finternal_make_lisp_face)
(Fface_attributes_as_vector):
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list):
* src/xfont.c (syms_of_xfont):
* src/xselect.c (x_handle_dnd_message):
* src/xwidget.c (save_script_callback):
Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
* src/callint.c (Fcall_interactively):
* src/charset.c (load_charset_map):
* src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
* src/composite.c (get_composition_id)
* src/dispnew.c (Fframe_or_buffer_changed_p)
(syms_of_display):
* src/fns.c (make_hash_table, maybe_resize_hash_table):
* src/font.c (font_style_to_value):
* src/fontset.c (FONTSET_ADD, fontset_add):
* src/json.c (json_to_lisp):
* src/keymap.c (syms_of_keymap):
* src/lread.c (init_obarray):
* src/profiler.c (make_log, Fprofiler_cpu_log):
* src/term.c (term_get_fkeys_1):
Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
* src/font.c (build_style_table):
* src/macfont.m (macfont_shape):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
Prefer make_uninit_vector if the vector will be initialized soon.
* src/lisp.h (make_nil_vector): New function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Streamline and fix vector-size checks</title>
<updated>2018-12-09T00:58:40+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2018-12-09T00:56:32+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=7bcea8f8c11d10fd189c4250042dfe68e2df8c3a'/>
<id>7bcea8f8c11d10fd189c4250042dfe68e2df8c3a</id>
<content type='text'>
* src/alloc.c (VECTOR_ELTS_MAX): New constant.
(allocate_vectorlike): LEN now must be positive.  Assume LEN
is in range.  All callers changed.
(allocate_vector): Arg is now ptrdiff_t, not EMACS_INT.
All callers changed.  Return zero vector here, not in
allocate_vectorlike.
* src/lisp.h (make_uninit_vector): Simplify.
* src/xwidget.c (webkit_js_to_lisp):
Check for overflow in ptrdiff_t calculations.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/alloc.c (VECTOR_ELTS_MAX): New constant.
(allocate_vectorlike): LEN now must be positive.  Assume LEN
is in range.  All callers changed.
(allocate_vector): Arg is now ptrdiff_t, not EMACS_INT.
All callers changed.  Return zero vector here, not in
allocate_vectorlike.
* src/lisp.h (make_uninit_vector): Simplify.
* src/xwidget.c (webkit_js_to_lisp):
Check for overflow in ptrdiff_t calculations.
</pre>
</div>
</content>
</entry>
<entry>
<title>Act like POSIX sh if $HOME is relative</title>
<updated>2018-11-13T17:32:50+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2018-11-13T17:29:14+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=900276502fbb4dcabdabc5d7d24b4bc5645f2cf3'/>
<id>900276502fbb4dcabdabc5d7d24b4bc5645f2cf3</id>
<content type='text'>
POSIX says sh ~/foo should act like $HOME/foo even if $HOME is
relative, so be consistent with that (Bug#33255).
* admin/merge-gnulib (GNULIB_MODULES): Add dosname.
* src/buffer.c (init_buffer): Use emacs_wd to get
initial working directory with slash appended if needed.
(default-directory): Say it must be absolute.
* src/emacs.c (emacs_wd): New global variable.
(init_cmdargs): Dir arg is now char const *.
(main): Set emacs_wd.
* src/emacs.c (main) [NS_IMPL_COCOA]:
* src/fileio.c (Fexpand_file_name):
Use get_homedir instead of egetenv ("HOME").
* src/fileio.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME.
(splice_dir_file, get_homedir): New functions.
* src/xrdb.c (gethomedir): Remove.  All callers changed
to use get_homedir and splice_dir_file.
* test/src/fileio-tests.el (fileio-tests--relative-HOME): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
POSIX says sh ~/foo should act like $HOME/foo even if $HOME is
relative, so be consistent with that (Bug#33255).
* admin/merge-gnulib (GNULIB_MODULES): Add dosname.
* src/buffer.c (init_buffer): Use emacs_wd to get
initial working directory with slash appended if needed.
(default-directory): Say it must be absolute.
* src/emacs.c (emacs_wd): New global variable.
(init_cmdargs): Dir arg is now char const *.
(main): Set emacs_wd.
* src/emacs.c (main) [NS_IMPL_COCOA]:
* src/fileio.c (Fexpand_file_name):
Use get_homedir instead of egetenv ("HOME").
* src/fileio.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME.
(splice_dir_file, get_homedir): New functions.
* src/xrdb.c (gethomedir): Remove.  All callers changed
to use get_homedir and splice_dir_file.
* test/src/fileio-tests.el (fileio-tests--relative-HOME): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>maybe_disable_address_randomization always returns "int argc"</title>
<updated>2018-11-12T14:10:11+00:00</updated>
<author>
<name>Sam Steingold</name>
</author>
<published>2018-11-12T14:10:11+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=db711687c3983eda60275dadcc4dc75119e6c0ae'/>
<id>db711687c3983eda60275dadcc4dc75119e6c0ae</id>
<content type='text'>
maybe_disable_address_randomization needs a consistent signature
regardless of HAVE_PERSONALITY_ADDR_NO_RANDOMIZE.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
maybe_disable_address_randomization needs a consistent signature
regardless of HAVE_PERSONALITY_ADDR_NO_RANDOMIZE.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix dumping on GNU/Linux ppc64le</title>
<updated>2018-11-12T06:20:39+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2018-11-12T06:18:47+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c14eab222c5208ec0650292c3771a3ee632fdb0d'/>
<id>c14eab222c5208ec0650292c3771a3ee632fdb0d</id>
<content type='text'>
Problem reported by Thomas Fitzsimmons (Bug#33174).
* src/emacs.c (main): Adjust to sysdep.c changes.
* src/sysdep.c (exec_personality): New static var.
(disable_address_randomization): Remove, replacing with ...
(maybe_disable_address_randomization): ... this new function.
Do not set or use an environment variable; use a command-line
argument instead, and set the new static var.  Migrate the emacs.c
personality-change code to here, where it belongs.
(emacs_exec_file): Simplify by using new static var.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem reported by Thomas Fitzsimmons (Bug#33174).
* src/emacs.c (main): Adjust to sysdep.c changes.
* src/sysdep.c (exec_personality): New static var.
(disable_address_randomization): Remove, replacing with ...
(maybe_disable_address_randomization): ... this new function.
Do not set or use an environment variable; use a command-line
argument instead, and set the new static var.  Migrate the emacs.c
personality-change code to here, where it belongs.
(emacs_exec_file): Simplify by using new static var.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix struct thread alignment on FreeBSD x86</title>
<updated>2018-10-19T16:26:50+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2018-10-19T16:06:52+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=d2a07b9a82a632e8baa179c667a98d275e5f6973'/>
<id>d2a07b9a82a632e8baa179c667a98d275e5f6973</id>
<content type='text'>
Problem reported by Joseph Mingrone in:
https://lists.gnu.org/r/emacs-devel/2018-10/msg00238.html
While we’re at it, apply a similar fix to struct Lisp_Subr; this
removes the need for GCALIGNED_STRUCT_MEMBER and thus can shrink
struct Lisp_Subr a bit.
* configure.ac (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Bring back this macro.
Although used only for performance (not to actually align
structures), we might as well take advantage of it.
* src/lisp.h (GCALIGNED_STRUCT_MEMBER): Remove; all uses removed.
(union Aligned_Lisp_Subr): New type, like struct Lisp_Subr but aligned.
* src/lisp.h (XSUBR, DEFUN):
* src/lread.c (defsubr): Use it.  All callers changed.
* src/thread.c (union aligned_thread_state): New type.
(main_thread): Now of this type, so it’s aligned.
All uses changed.
* src/xmenu.c (syms_of_xmenu) [USE_GTK || USE_X_TOOLKIT]:
Adjust to union Aligned_Lisp_Subr change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem reported by Joseph Mingrone in:
https://lists.gnu.org/r/emacs-devel/2018-10/msg00238.html
While we’re at it, apply a similar fix to struct Lisp_Subr; this
removes the need for GCALIGNED_STRUCT_MEMBER and thus can shrink
struct Lisp_Subr a bit.
* configure.ac (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Bring back this macro.
Although used only for performance (not to actually align
structures), we might as well take advantage of it.
* src/lisp.h (GCALIGNED_STRUCT_MEMBER): Remove; all uses removed.
(union Aligned_Lisp_Subr): New type, like struct Lisp_Subr but aligned.
* src/lisp.h (XSUBR, DEFUN):
* src/lread.c (defsubr): Use it.  All callers changed.
* src/thread.c (union aligned_thread_state): New type.
(main_thread): Now of this type, so it’s aligned.
All uses changed.
* src/xmenu.c (syms_of_xmenu) [USE_GTK || USE_X_TOOLKIT]:
Adjust to union Aligned_Lisp_Subr change.
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid assertion violation when comparing with main-thread</title>
<updated>2018-10-17T15:19:47+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2018-10-17T15:19:47+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=73567432329a245b2eb02e4c61adea2c8eab6b3a'/>
<id>73567432329a245b2eb02e4c61adea2c8eab6b3a</id>
<content type='text'>
* src/thread.c (unmark_main_thread): New function.
* src/lisp.h (unmark_main_thread): Prototype it.
* src/alloc.c (garbage_collect_1): Call it after sweeping.
(Bug#33073)

* test/src/thread-tests.el (threads-test-bug33073): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/thread.c (unmark_main_thread): New function.
* src/lisp.h (unmark_main_thread): Prototype it.
* src/alloc.c (garbage_collect_1): Call it after sweeping.
(Bug#33073)

* test/src/thread-tests.el (threads-test-bug33073): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix lisp_eval_depth in unwind-protect cleanup</title>
<updated>2018-10-14T16:54:58+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2018-10-14T16:51:32+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=f1ea2b9e6b63593f5919f60a68a9e19026756ac4'/>
<id>f1ea2b9e6b63593f5919f60a68a9e19026756ac4</id>
<content type='text'>
Problem reported by Paul Pogonyshev (Bug#33034).
* src/lisp.h (union specbinding): New member unwind.eval_depth.
* src/eval.c (record_unwind_protect, set_unwind_protect): Set it.
(do_one_unbind): Use it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem reported by Paul Pogonyshev (Bug#33034).
* src/lisp.h (union specbinding): New member unwind.eval_depth.
* src/eval.c (record_unwind_protect, set_unwind_protect): Set it.
(do_one_unbind): Use it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix mishandling of symbols that look like numbers</title>
<updated>2018-10-11T06:19:42+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2018-10-11T06:17:18+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=5bd8cfc14d4b0c78c07e65a583f42a10c4cbc06d'/>
<id>5bd8cfc14d4b0c78c07e65a583f42a10c4cbc06d</id>
<content type='text'>
* src/bignum.c (make_neg_biguint): New function.
* src/lread.c (read1): Do not mishandle an unquoted symbol
with name equal to something like "1\0x", i.e., a string
of numeric form followed by a NUL byte.
Formerly these symbols were misread as numbers.
(string_to_number): Change last argument from an integer flag
to a pointer to the length.  This lets the caller figure out
how much of the prefix was used.  All callers changed.
Add a fast path if the integer (sans sign) fits in uintmax_t.
Update comments and simplify now that bignums are present.
* src/print.c (print_object): Fix quoting of symbols that look
like numbers, by relying on string_to_number for the tricky
cases rather than trying to redo its logic, incorrectly.  For
example, (read (prin1-to-string '\1e+NaN)) formerly returned
"1e+NaN", which was wrong: a backslash is needed in the output
to prevent it from being read as a NaN.  Escape NO_BREAK_SPACE
too, since lread.c treats it like SPACE.
* test/src/print-tests.el (print-read-roundtrip):
Add tests illustrating the abovementioned bugs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/bignum.c (make_neg_biguint): New function.
* src/lread.c (read1): Do not mishandle an unquoted symbol
with name equal to something like "1\0x", i.e., a string
of numeric form followed by a NUL byte.
Formerly these symbols were misread as numbers.
(string_to_number): Change last argument from an integer flag
to a pointer to the length.  This lets the caller figure out
how much of the prefix was used.  All callers changed.
Add a fast path if the integer (sans sign) fits in uintmax_t.
Update comments and simplify now that bignums are present.
* src/print.c (print_object): Fix quoting of symbols that look
like numbers, by relying on string_to_number for the tricky
cases rather than trying to redo its logic, incorrectly.  For
example, (read (prin1-to-string '\1e+NaN)) formerly returned
"1e+NaN", which was wrong: a backslash is needed in the output
to prevent it from being read as a NaN.  Escape NO_BREAK_SPACE
too, since lread.c treats it like SPACE.
* test/src/print-tests.el (print-read-roundtrip):
Add tests illustrating the abovementioned bugs.
</pre>
</div>
</content>
</entry>
</feed>
