<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/sort.c, branch scratch/cedet-object-name</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>Replace call[1-8] with calln</title>
<updated>2025-01-19T13:29:41+00:00</updated>
<author>
<name>Stefan Kangas</name>
</author>
<published>2025-01-19T03:59:22+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=251e3d2654ae8e5fdee4624d9af93fb9c0e1b698'/>
<id>251e3d2654ae8e5fdee4624d9af93fb9c0e1b698</id>
<content type='text'>
Since the introduction of the 'calln' macro, the 'call1', 'call2', ...,
'call8' macros are just aliases for the former.  This is slightly
misleading and potentially unhelpful.  The number of arguments N can
also easily go out-of-synch with the used alias callN.  There is no
reason not to replace these aliases with using 'calln' directly.

To reduce the risk for mistakes, the tool Coccinelle was used to make
these changes.  See &lt;https://coccinelle.gitlabpages.inria.fr/website/&gt;.

* src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c:
* src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c:
* src/chartab.c, src/cmds.c, src/coding.c, src/composite.c:
* src/data.c, src/dbusbind.c, src/dired.c, src/doc.c:
* src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c:
* src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c:
* src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c:
* src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c:
* src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c:
* src/pgtkselect.c, src/print.c, src/process.c, src/sort.c:
* src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c:
* src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c:
* src/xmenu.c, src/xselect.c, src/xterm.c:
Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the introduction of the 'calln' macro, the 'call1', 'call2', ...,
'call8' macros are just aliases for the former.  This is slightly
misleading and potentially unhelpful.  The number of arguments N can
also easily go out-of-synch with the used alias callN.  There is no
reason not to replace these aliases with using 'calln' directly.

To reduce the risk for mistakes, the tool Coccinelle was used to make
these changes.  See &lt;https://coccinelle.gitlabpages.inria.fr/website/&gt;.

* src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c:
* src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c:
* src/chartab.c, src/cmds.c, src/coding.c, src/composite.c:
* src/data.c, src/dbusbind.c, src/dired.c, src/doc.c:
* src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c:
* src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c:
* src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c:
* src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c:
* src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c:
* src/pgtkselect.c, src/print.c, src/process.c, src/sort.c:
* src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c:
* src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c:
* src/xmenu.c, src/xselect.c, src/xterm.c:
Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright year to 2025</title>
<updated>2025-01-01T07:39:17+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2025-01-01T07:39:17+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=4da38c632161867e914b3a13dc760f8019255f94'/>
<id>4da38c632161867e914b3a13dc760f8019255f94</id>
<content type='text'>
Run "TZ=UTC0 admin/update-copyright".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run "TZ=UTC0 admin/update-copyright".
</pre>
</div>
</content>
</entry>
<entry>
<title>Prefer static_assert to verify</title>
<updated>2024-08-21T22:51:55+00:00</updated>
<author>
<name>Stefan Kangas</name>
</author>
<published>2024-07-23T22:09:49+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=7c8e28607b78b371598df58de96c3c3362ad6002'/>
<id>7c8e28607b78b371598df58de96c3c3362ad6002</id>
<content type='text'>
Although static_assert is C11-specific, and Emacs remains on C99, it
has been backported to older compilers by Gnulib.  Gnulib has already
changed to prefer static_assert, and we can do the same.

* lib-src/asset-directory-tool.c (main_2):
* src/alloc.c (BLOCK_ALIGN, aligned_alloc, lisp_align_malloc)
(vectorlike_nbytes, allocate_pseudovector):
* src/android.c (android_globalize_reference, android_set_dashes):
* src/android.h:
* src/androidfont.c (androidfont_draw, androidfont_text_extents):
* src/androidvfs.c:
* src/bidi.c (BIDI_CACHE_MAX_ELTS_PER_SLOT, bidi_find_bracket_pairs):
* src/buffer.c (init_buffer_once):
* src/casefiddle.c (do_casify_multibyte_string):
* src/dispnew.c (scrolling_window, scrolling):
* src/editfns.c (styled_format):
* src/emacs-module.c (module_extract_big_integer):
* src/fileio.c (Fdo_auto_save):
* src/fns.c (next_almost_prime, hash_string):
* src/fringe.c (init_fringe):
* src/keyboard.h (kbd_buffer_store_event_hold):
* src/keymap.c:
* src/lisp.h (memclear, reduce_emacs_uint_to_hash_hash, modiff_incr):
* src/lread.c (skip_lazy_string):
* src/pdumper.c (dump_bignum, Fdump_emacs_portable)
(dump_do_dump_relocation, pdumper_load):
* src/process.c (make_process, Fmake_process, connect_network_socket):
* src/regex-emacs.c:
* src/sort.c (tim_sort):
* src/sysdep.c (init_random, SSIZE_MAX):
* src/thread.c:
* src/timefns.c (trillion_factor):
* src/unexelf.c:
* src/xterm.c (x_send_scroll_bar_event): Prefer static_assert to Gnulib
verify.  Remove import of verify.h, except when used for other reasons.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Although static_assert is C11-specific, and Emacs remains on C99, it
has been backported to older compilers by Gnulib.  Gnulib has already
changed to prefer static_assert, and we can do the same.

* lib-src/asset-directory-tool.c (main_2):
* src/alloc.c (BLOCK_ALIGN, aligned_alloc, lisp_align_malloc)
(vectorlike_nbytes, allocate_pseudovector):
* src/android.c (android_globalize_reference, android_set_dashes):
* src/android.h:
* src/androidfont.c (androidfont_draw, androidfont_text_extents):
* src/androidvfs.c:
* src/bidi.c (BIDI_CACHE_MAX_ELTS_PER_SLOT, bidi_find_bracket_pairs):
* src/buffer.c (init_buffer_once):
* src/casefiddle.c (do_casify_multibyte_string):
* src/dispnew.c (scrolling_window, scrolling):
* src/editfns.c (styled_format):
* src/emacs-module.c (module_extract_big_integer):
* src/fileio.c (Fdo_auto_save):
* src/fns.c (next_almost_prime, hash_string):
* src/fringe.c (init_fringe):
* src/keyboard.h (kbd_buffer_store_event_hold):
* src/keymap.c:
* src/lisp.h (memclear, reduce_emacs_uint_to_hash_hash, modiff_incr):
* src/lread.c (skip_lazy_string):
* src/pdumper.c (dump_bignum, Fdump_emacs_portable)
(dump_do_dump_relocation, pdumper_load):
* src/process.c (make_process, Fmake_process, connect_network_socket):
* src/regex-emacs.c:
* src/sort.c (tim_sort):
* src/sysdep.c (init_random, SSIZE_MAX):
* src/thread.c:
* src/timefns.c (trillion_factor):
* src/unexelf.c:
* src/xterm.c (x_send_scroll_bar_event): Prefer static_assert to Gnulib
verify.  Remove import of verify.h, except when used for other reasons.
</pre>
</div>
</content>
</entry>
<entry>
<title>Spelling fixes</title>
<updated>2024-06-05T05:16:28+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2024-06-05T05:13:47+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3dcac22dd4225fdec0b97408da38f74de2a77bef'/>
<id>3dcac22dd4225fdec0b97408da38f74de2a77bef</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>; More coding style fixes</title>
<updated>2024-05-11T13:35:42+00:00</updated>
<author>
<name>Po Lu</name>
</author>
<published>2024-05-11T13:35:42+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=b990c37b9adbb4cbbcd6ef652c2a1737cf80269d'/>
<id>b990c37b9adbb4cbbcd6ef652c2a1737cf80269d</id>
<content type='text'>
* src/sort.c (reverse_sortslice, tim_sort): Correct not-so
egregious misformattings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/sort.c (reverse_sortslice, tim_sort): Correct not-so
egregious misformattings.
</pre>
</div>
</content>
</entry>
<entry>
<title>; Fix coding style in timsort.c</title>
<updated>2024-05-11T13:34:30+00:00</updated>
<author>
<name>Po Lu</name>
</author>
<published>2024-05-11T13:34:30+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=f43f7d7a43962aae4ec1ad353eda237f5348b40c'/>
<id>f43f7d7a43962aae4ec1ad353eda237f5348b40c</id>
<content type='text'>
* src/sort.c (reverse_slice, sortslice): Fix egregious coding
style inconsistencies.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/sort.c (reverse_slice, sortslice): Fix egregious coding
style inconsistencies.
</pre>
</div>
</content>
</entry>
<entry>
<title>Pacify GCC 14 -Wnull-dereference in tim_sort</title>
<updated>2024-04-30T08:26:23+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2024-04-30T08:20:12+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c2b2a38f70f6c4639903a014db5b835b37669ea7'/>
<id>c2b2a38f70f6c4639903a014db5b835b37669ea7</id>
<content type='text'>
* src/lisp.h (tim_sort): Require array arg to be nonnull.
* src/sort.c (reverse_slice): Omit no-longer-needed eassert.
(tim_sort): Avoid undefined behavior when length == 0,
since reverse_slice would then compute &amp;seq[-1].
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/lisp.h (tim_sort): Require array arg to be nonnull.
* src/sort.c (reverse_slice): Omit no-longer-needed eassert.
(tim_sort): Avoid undefined behavior when length == 0,
since reverse_slice would then compute &amp;seq[-1].
</pre>
</div>
</content>
</entry>
<entry>
<title>GC-mark temporary key values created when sorting (bug#69709)</title>
<updated>2024-04-14T16:29:16+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-04-14T16:20:47+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3d3602055264ca3095b7f28ca7e27a6f2782649a'/>
<id>3d3602055264ca3095b7f28ca7e27a6f2782649a</id>
<content type='text'>
Bug reported and fix proposed by Aris Spathis.

* src/sort.c (merge_markmem): Mark heap-allocated temporary key values.
(tim_sort): Delay key function calls to after marking function has been
registered.
* test/src/fns-tests.el (fns-tests-sort-gc): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug reported and fix proposed by Aris Spathis.

* src/sort.c (merge_markmem): Mark heap-allocated temporary key values.
(tim_sort): Delay key function calls to after marking function has been
registered.
* test/src/fns-tests.el (fns-tests-sort-gc): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Speed up `sort` by special-casing the `value&lt;` ordering</title>
<updated>2024-03-29T10:39:38+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-21T18:35:15+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=deae311281522864ebabaf56adafbe37032cc8a9'/>
<id>deae311281522864ebabaf56adafbe37032cc8a9</id>
<content type='text'>
This gives a 1.5x-2x speed-up when using the default :lessp value,
by eliminating the Ffuncall overhead.

* src/sort.c (order_pred_lisp, order_pred_valuelt): New.
(merge_state, inorder, binarysort, count_run, gallop_left, gallop_right)
(merge_init, merge_lo, merge_hi, tim_sort):
* src/fns.c (Fsort):
When using value&lt;, call it directly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This gives a 1.5x-2x speed-up when using the default :lessp value,
by eliminating the Ffuncall overhead.

* src/sort.c (order_pred_lisp, order_pred_valuelt): New.
(merge_state, inorder, binarysort, count_run, gallop_left, gallop_right)
(merge_init, merge_lo, merge_hi, tim_sort):
* src/fns.c (Fsort):
When using value&lt;, call it directly.
</pre>
</div>
</content>
</entry>
<entry>
<title>New `sort` keyword arguments (bug#69709)</title>
<updated>2024-03-29T10:39:38+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-19T12:03:47+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=ae5f2c02bd2fc269e2cc32c8039d95fbf4225e69'/>
<id>ae5f2c02bd2fc269e2cc32c8039d95fbf4225e69</id>
<content type='text'>
Add the :key, :lessp, :reverse and :in-place keyword arguments.
The old calling style remains available and is unchanged.

* src/fns.c (sort_list, sort_vector, Fsort):
* src/sort.c (tim_sort):
Add keyword arguments with associated new features.
All callers of Fsort adapted.
* test/src/fns-tests.el (fns-tests--shuffle-vector, fns-tests-sort-kw):
New test.
* doc/lispref/sequences.texi (Sequence Functions): Update manual.
* etc/NEWS: Announce.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the :key, :lessp, :reverse and :in-place keyword arguments.
The old calling style remains available and is unchanged.

* src/fns.c (sort_list, sort_vector, Fsort):
* src/sort.c (tim_sort):
Add keyword arguments with associated new features.
All callers of Fsort adapted.
* test/src/fns-tests.el (fns-tests--shuffle-vector, fns-tests-sort-kw):
New test.
* doc/lispref/sequences.texi (Sequence Functions): Update manual.
* etc/NEWS: Announce.
</pre>
</div>
</content>
</entry>
</feed>
