1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Prefer 'list (...)' to 'listn (N, ...)'

* src/androidfns.c (Fandroid_query_battery):
* src/buffer.c (make_lispy_itree_node):
* src/keyboard.c (init_while_no_input_ignore_events):
* src/window.c (Fset_window_configuration):
* src/xterm.c (x_dnd_send_unsupported_drop): Prefer 'list (...)' to
'listn (N, ...)'.
* admin/coccinelle/listn.cocci: New file.
This commit is contained in:
Stefan Kangas 2025-01-19 04:25:52 +01:00
parent d5f99f4431
commit 20c282ae33
6 changed files with 43 additions and 37 deletions

View file

@ -0,0 +1,7 @@
// Prefer 'list (...)' to 'listn (N, ...)'
@@
constant n;
@@
- listn (n,
+ list (
...)

View file

@ -3219,7 +3219,7 @@ for more details about these values. */)
if (android_query_battery (&state)) if (android_query_battery (&state))
return Qnil; return Qnil;
return listn (8, make_int (state.capacity), return list (make_int (state.capacity),
make_fixnum (state.charge_counter), make_fixnum (state.charge_counter),
make_int (state.current_average), make_int (state.current_average),
make_int (state.current_now), make_int (state.current_now),

View file

@ -5024,8 +5024,7 @@ defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring,
static Lisp_Object static Lisp_Object
make_lispy_itree_node (const struct itree_node *node) make_lispy_itree_node (const struct itree_node *node)
{ {
return listn (12, return list (intern (":begin"),
intern (":begin"),
make_fixnum (node->begin), make_fixnum (node->begin),
intern (":end"), intern (":end"),
make_fixnum (node->end), make_fixnum (node->end),

View file

@ -12789,7 +12789,7 @@ static const struct event_head head_table[] = {
static Lisp_Object static Lisp_Object
init_while_no_input_ignore_events (void) init_while_no_input_ignore_events (void)
{ {
Lisp_Object events = listn (9, Qselect_window, Qhelp_echo, Qmove_frame, Lisp_Object events = list (Qselect_window, Qhelp_echo, Qmove_frame,
Qiconify_frame, Qmake_frame_visible, Qiconify_frame, Qmake_frame_visible,
Qfocus_in, Qfocus_out, Qconfig_changed_event, Qfocus_in, Qfocus_out, Qconfig_changed_event,
Qselection_request); Qselection_request);

View file

@ -7664,7 +7664,7 @@ the return value is nil. Otherwise the value is t. */)
w->start_at_line_beg = true; w->start_at_line_beg = true;
if (FUNCTIONP (window_restore_killed_buffer_windows) if (FUNCTIONP (window_restore_killed_buffer_windows)
&& !MINI_WINDOW_P (w)) && !MINI_WINDOW_P (w))
kept_windows = Fcons (listn (6, window, p->buffer, kept_windows = Fcons (list (window, p->buffer,
Fmarker_last_position (p->start), Fmarker_last_position (p->start),
Fmarker_last_position (p->pointm), Fmarker_last_position (p->pointm),
p->dedicated, Qt), p->dedicated, Qt),
@ -7689,7 +7689,7 @@ the return value is nil. Otherwise the value is t. */)
{ {
if (FUNCTIONP (window_restore_killed_buffer_windows)) if (FUNCTIONP (window_restore_killed_buffer_windows))
kept_windows kept_windows
= Fcons (listn (6, window, p->buffer, = Fcons (list (window, p->buffer,
Fmarker_last_position (p->start), Fmarker_last_position (p->start),
Fmarker_last_position (p->pointm), Fmarker_last_position (p->pointm),
p->dedicated, Qnil), p->dedicated, Qnil),

View file

@ -4121,7 +4121,7 @@ x_dnd_send_unsupported_drop (struct x_display_info *dpyinfo, Window target_windo
x_dnd_unsupported_drop_time = before; x_dnd_unsupported_drop_time = before;
x_dnd_unsupported_drop_window = target_window; x_dnd_unsupported_drop_window = target_window;
x_dnd_unsupported_drop_data x_dnd_unsupported_drop_data
= listn (5, assq_no_quit (QXdndSelection, = list (assq_no_quit (QXdndSelection,
dpyinfo->terminal->Vselection_alist), dpyinfo->terminal->Vselection_alist),
targets, arg, make_fixnum (root_x), targets, arg, make_fixnum (root_x),
make_fixnum (root_y)); make_fixnum (root_y));