1. 13 Aug, 2020 1 commit
  2. 24 May, 2020 1 commit
    • Eli Zaretskii's avatar
      Fix rare assertion violations in 'etags' · 0195809b
      Eli Zaretskii authored
      * lib-src/etags.c (pfnote): Instead of raising an assertion when
      we get an empty tag name, return immediately.  (Bug#41465)
      
      * test/manual/etags/ETAGS.good_1:
      * test/manual/etags/ETAGS.good_2:
      * test/manual/etags/ETAGS.good_3:
      * test/manual/etags/ETAGS.good_4:
      * test/manual/etags/ETAGS.good_5:
      * test/manual/etags/ETAGS.good_6: Adapt to latest changes in
      etags.
      0195809b
  3. 23 May, 2020 1 commit
  4. 04 Apr, 2020 1 commit
  5. 28 Mar, 2020 1 commit
    • Paul Eggert's avatar
      Stop using newly-deprecated dosname Gnulib module · 4f41188a
      Paul Eggert authored
      Code is supposed to use the filename module now.
      * admin/merge-gnulib (GNULIB_MODULES): Replace dosname with filename.
      * lib/dosname.h: Remove this forwarding stub.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib-src/emacsclient.c, src/fileio.c:
      Include filename.h instead of dosname.h.
      4f41188a
  6. 04 Mar, 2020 1 commit
    • Paul Eggert's avatar
      Pacify GCC 9.2.1 20190927 -O3 · dc3006cf
      Paul Eggert authored
      Original problem report by N. Jackson in:
      https://lists.gnu.org/r/emacs-devel/2020-03/msg00047.html
      I found some other warnings when I used gcc, and fixed them
      with this patch.
      * lib-src/etags.c: Include verify.h.
      (xnmalloc, xnrealloc): Tell the compiler that NITEMS is
      nononnegative and ITEM_SIZE is positive.
      * src/conf_post.h (__has_attribute_returns_nonnull)
      (ATTRIBUTE_RETURNS_NONNULL): New macros.
      * src/editfns.c (Fuser_full_name): Don’t assume Fuser_login_name
      returns non-nil.
      * src/intervals.c (rotate_right, rotate_left, update_interval):
      * src/intervals.h (LENGTH, LEFT_TOTAL_LENGTH, RIGHT_TOTAL_LENGTH):
      Use TOTAL_LENGTH0 or equivalent on intervals that might be null.
      * src/intervals.h (TOTAL_LENGTH): Assume arg is nonnull.
      (TOTAL_LENGTH0): New macro, with the old TOTAL_LENGTH meaning.
      (make_interval, split_interval_right): Add ATTRIBUTE_RETURNS_NONNULL.
      * src/pdumper.c (dump_check_dump_off): Now returns void, since
      no caller uses the return value.  Redo assert to pacify GCC.
      (decode_emacs_reloc): Add a seemingly-random eassume to pacify GCC.
      Ugly, and I suspect due to a bug in GCC.
      dc3006cf
  7. 16 Jan, 2020 1 commit
    • Robert Pluim's avatar
      Make emacs prefer an existing ~/.emacs.d to an existing XDG location · 13995f31
      Robert Pluim authored
      * doc/emacs/custom.texi (Find Init): Update description of how Emacs
      finds its init file directory and the interaction with
      $XDG_CONFIG_HOME
      (Early Init File): Correct XDG location of early-init.el
      
      * etc/NEWS: Update description to make it clear the ~/.emacs.d is
      preferred, even if the XDG location exists.
      
      * lisp/startup.el: Prefer ~/.emacs.d even if the XDG location exists.
      
      * lib-src/emacsclient.c (open_config): Prefer home directory the XDG
      location.
      13995f31
  8. 01 Jan, 2020 2 commits
  9. 10 Dec, 2019 3 commits
    • Paul Eggert's avatar
      Prefer static to extern in ebrowse · 28578f87
      Paul Eggert authored
      * lib-src/ebrowse.c (info_where, info_cls, info_member)
      (info_position, options, yyival, yytext, yytext_end, yyout)
      (yyline, filename, is_ident, is_digit, is_white, f_append)
      (f_verbose, f_very_verbose, f_structs, f_regexps)
      (f_nested_classes, min_regexp, max_regexp, inbuffer, in)
      (inbuffer_size, string_start, class_table, member_table)
      (namespace_alias_table, global_symbols, current_namespace)
      (all_namespaces, namespace_stack, namespace_stack_size)
      (namespace_sp, tk, keyword_table, search_path)
      (search_path_tail, scope_buffer, scope_buffer_size)
      (scope_buffer_len): Now static.
      (options): Now const.
      28578f87
    • Paul Eggert's avatar
      eec809e9
    • Paul Eggert's avatar
      daaa9da0
  10. 26 Nov, 2019 1 commit
    • Paul Eggert's avatar
      etags: remove some arbitrary limits · cffa5703
      Paul Eggert authored
      etags had undefined behavior if input files, lines, tags, etc.,
      had more than INT_MAX bytes.  Clean up the usage of integer types
      to fix the overflow errors I found.
      * admin/merge-gnulib (GNULIB_MODULES): Add mempcpy.
      * lib-src/etags.c: Include inttypes.h, intprops.h.
      (memcpyz): New function.  Use it to simplify several occurrences
      of memcpy followed by storing a trailing '\0'.
      (xnew): Use xnmalloc, to catch overflow on integer multiplication.
      (xrnew): Change last arg to multiplier.  The type is not needed.
      All callers changed.
      (node, lineno, charno, linecharno, invalidcharno, make_tag):
      (pfnote, add_node, number_len, C_symtype, lbz, Makefile_targets)
      (readline):
      Use intmax_t for line numbers and character positions, instead of
      int or long.
      (linebuffer, make_tag, pfnote, total_size_of_entries, put_entry)
      (in_word_set, C_symtype, token, cstack, pushclass_above):
      (popclass_above, write_classname, consider_token, C_entries)
      (Ruby_functions, Makefile_targets, Lua_functions, TeX_commands)
      (TeX_decode_env, erlang_func, erlang_attribute, erlang_atom)
      (substitute, regex_tag_multiline, nocase_tail, readline_interval)
      (readline, savenstr, concat, etags_getcwd, relative_filename)
      (linebuffer_setlen):
      Use ptrdiff_t for object sizes, instead of int or long or unsigned
      or size_t.
      (write_classname, C_entries):
      Avoid sprintf, as the result could exceed INT_MAX bytes
      and then behavior goes haywire.
      (main): Use int, instead of unsigned, for argv counts.
      (get_language_from_filename): Use bool for boolean.
      (Ruby_functions): Prefer strcpy to memcpy when copying "=".
      (linebuffer_setlen): Use ‘if’ instead of ‘while’.
      (memory_full, xnmalloc, xnrealloc): New functions.
      (xmalloc): Use memory_full, and take a ptrdiff_t instead of a size_t.
      (xrealloc): Remove; no longer needed.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/mempcpy.c, m4/mempcpy.m4: New files, copied from Gnulib.
      cffa5703
  11. 23 Sep, 2019 1 commit
    • Paul Eggert's avatar
      Update some URLs · 946a56a1
      Paul Eggert authored
      This mostly changes http: to https: in URLs.  It also updates
      some URLs that have moved, removes some URLs that no longer
      work, recommends against using procmail (procmail.org no
      longer works), and removes some mentions of the
      no-longer-existing Gmane, LPF and VTW.
      It doesn't update all URLs, just the ones I had time for.
      * GNUmakefile (help):
      * admin/admin.el (manual-doctype-string):
      * admin/charsets/Makefile.in (${charsetdir}/ALTERNATIVNYJ.map):
      * admin/charsets/mapconv:
      * lisp/net/soap-client.el (soap-create-envelope):
      * lisp/org/org.el (org-doi-server-url):
      * lisp/textmodes/bibtex.el (bibtex-generate-url-list):
      Prefer https: to http: un URLs.
      946a56a1
  12. 15 Sep, 2019 1 commit
  13. 31 Aug, 2019 1 commit
    • Paul Eggert's avatar
      Check instead of relying on NOTREACHED · 77910055
      Paul Eggert authored
      NOTREACHED was designed for traditional lint decades ago,
      and _Noreturn now normally subsumes its function.
      In the one case in Emacs where NORETURN might help and _Noreturn does
      not, check for NOTREACHED instead of assuming it.
      * lib-src/etags.c (main):
      * src/xterm.c (x_connection_closed):
      Remove NOTREACHED after a call to a _Noreturn function, as NOTREACHED
      is no longer needed there.  Also, one of the NOTREACHEDs was
      misplaced, which defeated traditional lint checking anyway.
      * lib-src/pop.c (pop_getline): Redo so as to not need NOTREACHED.
      * src/emacs.c (main): Use eassume (false) rather than NOTREACHED,
      so that running with ENABLE_CHECKING catches any internal error
      causing the toplevel Frecursive_edit to return.
      77910055
  14. 30 Aug, 2019 1 commit
    • Paul Eggert's avatar
      emacsclient: adjust to new config file location · 44f15b63
      Paul Eggert authored
      * lib-src/emacsclient.c (open_config): New arg XDG, to respect
      XDG_CONFIG_HOME, consistently with Emacs proper.  Caller changed.
      Use XDG convention if available, falling back on the old names
      if not.
      44f15b63
  15. 12 Jul, 2019 2 commits
  16. 09 Jul, 2019 1 commit
    • Andreas Schwab's avatar
      Make fingerprint handling compatible with LTO · fc41b061
      Andreas Schwab authored
      Tell the compiler that the fingerprint variable is modified unpredictably.
      
      * lib/fingerprint.h (fingerprint): Remove const.
      * lib/fingerprint.c (fingerprint): Likewise.
      * src/pdumper.c (Fdump_emacs_portable): Cast fingerprint variable.
      (pdumper_load): Likewise.
      * lib-src/make-fingerprint.c (main): Likewise.
      fc41b061
  17. 27 Jun, 2019 1 commit
  18. 26 Jun, 2019 1 commit
  19. 25 Jun, 2019 3 commits
    • Paul Eggert's avatar
      Prefer PATH_MAX to MAXPATHLEN · 824f7841
      Paul Eggert authored
      PATH_MAX is standardized, MAXPATHLEN is not.
      Also, the Gnulib pathmax module fixes some rare bugs with PATH_MAX.
      So prefer PATH_MAX to MAXPATHLEN unless we know the latter is
      also correct (for some platform-specific code).
      * admin/merge-gnulib (GNULIB_MODULES): Add pathmax.
      This module was already present, as a dependency of canonicalize-lgpl,
      but now Emacs is using it directly.  Sort.
      * lib-src/emacsclient.c: Include stdint.h, pathmax.h.
      (get_current_dir_name): Sync to current src/sysdep.c.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * src/sysdep.c: Include pathmax.h.
      (get_current_dir_name_or_unreachable):
      Use PATH_MAX instead of MAXPATHLEN.
      824f7841
    • Paul Eggert's avatar
      Avoid some strlen work, primarily via strnlen · d7c68362
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add strnlen.
      * lib-src/etags.c (find_entries):
      * src/emacs.c (main):
      * src/nsmenu.m (parseKeyEquiv:):
      * src/nsterm.m (ns_xlfd_to_fontname):
      * src/term.c (vfatal):
      Prefer !*X to !strlen (X).
      * lib-src/etags.c (pfnote, add_regex):
      * lib-src/pop.c (pop_open):
      * lib-src/update-game-score.c (main):
      * lwlib/lwlib.c (lw_separator_p):
      * src/doprnt.c (doprnt):
      * src/emacs.c (main):
      * src/inotify.c (inotifyevent_to_event):
      * src/keyboard.c (menu_separator_name_p, parse_tool_bar_item):
      * src/sysdep.c (get_current_dir_name_or_unreachable):
      * src/xdisp.c (store_mode_line_string):
      Use strnlen to avoid unnecessary work with strlen.
      * lib-src/etags.c (Prolog_functions, prolog_pr)
      (Erlang_functions, erlang_func):
      Prefer ptrdiff_t to size_t when either will do.
      (prolog_pr, erlang_func): New arg LASTLEN, to avoid
      unnecessary strlen call. All callers changed.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/strnlen.c, m4/strnlen.m4: New files, copied from Gnulib.
      * lwlib/lwlib.c (lw_separator_p):
      * src/json.c (json_has_prefix):
      Use strncmp to avoid unecessary work with strlen + memcmp.
      * src/process.c (set_socket_option): Use SBYTES instead of strlen.
      d7c68362
    • David Hull's avatar
      etags: Fix handling of quoted symbol names in Erlang · f0151e17
      David Hull authored
      * lib-src/etags.c (erlang_attribute): Fix handling of quoted
      symbol names in Erlang (bug#24960).
      f0151e17
  20. 24 Jun, 2019 2 commits
  21. 20 Jun, 2019 1 commit
    • Paul Eggert's avatar
      Simplify lib-src version printing · b6af2792
      Paul Eggert authored
      * lib-src/Makefile.in (etags_cflags): Remove.
      All uses replaced by a simple ‘-o $@’.
      (ebrowse${EXEEXT}, emacsclient${EXEEXT}, emacsclientw${EXEEXT}):
      Omit -DVERSION= option.
      * lib-src/ebrowse.c (VERSION):
      * lib-src/emacsclient.c (VERSION):
      * lib-src/etags.c (EMACS_NAME, VERSION): Remove.
      All uses replaced by PACKAGE_NAME and PACKAGE_VERSION.
      * lib-src/ebrowse.c (version):
      * lib-src/etags.c (print_version):
      Use fputs to output the version info, since that’s fputs_unlocked.
      * lib-src/etags.c (PROGRAM_NAME): New macro.
      (print_version): Use it.
      b6af2792
  22. 26 May, 2019 1 commit
  23. 23 May, 2019 1 commit
    • Paul Eggert's avatar
      Avoid backslash-newline-newline in source code · 54244364
      Paul Eggert authored
      * etc/refcards/Makefile (PDF_FRENCH):
      * lib-src/etags.c (LOOP_ON_INPUT_LINES):
      * lisp/dabbrev.el (dabbrev-check-other-buffers):
      * lisp/org/org-id.el (org-id-link-to-org-use-id):
      * lisp/org/org.el (org-support-shift-select, org-file-apps):
      * src/alloc.c (CHECK_ALLOCATED_AND_LIVE)
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL):
      * src/frame.h (FRAME_PIXEL_WIDTH_TO_TEXT_COLS):
      * src/regex-emacs.c (PREFETCH_NOLIMIT):
      * src/window.h (WINDOW_BUFFER):
      Remove backslash-newline that immediately precedes another
      newline, as this is not the usual style and is confusing.
      54244364
  24. 04 May, 2019 1 commit
    • Paul Eggert's avatar
      Port new fingerprinting scheme to clang + LTO · ebecafbd
      Paul Eggert authored
      * lib-src/make-fingerprint.c (main): Don't consider multiple
      instances of the fingerprint to be an error, as this can
      happen with clang and -flto.  Instead, replace all instances
      of the fingerprint.  There is a tiny chance that this will
      silently corrupt the Emacs executable.
      
      This patch suggests that we should go back to fingerprinting
      the inputs to the linker instead of its output, as the new
      fingerprinting scheme is unnecessarily complicated and this
      complexity reduces reliability. The old scheme (i.e., before
      commit 2019-05-14T23:31:24Z!eggert@cs.ucla.edu) was simpler
      and more portable and good enough, and it's looking like it
      would be less trouble in practice than the new scheme.
      ebecafbd
  25. 03 May, 2019 1 commit
    • Paul Eggert's avatar
      Simplify use of NDEBUG in etags.c · 6caf9be6
      Paul Eggert authored
      * lib-src/etags.c [!DEBUG]: Do not define NDEBUG,
      as that’s conf_post.h’s job now.
      [NDEBUG]: Do not redefine ‘assert’, as that works around
      ancient bugs (e.g., sunos4 pcc) that don’t matter any more,
      as can be seen that other Emacs source files that successfully
      use assert.h without this workaround.
      6caf9be6
  26. 26 Apr, 2019 1 commit
    • Stefan Monnier's avatar
      * lib-src/profile.c: Delete long-obsolete file · 82fc8ca6
      Stefan Monnier authored
      This auxiliary executable was used by the old `profile.el` which later
      inspired `elp.el`.  It was made obsolete when Emacs acquired native timers.
      
      * lib-src/Makefile.in (UTILITIES): Remove profile.
      (profile${EXEEXT}): Delete rule.
      82fc8ca6
  27. 25 Apr, 2019 2 commits
    • Paul Eggert's avatar
      Port emacsclient euidaccess to Solaris 10 · 30030945
      Paul Eggert authored
      Without this fix, linking emacsclient fails with ‘Undefined
      symbol eaccess’ on Solaris 10 sparc.
      * lib-src/Makefile.in (LIB_EACCESS): New macro.
      (emacsclient${EXEEXT}, emacsclientw${EXEEXT}): Use it.
      30030945
    • Paul Eggert's avatar
      Improve port to platforms lacking euidaccess (Bug#35406) · 2bf95739
      Paul Eggert authored
      * lib-src/emacsclient.c (set_local_socket):
      Use faccessat with AT_EACCESS instead of using euidaccess.
      * admin/merge-gnulib, lib/gnulib.mk.in, m4/gnulib-comp.m4:
      Revert previous change.
      2bf95739
  28. 21 Apr, 2019 1 commit
  29. 20 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Improve XDG_RUNTIME_DIR diagnostic · b3a12c62
      Paul Eggert authored
      * lib-src/emacsclient.c (set_local_socket):
      If there appears to be an XDG runtime directory for the user
      but XDG_RUNTIME_DIR is unset, suggest setting it while warning
      about potential security issues (Bug#35300).
      b3a12c62
  30. 18 Apr, 2019 3 commits
    • Philipp Stephani's avatar
    • Paul Eggert's avatar
      Fix make-fingerprint off-by-one bug · df5ca4f7
      Paul Eggert authored
      Problem reported by Alex Gramiak in:
      https://lists.gnu.org/r/emacs-devel/2019-04/msg00784.html
      * lib-src/make-fingerprint.c (main): Fix recently-introduced
      off-by-one bug when accessing args after -r.
      df5ca4f7
    • Paul Eggert's avatar
      Mark _Noreturn error functions as cold · 6d6c55db
      Paul Eggert authored
      On my platform this made ‘make compile-always’ 1.3% faster.
      Suggested by Alex Gramiak in:
      https://lists.gnu.org/r/emacs-devel/2019-04/msg00684.html
      * configure.ac (nw): Don’t use -Wsuggest-attribute=cold.
      * lib-src/make-docfile.c (write_globals):
      Mark noreturn functions as cold.
      * src/callproc.c (exec_failed):
      * src/data.c (wrong_length_argument, wrong_type_argument):
      * src/emacs-module.c (module_abort):
      * src/emacs.c (terminate_due_to_signal):
      * src/eval.c (unwind_to_catch):
      * src/image.c (my_png_error, my_error_exit):
      * src/json.c (json_out_of_memory, json_parse_error):
      * src/keyboard.c (quit_throw_to_read_char, user_error):
      * src/lisp.h (die, wrong_type_argument, wrong_choice)
      (args_out_of_range, args_out_of_range_3, circular_list)
      (buffer_overflow, memory_full, buffer_memory_full)
      (string_overflow, xsignal, xsignal0, xsignal1, xsignal2)
      (xsignal3, signal_error, overflow_error, error, verror)
      (nsberror, report_file_errno, report_file_error)
      (report_file_notify_error, terminate_due_to_signal)
      (emacs_abort, fatal):
      * src/lread.c (load_error_old_style_backquotes)
      (end_of_file_error, invalid_syntax):
      * src/pdumper.c (error_unsupported_dump_object):
      * src/puresize.h (pure_write_error):
      * src/search.c (matcher_overflow):
      * src/sound.c (sound_perror, alsa_sound_perror):
      * src/sysdep.c (handle_arith_signal):
      * src/systime.h (time_overflow):
      * src/term.c (maybe_fatal, vfatal):
      * src/textprop.c (text_read_only):
      * src/timefns.c (invalid_time_zone_specification)
      (time_error, invalid_hz):
      * src/xterm.c (x_connection_closed):
      Use AVOID instead of _Noreturn void, so that it’s marked cold.
      * src/conf_post.h (__has_attribute_cold) [!__has_attribute]:
      New macro.
      (ATTRIBUTE_COLD): New macro.
      * src/frame.h (WINDOW_SYSTEM_RETURN): Add ATTRIBUTE_COLD.
      * src/lisp.h (AVOID): New macro.
      * src/xterm.c: Omit unnecessary static decls, so that we needn’t
      worry about which functions should be marked cold.
      (x_io_error_quitter): Mark as cold.
      6d6c55db