mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -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:
parent
d5f99f4431
commit
20c282ae33
6 changed files with 43 additions and 37 deletions
7
admin/coccinelle/listn.cocci
Normal file
7
admin/coccinelle/listn.cocci
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Prefer 'list (...)' to 'listn (N, ...)'
|
||||||
|
@@
|
||||||
|
constant n;
|
||||||
|
@@
|
||||||
|
- listn (n,
|
||||||
|
+ list (
|
||||||
|
...)
|
||||||
|
|
@ -3219,14 +3219,14 @@ 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),
|
||||||
make_fixnum (state.status),
|
make_fixnum (state.status),
|
||||||
make_int (state.remaining),
|
make_int (state.remaining),
|
||||||
make_fixnum (state.plugged),
|
make_fixnum (state.plugged),
|
||||||
make_fixnum (state.temperature));
|
make_fixnum (state.temperature));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
25
src/buffer.c
25
src/buffer.c
|
|
@ -5024,19 +5024,18 @@ 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),
|
intern (":limit"),
|
||||||
intern (":limit"),
|
make_fixnum (node->limit),
|
||||||
make_fixnum (node->limit),
|
intern (":offset"),
|
||||||
intern (":offset"),
|
make_fixnum (node->offset),
|
||||||
make_fixnum (node->offset),
|
intern (":rear-advance"),
|
||||||
intern (":rear-advance"),
|
node->rear_advance ? Qt : Qnil,
|
||||||
node->rear_advance ? Qt : Qnil,
|
intern (":front-advance"),
|
||||||
intern (":front-advance"),
|
node->front_advance ? Qt : Qnil);
|
||||||
node->front_advance ? Qt : Qnil);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Lisp_Object
|
static Lisp_Object
|
||||||
|
|
|
||||||
|
|
@ -12789,10 +12789,10 @@ 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);
|
||||||
|
|
||||||
#ifdef HAVE_DBUS
|
#ifdef HAVE_DBUS
|
||||||
events = Fcons (Qdbus_event, events);
|
events = Fcons (Qdbus_event, events);
|
||||||
|
|
|
||||||
16
src/window.c
16
src/window.c
|
|
@ -7664,10 +7664,10 @@ 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),
|
||||||
kept_windows);
|
kept_windows);
|
||||||
}
|
}
|
||||||
else if (!NILP (w->start))
|
else if (!NILP (w->start))
|
||||||
|
|
@ -7689,10 +7689,10 @@ 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),
|
||||||
kept_windows);
|
kept_windows);
|
||||||
else if (EQ (window_restore_killed_buffer_windows, Qdelete)
|
else if (EQ (window_restore_killed_buffer_windows, Qdelete)
|
||||||
|| (!NILP (p->dedicated)
|
|| (!NILP (p->dedicated)
|
||||||
|
|
|
||||||
|
|
@ -4121,10 +4121,10 @@ 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));
|
||||||
|
|
||||||
x_dnd_waiting_for_finish = true;
|
x_dnd_waiting_for_finish = true;
|
||||||
x_dnd_finish_display = dpyinfo->display;
|
x_dnd_finish_display = dpyinfo->display;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue