1. 12 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Avoid duplicate comparison in describe_map_compare · 77a4cc9f
      Paul Eggert authored
      * src/fns.c (string_version_cmp): New function.
      This has most of the old Fstring_version_lessp,
      with an assertion to make things a bit clearer.
      * src/fns.c (Fstring_version_lessp):
      * src/keymap.c (describe_map_compare): Use it (Bug#33237).
      77a4cc9f
  2. 11 Jul, 2019 1 commit
  3. 04 Mar, 2019 1 commit
    • Paul Eggert's avatar
      Simplify list creation in C code · 5c2563a5
      Paul Eggert authored
      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.
      5c2563a5
  4. 09 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Use shortcuts for Flength · a8465033
      Paul Eggert authored
      When calculating the length of a Lisp object whose type is
      known, use a specialized length operation on it to save a bit
      of runtime overhead.
      * src/callint.c (Fcall_interactively):
      * src/minibuf.c (read_minibuf_unwind):
      Use ASIZE rather than Flength on values that must be vectors.
      * src/charset.c (Fsort_charsets):
      * src/coding.c (detect_coding_sjis):
      (Fdefine_coding_system_internal):
      * src/data.c (wrong_choice):
      * src/eval.c (Flet, eval_sub, Fapply, apply_lambda):
      * src/fns.c (sort_list):
      * src/font.c (font_vconcat_entity_vectors)
      (font_find_for_lface):
      * src/frame.c (Fmodify_frame_parameters):
      * src/fringe.c (get_logical_fringe_bitmap):
      * src/ftfont.c (ftfont_get_open_type_spec):
      * src/gtkutil.c (xg_print_frames_dialog):
      * src/lread.c (read1, read_vector):
      * src/keymap.c (Fkey_description):
      * src/kqueue.c (Fkqueue_add_watch):
      * src/macfont.m (macfont_get_open_type_spec):
      * src/menu.c (parse_single_submenu, x_popup_menu_1):
      * src/minibuf.c (Finternal_complete_buffer):
      * src/nsfont.m (ns_findfonts, nsfont_list_family):
      * src/process.c (Fmake_process):
      * src/search.c (Fset_match_data):
      * src/xfaces.c (Fx_family_fonts):
      Use list_length rather than Flength on values that must be lists.
      * src/fns.c (list_length): New function.
      (Flength): Use it.
      * src/nsfont.m (ns_findfonts):
      Use !NILP (x) rather than XFIXNUM (Flength (x)) != 0.
      * src/xdisp.c (store_mode_line_string):
      Use SCHARS rather than Flength on values that must be strings.
      a8465033
  5. 01 Jan, 2019 1 commit
  6. 09 Dec, 2018 1 commit
    • Paul Eggert's avatar
      Add make_vector and make_nil_vector · d79bb756
      Paul Eggert authored
      This makes the callers a bit easier to read, and doubtless
      improves efficiency very slightly.  It also simplifies
      possible future changes to allow bignum indexes to buffers.
      * src/alloc.c (allocate_vectorlike):
      Prefer ptrdiff_t to size_t when either will do.
      (make_vector): New function.
      (Fmake_vector): Use it.
      * src/buffer.c (syms_of_buffer):
      * src/bytecode.c (syms_of_bytecode):
      * src/category.c (Fmake_category_table, init_category_once):
      * src/ccl.c (syms_of_ccl):
      * src/character.c (syms_of_character):
      * src/charset.c (Fdefine_charset_internal)
      (Ffind_charset_region, Ffind_charset_string):
      * src/chartab.c (copy_char_table):
      * src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
      * src/composite.c (get_composition_id, Fcomposition_get_gstring):
      * src/composite.h (LGLYPH_NEW):
      * src/fns.c (concat, Flocale_info, make_hash_table):
      * src/font.c (font_otf_ValueRecord, font_otf_anchor)
      (build_style_table, syms_of_font):
      * src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
      (dump_fontset, syms_of_fontset):
      * src/image.c (xpm_make_color_table_v):
      * src/keyboard.c (modify_event_symbol, menu_bar_items)
      (parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
      (syms_of_keyboard):
      * src/keymap.c (Fdefine_key, describe_map, describe_vector):
      * src/lread.c (read_vector):
      * src/macfont.m (macfont_shape):
      * src/menu.c (init_menu_items):
      * src/nsfns.m (ns_make_monitor_attribute_list):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      * src/profiler.c (make_log):
      * src/window.c (Fcurrent_window_configuration):
      * src/xdisp.c (with_echo_area_buffer_unwind_data)
      (format_mode_line_unwind_data):
      * src/xfaces.c (Finternal_make_lisp_face)
      (Fface_attributes_as_vector):
      * src/xfns.c (x_make_monitor_attribute_list)
      (Fx_display_monitor_attributes_list):
      * src/xfont.c (syms_of_xfont):
      * src/xselect.c (x_handle_dnd_message):
      * src/xwidget.c (save_script_callback):
      Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
      * src/callint.c (Fcall_interactively):
      * src/charset.c (load_charset_map):
      * src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
      * src/composite.c (get_composition_id)
      * src/dispnew.c (Fframe_or_buffer_changed_p)
      (syms_of_display):
      * src/fns.c (make_hash_table, maybe_resize_hash_table):
      * src/font.c (font_style_to_value):
      * src/fontset.c (FONTSET_ADD, fontset_add):
      * src/json.c (json_to_lisp):
      * src/keymap.c (syms_of_keymap):
      * src/lread.c (init_obarray):
      * src/profiler.c (make_log, Fprofiler_cpu_log):
      * src/term.c (term_get_fkeys_1):
      Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
      * src/font.c (build_style_table):
      * src/macfont.m (macfont_shape):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      Prefer make_uninit_vector if the vector will be initialized soon.
      * src/lisp.h (make_nil_vector): New function.
      d79bb756
  7. 25 Sep, 2018 1 commit
  8. 20 Sep, 2018 1 commit
    • Eli Zaretskii's avatar
      More accurate docs for 'text-char-description' · d28d54c7
      Eli Zaretskii authored
      * src/keymap.c (Ftext_char_description):
      * doc/lispref/help.texi (Describing Characters): More accurate
      description of 'text-char-description'.  Remove incorrect
      examples from the ELisp manual.  (Bug#32743)
      d28d54c7
  9. 10 Sep, 2018 1 commit
    • Eli Zaretskii's avatar
      Clarify documentation of functions reading character events · 5cf282d6
      Eli Zaretskii authored
      * doc/lispref/help.texi (Describing Characters):
      * doc/lispref/commands.texi (Keyboard Events)
      (Reading One Event, Classifying Events): Make the distinction
      between characters and character events more explicit.
      
      * src/keymap.c (Ftext_char_description)
      (Fsingle_key_description):
      * src/lread.c (Fread_char, Fread_char_exclusive): Doc fixes,
      to make a clear distinction between a character input event
      and a character code.  (Bug#32562)
      5cf282d6
  10. 07 Sep, 2018 1 commit
    • Paul Eggert's avatar
      Shrink pseudovectors a bit · 2c8520e1
      Paul Eggert authored
      sizeof (struct Lisp_Marker) was 32 on x86, where 24 would do.
      Problem noted by Stefan Monnier in:
      https://lists.gnu.org/r/emacs-devel/2018-09/msg00165.html
      * src/bignum.h (struct Lisp_Bignum):
      * src/frame.h (struct frame):
      * src/lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
      (struct Lisp_Char_Table, struct Lisp_Hash_Table)
      (struct Lisp_Marker, struct Lisp_Overlay)
      (struct Lisp_Misc_Ptr, struct Lisp_User_Ptr)
      (struct Lisp_Finalizer, struct Lisp_Float)
      (struct Lisp_Module_Function):
      * src/process.h (struct Lisp_Process):
      * src/termhooks.h (struct terminal):
      * src/thread.h (struct thread_state, struct Lisp_Mutex)
      (struct Lisp_CondVar):
      * src/window.c (struct save_window_data):
      * src/window.h (struct window):
      * src/xterm.h (struct scroll_bar):
      * src/xwidget.h (struct xwidget, struct xwidget_view):
      Add GCALIGNED_STRUCT attribute.
      * src/lisp.h (GCALIGNED_UNION_MEMBER): Renamed from GCALIGNED_UNION.
      All uses changed.
      (GCALIGNED_STRUCT_MEMBER, GCALIGNED_STRUCT, GCALIGNED): New macros.
      All uses of open-coded GCALIGNED changed to use GCALIGNED.
      (union vectorlike_header): No longer GC-aligned.
      (PSEUDOVECSIZE): Yield 0 for pseudovectors without Lisp
      objects that place a member before where the first Lisp object
      member would be.
      2c8520e1
  11. 29 Aug, 2018 1 commit
  12. 08 Aug, 2018 1 commit
    • Tom Tromey's avatar
      More macro renamings for bignum · d1ec3a0a
      Tom Tromey authored
      * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
      src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
      src/category.c, src/ccl.c, src/character.c, src/character.h,
      src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
      src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
      src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
      src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
      src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
      src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
      src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
      src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
      src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
      src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
      src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
      src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
      src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
      src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
      src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
      src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
      src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
      src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
      src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
      Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
      d1ec3a0a
  13. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  14. 30 Jun, 2018 1 commit
    • Paul Eggert's avatar
      unbind_to performance tuning · 2e281186
      Paul Eggert authored
      * src/alloc.c (which_symbols):
      * src/dispnew.c (Fredisplay):
      * src/editfns.c (Fsubst_char_in_region):
      * src/fileio.c (Fdo_auto_save):
      * src/indent.c (Fvertical_motion):
      * src/keymap.c (Fcurrent_active_maps):
      * src/lread.c (Feval_buffer):
      * src/minibuf.c (get_minibuffer):
      * src/sysdep.c (system_process_attributes):
      * src/textprop.c (Fnext_single_char_property_change)
      (Fprevious_single_char_property_change):
      * src/window.c (Fscroll_other_window, Fscroll_other_window_down):
      * src/xdisp.c (Fformat_mode_line):
      Help the compiler eliminate tail recursion in call to unbind_to.
      * src/coding.c (decode_coding_gap):
      Omit unnecessary unbind_to, as we’re about to call unbind_to anyway.
      * src/coding.c (Fread_coding_system):
      * src/eval.c (eval_sub):
      * src/xdisp.c (handle_single_display_spec, decode_mode_spec):
      * src/xselect.c (x_get_local_selection):
      Avoid need to save a machine register when calling unbind_to.
      * src/minibuf.c (Ftry_completion, Fall_completions):
      Omit unnecessary assignment.
      2e281186
  15. 15 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Avoid Lisp_Misc allocation if C stack suffices · 12fd59bb
      Paul Eggert authored
      * src/fileio.c (union read_non_regular): New type.
      (read_non_regular, Finsert_file_contents):
      Use it to avoid	allocating a Lisp_Misc.
      * src/keymap.c (union map_keymap): New type.
      (map_keymap_char_table_item, map_keymap_internal):
      Use it to avoid	allocating a Lisp_Misc.
      12fd59bb
  16. 16 Feb, 2018 1 commit
  17. 01 Jan, 2018 1 commit
  18. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  19. 11 Jul, 2017 1 commit
    • NicolasPetton's avatar
      Add an optional testfn parameter to assoc · 0bece6c6
      NicolasPetton authored
      * src/fns.c (assoc): New optional testfn parameter used for comparison
      when provided.
      * test/src/fns-tests.el (test-assoc-testfn): Add tests for the new
      'testfn' parameter.
      * src/buffer.c:
      * src/coding.c:
      * src/dbusbind.c:
      * src/font.c:
      * src/fontset.c:
      * src/gfilenotify.c:
      * src/image.c:
      * src/keymap.c:
      * src/process.c:
      * src/w32fns.c:
      * src/w32font.c:
      * src/w32notify.c:
      * src/w32term.c:
      * src/xdisp.c:
      * src/xfont.c: Add a third argument to Fassoc calls.
      * etc/NEWS:
      * doc/lispref/lists.texi: Document the new 'testfn' parameter.
      0bece6c6
  20. 19 Feb, 2017 1 commit
  21. 26 Jan, 2017 1 commit
    • Paul Eggert's avatar
      Replace QUIT with maybe_quit · b3a3ed52
      Paul Eggert authored
      There’s no longer need to have QUIT stand for a slug of C statements.
      Use the more-obvious function-call syntax instead.
      Also, use true and false when setting immediate_quit.
      These changes should not affect the generated machine code.
      * src/lisp.h (QUIT): Remove.  All uses replaced by maybe_quit.
      b3a3ed52
  22. 01 Jan, 2017 1 commit
  23. 30 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Limit <config.h>’s includes · f4eb8900
      Paul Eggert authored
      This follows up on recent problems with the fact that config.h
      includes stdlib.h etc.; some files need to include stdlib.h later.
      config.h generally should limit itself to includes that are
      universally safe; outside of MS-Windows, only stdbool.h makes
      the cut among the files currently included.  So, move the
      other includes to just the files that need them (Bug#24506).
      * configure.ac (config_opsysfile): Remove, as this generic hook
      is no longer needed.
      * lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c:
      * src/w32proc.c (_GNU_SOURCE):
      Remove, as it’s OK for config.h to do this now.
      * src/conf_post.h: Include <ms-w32.h>, instead of the generic
      config_opsysfile, for simplicity as this old way of configuring is
      now done only for the MS-Windows port.  Do not include <ms-w32.h>
      if DEFER_MS_W32_H, for the benefit of the few files that want its
      effects later.  Do not include <alloca.h>, <string.h>, or
      <stdlib.h>.  Other files modified to include these headers as
      needed, or to not include headers that are no longer needed.
      * src/lisp.h: Include <alloca.h> and <string.h> here, since
      some of the inline functions need them.
      * src/regex.c: Include <alloca.h> if not emacs.  (If emacs,
      we can rely on SAFE_ALLOCA.)  There is no longer any need to
      worry about HAVE_ALLOCA_H.
      * src/unexmacosx.c: Rely on config.h not including stdlib.h.
      * src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H):
      Define before including <config.h> first, and include <ms-w32.h>
      after the troublesome headers.
      f4eb8900
  24. 15 Jun, 2016 1 commit
  25. 01 May, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Doc fix · 7b858857
      Lars Ingebrigtsen authored
      * src/keymap.c (Fdefine_prefix_command): Clarify doc string
      slightly (bug#18092).
      
      (cherry picked from commit 6b769c81)
      7b858857
  26. 29 Apr, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Doc fix · 6b769c81
      Lars Ingebrigtsen authored
      * src/keymap.c (Fdefine_prefix_command): Clarify doc string
      slightly (bug#18092).
      6b769c81
  27. 04 Apr, 2016 1 commit
    • Paul Eggert's avatar
      New C macro AUTO_STRING_WITH_LEN · 17cb263a
      Paul Eggert authored
      Put a bit less pressure on the garbage collector by defining a
      macro that is like AUTO_STRING but also allows null bytes in strings,
      and by extending AUTO_STRING to work with any unibyte string.
      * src/alloc.c (verify_ascii): Remove; all uses removed.
      AUTO_STRING can now be used on non-ASCII unibyte strings.
      * src/lisp.h (AUTO_STRING): Now allows non-ASCII unibyte strings.
      (AUTO_STRING_WITH_LEN): New macro.
      * src/coding.c (from_unicode_buffer):
      * src/editfns.c (format_time_string):
      * src/emacs-module.c (module_make_string, module_format_fun_env):
      * src/fileio.c (Fexpand_file_name):
      * src/font.c (font_parse_family_registry):
      * src/ftfont.c (ftfont_get_charset):
      * src/keymap.c (silly_event_symbol_error):
      * src/menu.c (single_menu_item):
      * src/sysdep.c (system_process_attributes):
      Use AUTO_STRING_WITH_LEN if possible.
      * src/emacs-module.c (module_make_function):
      * src/fileio.c (report_file_errno, report_file_notify_error):
      * src/fns.c (Flocale_info):
      * src/sysdep.c (system_process_attributes):
      Use AUTO_STRING if possible.  This is doable more often now
      that AUTO_STRING works on any unibyte string.
      17cb263a
  28. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  29. 01 Jan, 2016 1 commit
  30. 09 Nov, 2015 2 commits
    • Eli Zaretskii's avatar
      Fix assertion violation in define-key · 86c19714
      Eli Zaretskii authored
      * src/keymap.c (store_in_keymap): Don't use XFASTINT on non-character
      objects.  Reported by Drew Adams <drew.adams@oracle.com>
      and Juanma Barranquero <lekktu@gmail.com>.
      86c19714
    • Paul Eggert's avatar
      Use INT_ADD_WRAPV etc. to check integer overflow · 10873055
      Paul Eggert authored
      * src/alloc.c (xnmalloc, xnrealloc, xpalloc, Fmake_string):
      * src/buffer.c (record_overlay_string, overlay_strings):
      * src/casefiddle.c (casify_object):
      * src/ccl.c (Fccl_execute_on_string):
      * src/character.c (char_width, c_string_width, lisp_string_width)
      (count_size_as_multibyte, string_escape_byte8):
      * src/coding.c (coding_alloc_by_realloc, produce_chars):
      * src/data.c (arith_driver):
      * src/dispnew.c (realloc_glyph_pool, init_display):
      * src/editfns.c (styled_format):
      * src/fns.c (Ffillarray):
      * src/ftfont.c (ftfont_shape_by_flt):
      * src/gnutls.c (gnutls_hex_string):
      * src/gtkutil.c (get_utf8_string):
      * src/image.c (x_to_xcolors, x_detect_edges, png_load_body):
      * src/keymap.c (Fkey_description):
      * src/lisp.h (SAFE_ALLOCA_LISP):
      * src/term.c (encode_terminal_code):
      * src/tparam.c (tparam1):
      * src/xselect.c (x_property_data_to_lisp):
      * src/xsmfns.c (smc_save_yourself_CB):
      * src/xterm.c (x_term_init):
      When checking for integer overflow, prefer INT_MULTIPLY_WRAPV to
      more-complicated code involving division and/or
      INT_MULTIPLY_OVERFLOW, and similarly for INT_ADD_WRAPV and
      subtraction and/or INT_ADD_OVERFLOW.
      * src/casefiddle.c (casify_object): Simplify multibyte size check.
      * src/character.c: Remove some obsolete ‘#ifdef emacs’s.
      * src/data.c (arith_driver): Also check for division overflow,
      as that’s now possible given that the accumulator can now contain
      any Emacs integer.
      * src/lisp.h (lisp_word_count): Remove; no longer used.
      10873055
  31. 21 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Include-file cleanup for src directory · 63cfb75f
      Paul Eggert authored
      Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
      In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
      but does not include it directly.  As a general rule, a source
      file should include foo.h if it needs the interfaces that foo.h
      defines.
      * src/alloc.c: Don’t include process.h.  Include dispextern.h,
      systime.h.
      * src/atimer.c: Don’t include blockinput.h.
      * src/buffer.c: Include coding.h, systime.h.  Don’t include
      keyboard.h, coding.h.
      * src/callint.c: Don’t include commands.h, keymap.h.
      * src/callproc.c: Don’t include character.h, ccl.h, composite.h,
      systty.h, termhooks.h.
      * src/casetab.c: Don’t include character.h.
      * src/category.c: Don’t include charset.h, keymap.h.
      * src/ccl.h: Don’t include character.h.
      * src/character.c: Don’t include charset.h.
      * src/charset.c: Don’t include disptab.h.
      * src/chartab.c: Don’t include ccl.h.
      * src/cm.c: Don’t include frame.h, termhooks.h.
      * src/cmds.c: Don’t include window.h, dispextern.h.
      * src/coding.c: Don’t include window.h, frame.h.
      * src/composite.c: Include composite.h.  Don’t include window.h,
      font.h.
      * src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
      * src/dbusbind.c: Don’t include frame.h.
      * src/decompress.c: Don’t include character.h.
      * src/dired.c: Don’t include character.h, commands.h, charset.h.
      * src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
      process.h, timespec.h.  Include systime.h.
      * src/doc.c: Include coding.h.  Don’t include keyboard.h.
      * src/editfns.c: Include composite.h.  Don’t include frame.h.
      * src/emacs.c: Include fcntl.h, coding.h.  Don’t include
      commands.h, systty.h..
      * src/fileio.c: Don’t include intervals.h, dispextern.h.
      Include composite.h.
      * src/filelock.c: Don’t include character.h, systime.h.
      * src/fns.c: Don’t include time.h, commands.h, keyboard.h,
      keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
      * src/font.c: Include termhooks.h.
      * src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
      struct composition_it, struct face, struct glyph_string.
      * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
      intervals.h, window.h, termhooks.h.
      * src/frame.c: Don’t include character.h, commands.h, font.h.
      * src/frame.h: Don’t include dispextern.h.
      * src/fringe.c: Don’t include character.h.
      * src/ftcrfont.c: Don’t include dispextern.h, frame.h,
      character.h, charset.h, fontset.h.
      * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
      fontset.h.
      * src/ftxfont.c: Don’t include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/gfilenotify.c: Don’t include frame.h, process.h.
      * src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
      Don’t include syssignal.h, buffer.h, charset.h, font.h.
      * src/gtkutil.h: Don’t include frame.h.
      * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
      Don’t include character.h.
      * src/indent.c: Don’t include keyboard.h, termchar.h.
      * src/inotify.c: Don’t include character.h, frame.h.
      * src/insdel.c: Include composite.h.  Don’t include blockinput.h.
      * src/intervals.c: Don’t include character.h, keyboard.h.
      * src/intervals.h: Don’t include dispextern.h, composite.h.
      * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
      Include coding.h.
      * src/keyboard.h: Don’t incldue systime.h.
      * src/keymap.c: Don’t include charset.h, frame.h.
      * src/lread.c: Include dispextern.h and systime.h.
      Don’t include frame.h.  Include systime.h.
      * src/macros.c: Don’t include commands.h, character.h, buffer.h.
      * src/menu.c: Include character.h, coding.h.  Don’t include
      dispextern.h.
      * src/menu.h: Don’t include systime.h.
      * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
      intervals.h, termhooks.h.
      * src/print.c: Include coding.h.  Don’t include keyboard.h,
      window.h, dispextern.h, termchar.h, termhooks.h, font.h.
      Add forward decl of struct terminal.
      * src/process.c: Don’t include termhooks.h, commands.h,
      dispextern.h, composite.h.
      * src/region-cache.c: Don’t include character.h.
      * src/scroll.c: Don’t include keyboard.h, window.h.
      * src/search.c: Don’t include category.h, commands.h.
      * src/sound.c: Don’t include dispextern.h.
      * src/syntax.c: Don’t include command.h, keymap.h.
      * src/sysdep.c: Don’t include window.h, dispextern.h.
      * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
      * src/term.c: Don’t include systty.h, intervals.h, xterm.h.
      * src/terminal.c: Include character.h.
      Don’t include charset.h, coding.h.
      * src/textprop.c: Don’t include character.h.
      * src/undo.c: Don’t include character.h, commands.h, window.h.
      * src/unexsol.c: Don’t include character.h, charset.h.
      * src/widget.c: Include widget.h.  Don’t include keyboard.h,
      window.h, dispextern.h, blockinput.h, character.h, font.h.
      * src/widgetprv.h: Don’t include widget.h.
      * src/window.c: Don’t include character.h, menu.h, intervals.h.
      * src/xdisp.c: Include composite.h, systime.h.  Don’t include
      macros.h, process.h.
      * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
      intervals.h.
      * src/xfns.c: Don’t include menu.h, character.h, intervals.h,
      epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
      * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
      * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
      * src/xgselect.c: Don’t include timespec.h, frame.h.
      Include systime.h.
      * src/xgselect.h: Don’t include time.h.
      Use a forward decl to struct timespec instead.
      * src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
      dispextern.h.  Include systime.h.
      * src/xml.c: Don’t include character.h.
      * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
      * src/xselect.c: Don’t include dispextern.h, character.h,
      buffer.h, process.h.
      * src/xsmfns.c: Don’t include systime.h, sysselect.h.
      * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
      intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
      63cfb75f
  32. 10 Oct, 2015 1 commit
    • Paul Eggert's avatar
      CHECK_IMPURE and PURE_P speedup · bb7c182f
      Paul Eggert authored
      * src/intervals.c (create_root_interval):
      Do CHECK_IMPURE only for strings; not needed for buffers.
      Prefer ! STRINGP to BUFFERP, for a tad more speed.
      * src/puresize.h (CHECK_IMPURE, PURE_P):
      Now inline functions instead of macros.
      (PURE_P): Don’t use XPNTR; that is now the caller’s responsibility.
      All callers changed.
      (CHECK_IMPURE): New argument PTR, to save us the work of running XPNTR.
      All callers changed.
      bb7c182f
  33. 16 Sep, 2015 1 commit
    • Paul Eggert's avatar
      Omit unnecessary \ before paren in C docstrings · 032ce1c7
      Paul Eggert authored
      Although \( is needed in docstrings in Elisp code, it is not needed in
      docstrings in C code, since C function definitiions do not start with
      a parenthesis.  The backslashes made the docstrings a bit harder to
      read and to format in columns.  Also, some C docstrings had ( in
      column 1 and this did not appear to be causing any problems.  So,
      simplify C docstrings by replacing \( with ( and \) with ).
      032ce1c7
  34. 27 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS · 60d1b187
      Paul Eggert authored
      This removes the need for GCPRO1 etc.  Suggested by Stefan Monnier in:
      http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html
      * doc/lispref/internals.texi (Writing Emacs Primitives):
      * etc/NEWS:
      Document the change.
      * src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies)
      (nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live)
      (Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise):
      * src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]:
      * src/eval.c (gcpro_level) [DEBUG_GCPRO]:
      * src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK)
      (GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS)
      (GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES)
      (BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6)
      (GCPRO7, UNGCPRO, RETURN_UNGCPRO):
      Remove.  All uses removed.  The code now assumes
      GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS.
      * src/bytecode.c (relocate_byte_stack):
      Rename from unmark_byte_stack, since it now only relocates.
      All callers changed.
      * src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2
      with GCPROs removed.
      * src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1.
      * test/automated/finalizer-tests.el (finalizer-basic)
      (finalizer-circular-reference, finalizer-cross-reference)
      (finalizer-error):
      * test/automated/generator-tests.el (cps-test-iter-close-finalizer):
      Remove tests, as they depend on gc-precise.
      60d1b187
  35. 08 Jun, 2015 1 commit
  36. 31 May, 2015 1 commit
    • Paul Eggert's avatar
      Remove unused DEFSYMs · 0c2a3cf6
      Paul Eggert authored
      Remove DEFSYMs that aren't used at the C level.  Also:
      * src/decompress.c (Qzlib_dll):
      * src/font.c (Qunicode_sip):
      * src/frame.c (Qtip_frame):
      * src/ftfont.c (Qserif):
      * src/gnutls.c (Qgnutls_dll):
      * src/xml.c (Qlibxml2_dll):
      Move from here ...
      * src/w32fns.c (syms_of_w32fns): ... to here,
      as these are used only on MS-Windows.
      0c2a3cf6
  37. 21 May, 2015 1 commit
  38. 21 Feb, 2015 1 commit
    • Paul Eggert's avatar
      Prefer 'Qfoo' to 'intern ("foo")' · 3ebf0630
      Paul Eggert authored
      * buffer.c (syms_of_buffer):
      * bytecode.c (exec_byte_code):
      * callint.c (Fcall_interactively):
      * callproc.c (create_temp_file):
      * charset.c (define_charset_internal):
      * coding.c (syms_of_coding):
      * editfns.c (syms_of_editfns):
      * emacs.c (main):
      * fns.c (syms_of_fns):
      * frame.c (delete_frame, Fframe_parameters):
      * keyboard.c (syms_of_keyboard):
      * keymap.c (syms_of_keymap):
      * minibuf.c (read_minibuf, syms_of_minibuf):
      * nsfns.m (ns_cursor_type_to_lisp):
      * textprop.c (syms_of_textprop):
      * xdisp.c (Fformat_mode_line, syms_of_xdisp):
      * xfns.c (x_create_tip_frame, Fx_select_font):
      * xml.c (parse_region):
      Prefer constants like 'Qfoo' to calls like 'intern ("foo")'.
      * buffer.c (syms_of_buffer): OK to do (put 'erase-buffer 'disabled
      t) here now ...
      (keys_of_buffer): ... instead of here.
      * ftfont.c (syms_of_ftfont): Move DEFSYM of Qmono from here ...
      * xfns.c (syms_of_xfns): ... to here, since ftfont.c is more
      optional than xfns.c.
      3ebf0630
  39. 25 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Count MANY function args more reliably · a3689d3c
      Paul Eggert authored
      * alloc.c (Fgc_status, purecopy, unbind_to, garbage_collect_1):
      * buffer.c (Fbuffer_list, Fkill_buffer):
      * callint.c (read_file_name, Fcall_interactively):
      * charset.c (Fset_charset_priority, syms_of_charset):
      * chartab.c (uniprop_encode_value_numeric):
      * coding.c (syms_of_coding):
      * composite.c (syms_of_composite):
      * data.c (wrong_range):
      * dbusbind.c (syms_of_dbusbind):
      * dired.c (file_attributes):
      * editfns.c (Fdecode_time, update_buffer_properties, format2):
      * eval.c (run_hook_with_args_2, apply1, call1, call2, call3)
      (call4, call5, call6, call7):
      * fileio.c (Finsert_file_contents, choose_write_coding_system)
      (Fcar_less_than_car, build_annotations, auto_save_error):
      * filelock.c (get_boot_time):
      * fns.c (internal_equal, nconc2, Fyes_or_no_p, Fwidget_apply):
      (maybe_resize_hash_table, secure_hash):
      * font.c (font_style_to_value, font_open_by_name, Flist_fonts):
      * fontset.c (fontset_add, Fset_fontset_font):
      * ftfont.c (ftfont_lookup_cache):
      * gtkutil.c (xg_get_font):
      * insdel.c (signal_before_change, signal_after_change):
      * keymap.c (append_key):
      * lread.c (load_warn_old_style_backquotes, Fload, init_lread):
      * minibuf.c (Fread_buffer):
      * print.c (print_preprocess):
      * process.c (Fformat_network_address, Fmake_network_process)
      (server_accept_connection):
      * sound.c (Fplay_sound_internal):
      * term.c (Fsuspend_tty, Fresume_tty):
      * window.c (window_list):
      * xdisp.c (run_redisplay_end_trigger_hook, add_to_log)
      (message_with_string):
      * xfaces.c (Fx_list_fonts):
      * xfont.c (syms_of_xfont):
      * xselect.c (x_handle_selection_request)
      (x_handle_selection_clear, x_clear_frame_selections)
      (x_clipboard_manager_error_1):
      Prefer CALLMANY and CALLN to counting args by hand.
      * doc.c (reread_doc_file): Remove unused code.
      * fns.c (concat2, concat3): Redo to avoid need for local-var vector.
      (cmpfn_user_defined, hashfn_user_defined, Fmaphash):
      Prefer call1 and call2 to Ffuncall.
      * keyboard.c (safe_run_hook_funcall, safe_run_hooks):
      Use struct literal rather than a local var, for simplicity.
      * keymap.c (where_is_internal): Use NULL rather than a pointer
      to unused args.
      * lisp.h (CALLMANY, CALLN): New macros.
      * sound.c (Fplay_sound_internal): Coalesce duplicate code.
      Fixes: bug#19634
      a3689d3c