diff options
| author | Paul Eggert | 2019-03-04 00:00:39 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-03-04 00:05:04 -0800 |
| commit | 5c2563a5472cd5580e7af570aa320ac581ad1985 (patch) | |
| tree | fbf88ede49dc0ba527d3925dfc274c230b8cf95f /src/xterm.c | |
| parent | d6b3e5bbc5e14c32f3faad9f1481ec16807ac2fe (diff) | |
| download | emacs-5c2563a5472cd5580e7af570aa320ac581ad1985.tar.gz emacs-5c2563a5472cd5580e7af570aa320ac581ad1985.zip | |
Simplify list creation in C code
The main new thing here is that C code can now say
‘list (a, b, c, d, e, f)’ instead of
‘listn (CONSTYPE_HEAP, 6, a, b, c, d, e, f)’,
thus relieving callers of the responsibility of counting
arguments (plus, the code feels more like Lisp). The old
list1 ... list5 functions remain, as they’re probably a bit
faster for small lists.
* src/alloc.c (cons_listn, pure_listn): New functions.
(listn): Omit enum argument.
All callers changed to use either new ‘list’ or ‘pure_list’ macros.
* src/charset.c (Fdefine_charset_internal):
* src/coding.c (detect_coding_system)
(Fset_terminal_coding_system_internal):
* src/frame.c (frame_size_history_add, adjust_frame_size):
* src/gtkutil.c (xg_frame_set_char_size):
* src/keyboard.c (command_loop_1):
* src/nsfns.m (frame_geometry):
* src/widget.c (set_frame_size):
* src/xfaces.c (Fcolor_distance):
* src/xfns.c (frame_geometry):
* src/xterm.c (x_set_window_size_1):
* src/xwidget.c (Fxwidget_size_request):
Prefer list1i, list2i, etc. to open-coding them.
* src/charset.c (Fset_charset_priority):
* src/nsterm.m (append2):
* src/window.c (window_list):
* src/xfaces.c (Fx_list_fonts):
Use nconc2 instead of open-coding it.
* src/eval.c (eval_sub, backtrace_frame_apply):
* src/kqueue.c (kqueue_generate_event):
* src/nsterm.m (performDragOperation:):
* src/pdumper.c (Fpdumper_stats):
* src/w32.c (init_environment):
Prefer list1, list2, etc. to open-coding them.
* src/font.c (font_list_entities):
Parenthesize to avoid expanding new ‘list’ macro.
* src/gtkutil.c (GETSETUP): Rename from MAKE_FLOAT_PAGE_SETUP
to get lines to fit. Move outside the ‘list’ call, since it’s
now a macro.
* src/keymap.c (Fmake_keymap): Simplify.
* src/lisp.h (list, pure_list): New macros.
(list1i): New function.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/xterm.c b/src/xterm.c index 453669f6e02..73a38de3719 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -11181,8 +11181,7 @@ x_set_window_size_1 (struct frame *f, bool change_gravity, | |||
| 11181 | { | 11181 | { |
| 11182 | frame_size_history_add | 11182 | frame_size_history_add |
| 11183 | (f, Qx_set_window_size_1, width, height, | 11183 | (f, Qx_set_window_size_1, width, height, |
| 11184 | list2 (make_fixnum (old_height), | 11184 | list2i (old_height, pixelheight + FRAME_MENUBAR_HEIGHT (f))); |
| 11185 | make_fixnum (pixelheight + FRAME_MENUBAR_HEIGHT (f)))); | ||
| 11186 | 11185 | ||
| 11187 | XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 11186 | XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 11188 | old_width, pixelheight + FRAME_MENUBAR_HEIGHT (f)); | 11187 | old_width, pixelheight + FRAME_MENUBAR_HEIGHT (f)); |
| @@ -11191,7 +11190,7 @@ x_set_window_size_1 (struct frame *f, bool change_gravity, | |||
| 11191 | { | 11190 | { |
| 11192 | frame_size_history_add | 11191 | frame_size_history_add |
| 11193 | (f, Qx_set_window_size_2, width, height, | 11192 | (f, Qx_set_window_size_2, width, height, |
| 11194 | list2 (make_fixnum (old_width), make_fixnum (pixelwidth))); | 11193 | list2i (old_width, pixelwidth)); |
| 11195 | 11194 | ||
| 11196 | XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 11195 | XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 11197 | pixelwidth, old_height); | 11196 | pixelwidth, old_height); |
| @@ -11201,10 +11200,10 @@ x_set_window_size_1 (struct frame *f, bool change_gravity, | |||
| 11201 | { | 11200 | { |
| 11202 | frame_size_history_add | 11201 | frame_size_history_add |
| 11203 | (f, Qx_set_window_size_3, width, height, | 11202 | (f, Qx_set_window_size_3, width, height, |
| 11204 | list3 (make_fixnum (pixelwidth + FRAME_TOOLBAR_WIDTH (f)), | 11203 | list3i (pixelwidth + FRAME_TOOLBAR_WIDTH (f), |
| 11205 | make_fixnum (pixelheight + FRAME_TOOLBAR_HEIGHT (f) | 11204 | (pixelheight + FRAME_TOOLBAR_HEIGHT (f) |
| 11206 | + FRAME_MENUBAR_HEIGHT (f)), | 11205 | + FRAME_MENUBAR_HEIGHT (f)), |
| 11207 | make_fixnum (FRAME_MENUBAR_HEIGHT (f)))); | 11206 | FRAME_MENUBAR_HEIGHT (f))); |
| 11208 | 11207 | ||
| 11209 | XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 11208 | XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 11210 | pixelwidth, pixelheight + FRAME_MENUBAR_HEIGHT (f)); | 11209 | pixelwidth, pixelheight + FRAME_MENUBAR_HEIGHT (f)); |