aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Kangas2025-01-19 04:25:52 +0100
committerStefan Kangas2025-01-19 04:42:37 +0100
commit20c282ae331a5b71d7bae258ccdaa1e54490c3ef (patch)
tree3a2b89f5fedb3004f638e85dd6af79255739bf16 /src
parentd5f99f4431551865ff547ff2ecb7f10844ce881a (diff)
downloademacs-20c282ae331a5b71d7bae258ccdaa1e54490c3ef.tar.gz
emacs-20c282ae331a5b71d7bae258ccdaa1e54490c3ef.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/androidfns.c16
-rw-r--r--src/buffer.c25
-rw-r--r--src/keyboard.c8
-rw-r--r--src/window.c16
-rw-r--r--src/xterm.c8
5 files changed, 36 insertions, 37 deletions
diff --git a/src/androidfns.c b/src/androidfns.c
index 9eb313faaf6..ac0f4882f60 100644
--- a/src/androidfns.c
+++ b/src/androidfns.c
@@ -3219,14 +3219,14 @@ for more details about these values. */)
3219 if (android_query_battery (&state)) 3219 if (android_query_battery (&state))
3220 return Qnil; 3220 return Qnil;
3221 3221
3222 return listn (8, make_int (state.capacity), 3222 return list (make_int (state.capacity),
3223 make_fixnum (state.charge_counter), 3223 make_fixnum (state.charge_counter),
3224 make_int (state.current_average), 3224 make_int (state.current_average),
3225 make_int (state.current_now), 3225 make_int (state.current_now),
3226 make_fixnum (state.status), 3226 make_fixnum (state.status),
3227 make_int (state.remaining), 3227 make_int (state.remaining),
3228 make_fixnum (state.plugged), 3228 make_fixnum (state.plugged),
3229 make_fixnum (state.temperature)); 3229 make_fixnum (state.temperature));
3230} 3230}
3231 3231
3232 3232
diff --git a/src/buffer.c b/src/buffer.c
index 224d56e33dd..158ebbe0c30 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5024,19 +5024,18 @@ defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring,
5024static Lisp_Object 5024static Lisp_Object
5025make_lispy_itree_node (const struct itree_node *node) 5025make_lispy_itree_node (const struct itree_node *node)
5026{ 5026{
5027 return listn (12, 5027 return list (intern (":begin"),
5028 intern (":begin"), 5028 make_fixnum (node->begin),
5029 make_fixnum (node->begin), 5029 intern (":end"),
5030 intern (":end"), 5030 make_fixnum (node->end),
5031 make_fixnum (node->end), 5031 intern (":limit"),
5032 intern (":limit"), 5032 make_fixnum (node->limit),
5033 make_fixnum (node->limit), 5033 intern (":offset"),
5034 intern (":offset"), 5034 make_fixnum (node->offset),
5035 make_fixnum (node->offset), 5035 intern (":rear-advance"),
5036 intern (":rear-advance"), 5036 node->rear_advance ? Qt : Qnil,
5037 node->rear_advance ? Qt : Qnil, 5037 intern (":front-advance"),
5038 intern (":front-advance"), 5038 node->front_advance ? Qt : Qnil);
5039 node->front_advance ? Qt : Qnil);
5040} 5039}
5041 5040
5042static Lisp_Object 5041static Lisp_Object
diff --git a/src/keyboard.c b/src/keyboard.c
index fa19c9f8ad3..621e6c1cafb 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -12789,10 +12789,10 @@ static const struct event_head head_table[] = {
12789static Lisp_Object 12789static Lisp_Object
12790init_while_no_input_ignore_events (void) 12790init_while_no_input_ignore_events (void)
12791{ 12791{
12792 Lisp_Object events = listn (9, Qselect_window, Qhelp_echo, Qmove_frame, 12792 Lisp_Object events = list (Qselect_window, Qhelp_echo, Qmove_frame,
12793 Qiconify_frame, Qmake_frame_visible, 12793 Qiconify_frame, Qmake_frame_visible,
12794 Qfocus_in, Qfocus_out, Qconfig_changed_event, 12794 Qfocus_in, Qfocus_out, Qconfig_changed_event,
12795 Qselection_request); 12795 Qselection_request);
12796 12796
12797#ifdef HAVE_DBUS 12797#ifdef HAVE_DBUS
12798 events = Fcons (Qdbus_event, events); 12798 events = Fcons (Qdbus_event, events);
diff --git a/src/window.c b/src/window.c
index d7e6cd00c99..38f5307cb68 100644
--- a/src/window.c
+++ b/src/window.c
@@ -7664,10 +7664,10 @@ the return value is nil. Otherwise the value is t. */)
7664 w->start_at_line_beg = true; 7664 w->start_at_line_beg = true;
7665 if (FUNCTIONP (window_restore_killed_buffer_windows) 7665 if (FUNCTIONP (window_restore_killed_buffer_windows)
7666 && !MINI_WINDOW_P (w)) 7666 && !MINI_WINDOW_P (w))
7667 kept_windows = Fcons (listn (6, window, p->buffer, 7667 kept_windows = Fcons (list (window, p->buffer,
7668 Fmarker_last_position (p->start), 7668 Fmarker_last_position (p->start),
7669 Fmarker_last_position (p->pointm), 7669 Fmarker_last_position (p->pointm),
7670 p->dedicated, Qt), 7670 p->dedicated, Qt),
7671 kept_windows); 7671 kept_windows);
7672 } 7672 }
7673 else if (!NILP (w->start)) 7673 else if (!NILP (w->start))
@@ -7689,10 +7689,10 @@ the return value is nil. Otherwise the value is t. */)
7689 { 7689 {
7690 if (FUNCTIONP (window_restore_killed_buffer_windows)) 7690 if (FUNCTIONP (window_restore_killed_buffer_windows))
7691 kept_windows 7691 kept_windows
7692 = Fcons (listn (6, window, p->buffer, 7692 = Fcons (list (window, p->buffer,
7693 Fmarker_last_position (p->start), 7693 Fmarker_last_position (p->start),
7694 Fmarker_last_position (p->pointm), 7694 Fmarker_last_position (p->pointm),
7695 p->dedicated, Qnil), 7695 p->dedicated, Qnil),
7696 kept_windows); 7696 kept_windows);
7697 else if (EQ (window_restore_killed_buffer_windows, Qdelete) 7697 else if (EQ (window_restore_killed_buffer_windows, Qdelete)
7698 || (!NILP (p->dedicated) 7698 || (!NILP (p->dedicated)
diff --git a/src/xterm.c b/src/xterm.c
index 0692abbbb0b..43788af59d0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4121,10 +4121,10 @@ x_dnd_send_unsupported_drop (struct x_display_info *dpyinfo, Window target_windo
4121 x_dnd_unsupported_drop_time = before; 4121 x_dnd_unsupported_drop_time = before;
4122 x_dnd_unsupported_drop_window = target_window; 4122 x_dnd_unsupported_drop_window = target_window;
4123 x_dnd_unsupported_drop_data 4123 x_dnd_unsupported_drop_data
4124 = listn (5, assq_no_quit (QXdndSelection, 4124 = list (assq_no_quit (QXdndSelection,
4125 dpyinfo->terminal->Vselection_alist), 4125 dpyinfo->terminal->Vselection_alist),
4126 targets, arg, make_fixnum (root_x), 4126 targets, arg, make_fixnum (root_x),
4127 make_fixnum (root_y)); 4127 make_fixnum (root_y));
4128 4128
4129 x_dnd_waiting_for_finish = true; 4129 x_dnd_waiting_for_finish = true;
4130 x_dnd_finish_display = dpyinfo->display; 4130 x_dnd_finish_display = dpyinfo->display;