1. 23 Aug, 2020 1 commit
    • Paul Eggert's avatar
      Simplify by using Gnulib sigdescr_np module · df589d36
      Paul Eggert authored
      Inspired by a straightforward patch by Bruno Haible.
      * admin/merge-gnulib (GNULIB_MODULES): Add sigdescr_np.
      * configure.ac: Do not check for sys_siglist or __sys_siglist.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/sigdescr_np.c, m4/sigdescr_np.m4: New files, copied from Gnulib.
      * src/sysdep.c (sys_siglist, sys_siglist_entries): Remove.
      (init_signals): Do not initialize sys_siglist.
      (safe_strsignal): Use sigdescr_np instead of sys_siglist.
      df589d36
  2. 12 Aug, 2020 1 commit
    • Paul Eggert's avatar
      Stop using Gnulib inttypes module · 7e3fd65b
      Paul Eggert authored
      It wasn’t needed for MinGW after all, no other platform
      seems to need it, and it slows down ‘configure’.
      * admin/merge-gnulib (GNULIB_MODULES): Remove inttypes.
      * m4/gnulib-comp.m4: Regenerate.
      7e3fd65b
  3. 11 Aug, 2020 1 commit
    • Paul Eggert's avatar
      Use Gnulib inttypes module · 39c16c11
      Paul Eggert authored
      Needed for platforms like MinGW that don’t support C99 PRIdPTR.
      * admin/merge-gnulib (GNULIB_MODULES): Add inttypes.
      * m4/gnulib-comp.m4: Regenerate.
      39c16c11
  4. 09 Jul, 2020 1 commit
    • Paul Eggert's avatar
      Use Gnulib libgmp module · c8b6006d
      Paul Eggert authored
      Instead of doing GMP by hand, use the Gnulib libgmp module.
      * .gitignore: Add lib/gmp.h.
      * admin/merge-gnulib (GNULIB_MODULES): Add libgmp.
      * configure.ac (GMP_LIB, GMP_OBJ): Remove.  Gnulib uses the name
      LIB_GMP, so all uses changed.  All uses of GMP_OBJ removed.
      (HAVE_GMP): Set this from Gnulib’s variables.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/mini-gmp-gnulib.c, lib/mini-gmp.c, lib/mini-gmp.h, m4/libgmp.m4:
      New files, copied from Gnulib.
      * src/bignum.h, test/data/emacs-module/mod-test.c:
      Include gmp.h unconditionally.
      * src/mini-gmp-emacs.c, src/mini-gmp.c, src/mini-gmp.h:
      Remove.  This moves these files from src to lib, and
      updates them to the current GMP version.
      * test/Makefile.in (GMP_H): New macro.
      ($(test_module)): Use it to decide whether to compile
      mini-gmp-gnulib.c too.
      c8b6006d
  5. 27 Jun, 2020 1 commit
    • Paul Eggert's avatar
      Use getrandom syscall for nonces · 5ce5cf64
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add getrandom.
      * doc/lispref/text.texi (Format of GnuTLS Cryptography Inputs):
      Don’t say that iv-auto uses GNUTLS_RND_NONCE.  Also, don’t say
      that it returns the IV’s actual value, as it never has done that.
      * src/fns.c, src/sysdep.c: Include sys/random.h, for getrandom.
      * src/fns.c (Fsecure_hash_algorithms): Use getrandom so that this
      function does not depend on HAVE_GNUTLS3.
      * src/sysdep.c: Do not include <gnutls/crypto.h>.
      (random_seed) [HAVE_LRAND48]: Can be long int now.
      (init_random) [!WINDOWSNT]: Use getrandom syscall instead
      of opening /dev/urandom, as this works even on GNU/Linux
      hosts that lack /dev/urandom.  Don’t bother with gnutls_rnd
      as it’s not needed now that we have getrandom.
      5ce5cf64
  6. 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
  7. 07 Mar, 2020 1 commit
    • Paul Eggert's avatar
      Add ‘nofollow’ flag to set-file-times · 5d4cf1fe
      Paul Eggert authored
      This is a companion to the recent set-file-modes patch.
      It adds support for a ‘nofollow’ flag to set-file-times (Bug#39773).
      Like the set-file-modes patch, it needs work in the w32 port.
      * admin/merge-gnulib (GNULIB_MODULES): Add futimens, utimensat.
      Remove utimens.
      * doc/lispref/files.texi (Changing Files):
      * etc/NEWS: Mention the change.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lisp/files.el (copy-directory):
      * lisp/gnus/gnus-cloud.el (gnus-cloud-replace-file):
      * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file):
      * lisp/net/tramp-smb.el (tramp-smb-handle-copy-file):
      * lisp/tar-mode.el (tar-copy):
      * test/lisp/filenotify-tests.el (file-notify-test03-events):
      * test/lisp/files-tests.el:
      (files-tests-file-name-non-special-set-file-times):
      * test/lisp/net/tramp-tests.el (tramp-test22-file-times):
      When setting file times, avoid following symbolic links
      when the file is not supposed to be a symbolic link.
      * lib/futimens.c, lib/utimensat.c, m4/futimens.m4, m4/utimensat.m4:
      New files, copied from Gnulib.
      * lisp/gnus/gnus-cloud.el (gnus-cloud-replace-file):
      When creating a file that is not supposed to exist already,
      use the excl flag to check this.
      * lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
      * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times):
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-times):
      Accept an optional FLAG arg that is currently ignored,
      and add a FIXME comment for it.
      * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-times):
      * src/fileio.c (Fset_file_times):
      Support an optional FLAG arg.
      * src/fileio.c (Fcopy_file): Use futimens instead of set_file_times,
      as it’s simpler and is a POSIX API.
      * src/sysdep.c (set_file_times): Move from here ...
      * src/w32.c (set_file_times): ... to here, and make it static,
      since it is now used only in w32.c.  Presumably w32.c should also
      add support for futimens and utimensat (the POSIX APIs, which
      Emacs now uses) and it can remove fdutimens (the Gnulib API,
      which Emacs no longer uses).
      5d4cf1fe
  8. 24 Feb, 2020 1 commit
    • Paul Eggert's avatar
      Add 'nofollow' flag to set-file-modes etc. · 9d626dff
      Paul Eggert authored
      This avoids some race conditions (Bug#39683).  E.g., if some other
      program changes a file to a symlink between the time Emacs creates
      the file and the time it changes the file’s permissions, using the
      new flag prevents Emacs from inadvertently changing the
      permissions of a victim in some completely unrelated directory.
      * admin/merge-gnulib (GNULIB_MODULES): Add fchmodat.
      * doc/lispref/files.texi (Testing Accessibility, Changing Files):
      * doc/lispref/os.texi (File Notifications):
      * etc/NEWS:
      Adjust documentation accordingly.
      * lib/chmodat.c, lib/fchmodat.c, lib/lchmod.c, m4/fchmodat.m4:
      * m4/lchmod.m4: New files, copied from Gnulib.
      * lib/gnulib.mk.in: Regenerate.
      * lisp/dired-aux.el (dired-do-chmod):
      * lisp/doc-view.el (doc-view-make-safe-dir):
      * lisp/emacs-lisp/autoload.el (autoload--save-buffer):
      * lisp/emacs-lisp/bytecomp.el (byte-compile-file):
      * lisp/eshell/em-pred.el (eshell-pred-file-mode):
      * lisp/files.el (backup-buffer-copy, copy-directory):
      * lisp/gnus/mail-source.el (mail-source-movemail):
      * lisp/gnus/mm-decode.el (mm-display-external):
      * lisp/gnus/nnmail.el (nnmail-write-region):
      * lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy)
      (tramp-adb-handle-write-region):
      * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly):
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-write-region):
      * lisp/net/tramp.el (tramp-handle-write-region)
      (tramp-make-tramp-temp-file):
      * lisp/server.el (server-ensure-safe-dir):
      * lisp/url/url-util.el (url-make-private-file):
      When getting or setting file modes, avoid following symbolic links
      when the file is not supposed to be a symbolic link.
      * lisp/doc-view.el (doc-view-make-safe-dir):
      Omit no-longer-needed separate symlink test.
      * lisp/gnus/gnus-util.el (gnus-set-file-modes):
      * lisp/net/tramp.el (tramp-handle-file-modes):
      * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-modes):
      * src/fileio.c (symlink_nofollow_flag): New function.
      (Ffile_modes, Fset_file_modes):
      Support an optional FLAG arg.  All C callers changed.
      * lisp/net/ange-ftp.el (ange-ftp-set-file-modes):
      * lisp/net/tramp-adb.el (tramp-adb-handle-set-file-modes):
      * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-modes):
      * lisp/net/tramp-smb.el (tramp-smb-handle-set-file-modes):
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-modes):
      Accept an optional FLAG arg that is currently ignored,
      and add a FIXME comment for it.
      * m4/gnulib-comp.m4: Regenerate.
      9d626dff
  9. 19 Jan, 2020 1 commit
    • Paul Eggert's avatar
      Remove Gnulib putenv code · 35a1a007
      Paul Eggert authored
      It’s not needed, since Emacs always uses the system putenv and all
      platforms have putenv.  This improves on the fix for Bug#19874.
      Suggested by Bruno Haible.
      * admin/merge-gnulib (GNULIB_MODULES): Remove putenv.
      * configure.ac: Remove workarounds for Gnulib putenv module.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/putenv.c, m4/putenv.m4: Remove.
      35a1a007
  10. 01 Jan, 2020 1 commit
  11. 06 Dec, 2019 1 commit
    • Paul Eggert's avatar
      Update from Gnulib · c4cd2a0b
      Paul Eggert authored
      This incorporates:
      2019-12-06 nstrftime: better width support for %N, %z
      2019-12-03 Avoid hassles caused by [[noreturn]] in C++
      2019-12-02 Fix mistakes in --enable-threads=isoc fixes from 2019-12-01
      * admin/merge-gnulib (AVOIDED_MODULES): Avoid pthread-h.
      * lib/_Noreturn.h, lib/nstrftime.c, m4/gnulib-common.m4:
      * m4/timer_time.m4:
      Copy from Gnulib.
      * lib/gnulib.mk.in: Regenerate.
      c4cd2a0b
  12. 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
  13. 24 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Port double-slash test to z/OS · 50126f20
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add double-slash-root.
      Emacs was already using this Gnulib module indirectly, so this
      is merely noting that there is now a direct dependency.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * src/fileio.c (search_embedded_absfilename):
      Use DOUBLE_SLASH_IS_DISTINCT_ROOT instead of (WINDOWSNT || CYGWIN).
      Simplify.
      50126f20
  14. 25 Jun, 2019 2 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
  15. 24 Jun, 2019 1 commit
    • Daniel Colascione's avatar
      Fix locating pdump by symlink · b9ac4f81
      Daniel Colascione authored
      * admin/merge-gnulib (GNULIB_MODULES): Add canonicalize-lgpl module
      * build-aux/config.guess, build-aux/gitlog-to-changelog,
      build-aux/update-copyright, lib/canonicalize-lgpl.c,
      lib/gnulib.mk.in, lib/malloca.c, lib/malloca.h, lib/pathmax.h,
      m4/canonicalize.m4, m4/double-slash-root.m4, m4/gnulib-comp.m4,
      m4/malloca.m4, my/pathmax.4: copy from GNUlib or regenerate from
      update
      * src/emacs.c: find dump by canonical path
      b9ac4f81
  16. 07 Jun, 2019 1 commit
    • Paul Eggert's avatar
      Use copy_file_range to copy files · 486a81f3
      Paul Eggert authored
      The copy_file_range syscall (introduced in Linux kernel
      version 4.5) can copy files more efficiently via server-side
      copy etc.
      * admin/merge-gnulib (GNULIB_MODULES): Add copy-file-range.
      * lib/copy-file-range.c, m4/copy-file-range.m4:
      New files, copied from Gnulib.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * src/fileio.c (Fcopy_file): Try copy_file_range first,
      falling back on read+write only if copy_file_range failed or
      if the input is empty and so could be a /proc file.
      486a81f3
  17. 25 Apr, 2019 2 commits
  18. 15 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Replace executable’s fingerprint in place · 5c2f94a1
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add memmem-simple.
      (AVOIDED_MODULES): Add memchr.
      * configure.ac (HAVE_PDUMPER): AC_SUBST it, too, for use in makefiles.
      * lib/Makefile.in (libgnu_a_OBJECTS): Add fingerprint.o.
      * lib/fingerprint.c: New file.
      * lib/memmem.c, lib/str-two-way.h, m4/memmem.m4: New files,
      copied from Gnulib.
      * lib/fingerprint.h: Rename from src/fingerprint.h.
      * lib-src/make-fingerprint.c: Include limits.h, sys/stat.h,
      fingerprint.h, intprops.h, min-max.h.
      (SSIZE_MAX): New macro, if not already defined.
      (main): Without -r, Replace the fingerprint in the input file
      instead of generating a fingerprint.c.
      * lib/Makefile.in (libgnu_a_OBJECTS): Add fingerprint.o.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * src/Makefile.in (HAVE_PDUMPER, MAKE_PDUMPER_FINGERPRINT):
      New macros.
      (temacs$(EXEEXT)): Use them to replace the fingerprint instead
      of precalculating it.
      (mostlyclean, ctagsfiles1): Do not worry about fingerprint.c.
      5c2f94a1
  19. 01 Jan, 2019 1 commit
  20. 03 Dec, 2018 1 commit
    • Paul Eggert's avatar
      Use tcdrain, not fdatasync, to drain ttys · f5090b91
      Paul Eggert authored
      fdatasync is for storage devices, not ttys.
      * admin/merge-gnulib (GNULIB_MODULES): Remove fdatasync.
      * lib/fdatasync.c, m4/fdatasync.m4: Remove.
      * lib-src/Makefile.in (LIB_FDATASYNC):
      * src/Makefile.in (LIB_FDATASYNC):
      Remove.  All uses removed.
      * lib-src/emacsclient.c [!DOS_NT]:
      Include <termios.h>, for tcdrain.
      * lib-src/emacsclient.c (flush_stdout):
      * src/sysdep.c (reset_sys_modes): On ttys, use tcdrain instead
      of fdatasync (except don’t use either function if DOS_NT).
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      f5090b91
  21. 13 Nov, 2018 1 commit
    • Paul Eggert's avatar
      Act like POSIX sh if $HOME is relative · 90027650
      Paul Eggert authored
      POSIX says sh ~/foo should act like $HOME/foo even if $HOME is
      relative, so be consistent with that (Bug#33255).
      * admin/merge-gnulib (GNULIB_MODULES): Add dosname.
      * src/buffer.c (init_buffer): Use emacs_wd to get
      initial working directory with slash appended if needed.
      (default-directory): Say it must be absolute.
      * src/emacs.c (emacs_wd): New global variable.
      (init_cmdargs): Dir arg is now char const *.
      (main): Set emacs_wd.
      * src/emacs.c (main) [NS_IMPL_COCOA]:
      * src/fileio.c (Fexpand_file_name):
      Use get_homedir instead of egetenv ("HOME").
      * src/fileio.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME.
      (splice_dir_file, get_homedir): New functions.
      * src/xrdb.c (gethomedir): Remove.  All callers changed
      to use get_homedir and splice_dir_file.
      * test/src/fileio-tests.el (fileio-tests--relative-HOME): New test.
      90027650
  22. 09 Oct, 2018 1 commit
    • Paul Eggert's avatar
      Update from Gnulib · cf1ebfa0
      Paul Eggert authored
      This incorporates:
      2018-10-05 explicit_bzero: make it possible to namespace
      2018-10-04 fcntl: make it possible to namespace
      2018-10-01 mkostemp, mkostemps: fix C++ compilation on Mac OS X
      2018-09-19 maint: mktime.c now shared with glibc
      2018-09-18 file-has-acl: fix test failure on Cygwin 2.9
      2018-09-18 gettime: nanotime never existed
      * admin/merge-gnulib (AVOIDED_MODULES): Add mkdir.
      * doc/misc/texinfo.tex, lib/acl-internal.c, lib/acl-internal.h:
      * lib/acl_entries.c, lib/explicit_bzero.c, lib/fcntl.c:
      * lib/get-permissions.c, lib/gettime.c, lib/mktime.c:
      * lib/set-permissions.c, lib/stdlib.in.h, m4/acl.m4, m4/gettime.m4:
      Copy from Gnulib.
      * lib/gnulib.mk.in: Regenerate.
      cf1ebfa0
  23. 06 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Use Gnulib regex for lib-src · d904cc83
      Paul Eggert authored
      Emacs regular expressions forked from everyone else long ago.
      This makes it official and should allow simplification later.
      etags.c now uses the glibc regex API, falling back on a
      Gnulib-supplied substitute lib/regex.c if necessary.
      Emacs proper now uses its own regular expression module.
      Although this patch may look dauntingly large, most of it
      was generated automatically by admin/merge-gnulib
      and contains an exact copy of the glibc regex source,
      and the by-hand changes do not grow the Emacs source code.
      * admin/merge-gnulib (GNULIB_MODULES): Add regex.
      (AVOIDED_MODULES): Add btowc, langinfo, lock, mbrtowc, mbsinit,
      nl_langinfo, wchar, wcrtomb, wctype-h.
      * lib-src/Makefile.in (regex-emacs.o): Remove; Gnulib does it now.
      (etags_deps, etags_libs): Remove regex-emacs.o.
      * lib-src/etags.c: Go back to including regex.h.
      (add_regex): Use unsigned char translation array,
      since glibc regex requires that.
      * lib/Makefile.in (not_emacs_OBJECTS, for_emacs_OBJECTS): New macros.
      (libegnu_a_OBJECTS): Use them, to avoid building e-regex.o.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c:
      * lib/regex_internal.h, lib/regexec.c, m4/builtin-expect.m4:
      * m4/eealloc.m4, m4/glibc21.m4, m4/mbstate_t.m4, m4/regex.m4:
      New files, copied from Gnulib.
      * src/regex-emacs.h, src/conf_post.h:
      (RE_TRANSLATE_TYPE, RE_TRANSLATE, RE_TRANSLATE_P):
      Move from src/conf_post.h to src/regex-emacs.h,
      so that they don’t interfere with compiling lib/regex.c.
      d904cc83
  24. 02 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Substitute a <ieee754.h> on hosts lacking it · d216d7d2
      Paul Eggert authored
      * .gitignore: Add lib/ieee754.h.
      * admin/merge-gnulib (GNULIB_MODULES): Add ieee754-h.
      * configure.ac: Remove ieee754.h check, as Gnulib now does that.
      * etc/NEWS: Mention this.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/ieee754.in.h, m4/ieee754-h.m4: New files, from Gnulib.
      * src/lisp.h (IEEE_FLOATING_POINT): Now a macro so that it
      can be used in #if.
      * src/lread.c, src/print.c: Include <ieee754.h> if
      IEEE_FLOATING_POINT, not if HAVE_IEEE754_H.
      * src/lread.c (string_to_number):
      * src/print.c (float_to_string):
      Process NaNs only on IEEE hosts, and assume <ieee754.h>
      in that case.
      d216d7d2
  25. 08 Jul, 2018 2 commits
  26. 21 May, 2018 1 commit
    • Paul Eggert's avatar
      Update from Gnulib · 79f15092
      Paul Eggert authored
      This incorporates:
      2018-05-21 crypto: omit stream ops Emacs doesn’t need
      2018-05-13 truncate: Fix compilation error on Android
      2018-05-13 imaxdiv: Fix compilation error on Android
      2018-05-13 Support selective inclusion of recent mingw.org headers
      2018-05-13 Add cross-compilation guesses for Linux systems sans glibc
      2018-05-13 stdioext: Fix compilation errors with newer Android headers
      2018-05-07 af_alg: Pacify --enable-gcc-warnings
      2018-05-06 af_alg: Fix bug with streams that are not at position 0
      2018-05-06 Followup to 'af_alg: New module'
      2018-05-05 crypto/{md5,sha1,sha256,sha512}: simplify
      2018-05-05 af_alg: New module
      2018-05-05 af_alg: Improve function signature
      2018-04-28 md5sum: Use AF_ALG when available
      2018-04-28 sha512sum: Use AF_ALG when available
      2018-04-28 sha256sum: Use AF_ALG when available
      2018-04-28 sha1sum: Use AF_ALG when available
      2018-05-05 all: Replace more http URLs by https URLs
      2018-05-03 maint: port more modules to GCC 8
      2018-05-03 Simplify code; drop support for Borland C++ on Windows
      * admin/merge-gnulib (GNULIB_MODULES): Use crypto/md5-buffer
      rather than crypto/md5, since Emacs doesn’t use the stream
      operations that in recent Gnulib pull in other stuff Emacs doesn’t
      need.  Similarly for crypto/sha1-buffer, crypto/sha256-buffer,
      crypto/sha512-buffer.
      * build-aux/config.guess, build-aux/config.sub, lib/dosname.h:
      * lib/dup2.c, lib/errno.in.h, lib/euidaccess.c, lib/fcntl.c:
      * lib/fcntl.in.h, lib/fpending.c, lib/fsync.c, lib/getdtablesize.c:
      * lib/getopt.c, lib/gettimeofday.c, lib/inttypes.in.h, lib/md5.c:
      * lib/md5.h, lib/open.c, lib/pipe2.c, lib/putenv.c, lib/sha1.c:
      * lib/sha1.h, lib/sha256.c, lib/sha256.h, lib/sha512.c:
      * lib/sha512.h, lib/stat-time.h, lib/stdio-impl.h, lib/stdio.in.h:
      * lib/stdlib.in.h, lib/sys_stat.in.h, lib/sys_types.in.h:
      * lib/timespec.h, lib/unistd.in.h, lib/utimens.c, m4/c-strtod.m4:
      * m4/gnulib-common.m4, m4/inttypes.m4, m4/lstat.m4, m4/nocrash.m4:
      * m4/pselect.m4, m4/readlink.m4, m4/stdio_h.m4, m4/symlink.m4:
      * m4/unistd_h.m4, m4/utimens.m4:
      Copy from Gnulib.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      79f15092
  27. 01 Jan, 2018 1 commit
  28. 02 Oct, 2017 1 commit
    • Paul Eggert's avatar
      Port file-system-info to non-Microsoft · 135bca57
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add fsusage.
      * doc/emacs/files.texi (Directories): Remove documentation of
      now-obsolete directory-free-space-program and
      directory-free-space-args.
      * etc/NEWS: Mention change.
      * etc/PROBLEMS: Slow df is no longer a problem.
      * lib/fsusage.c, lib/fsusage.h, m4/fsusage.m4:
      New files, copied from Gnulib.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lisp/dired.el (dired-free-space-program)
      (dired-free-space-args): These aliases are now obsolete.
      * lisp/files.el (directory-free-space-program)
      (directory-free-space-args): Now obsolete.
      (get-free-disk-space): Just call file-system-info instead
      of the now-obsolete directory-free-space-program.
      * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_fsusage): New macro.
      * src/fileio.c: Include fsusage.h.
      (blocks_to_bytes, Ffile_system_info) [!DOS_NT]: New functions.
      (syms_of_fileio) [!DOS_NT]: Defsubr file-system-info.
      135bca57
  29. 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
  30. 16 Aug, 2017 1 commit
    • Paul Eggert's avatar
      Merge from Gnulib; use ‘open’ for O_CLOEXEC · 794c3cd3
      Paul Eggert authored
      This incorporates:
      2017-08-15 renameat: ensure declaration in <stdio.h> on NetBSD
      2017-08-15 extensions: enable NetBSD specific extensions
      2017-08-14 open: support O_CLOEXEC
      2017-08-13 reallocarray: new module
      * admin/merge-gnulib (AVOIDED_MODULES): Remove ‘open’, since
      it now supports O_CLOEXEC and this simplifies Emacs.
      * build-aux/config.guess, lib/fcntl.in.h, lib/stdio.in.h:
      * lib/stdlib.in.h, m4/extensions.m4, m4/stdlib_h.m4:
      Copy from Gnulib.
      * lib/cloexec.c, lib/cloexec.h, lib/open.c:
      * m4/mode_t.m4, m4/open-cloexec.m4, m4/open.m4:
      New files, copied from Gnulib.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib-src/etags.c (O_CLOEXEC) [WINDOWSNT]:
      Remove, as Gnulib does this for us.
      * src/filelock.c (create_lock_file):
      * src/sysdep.c (emacs_open, emacs_pipe):
      Don’t worry about O_CLOEXEC == 0, as Gnulib no longer sets it to 0.
      794c3cd3
  31. 12 Aug, 2017 1 commit
    • Paul Eggert's avatar
      Improve make-temp-file performance on local files · a6ad98ad
      Paul Eggert authored
      For the motivation behind this patch, please see Bug#28023 and:
      http://emacshorrors.com/posts/make-temp-name.html
      Although, given the recent changes to Tramp, the related security
      problem in make-temp-file is already fixed, make-temp-file still has
      several unnecessary system calls.  In the typical case on GNU/Linux,
      this patch replaces 8 syscalls (symlink, open, close, readlinkat, uname,
      getpid, unlink, umask) by 2 (open, close).
      * admin/merge-gnulib (GNULIB_MODULES): Add tempname, now
      that Emacs is using it directly.
      * configure.ac (AUTO_DEPEND): Remove AC_SYS_LONG_FILE_NAMES;
      no longer needed.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lisp/files.el (files--make-magic-temp-file): Rename from
      make-temp-file.
      (make-temp-file): Use make-temp-file-internal for
      non-magic file names.
      * src/fileio.c: Include tempname.h.
      (make_temp_name_tbl, make_temp_name_count)
      (make_temp_name_count_initialized_p, make_temp_name): Remove.
      (Fmake_temp_file_internal): New function.
      (Fmake_temp_name): Use it.
      * src/filelock.c (get_boot_time): Use Fmake_temp_file_internal
      instead of make_temp_name.
      a6ad98ad
  32. 09 Aug, 2017 1 commit
    • Paul Eggert's avatar
      Merge from gnulib · 904be8c4
      Paul Eggert authored
      This incorporates:
      2017-08-09 tempname: do not depend on secure_getenv
      2017-08-08 extensions: add _OPENBSD_SOURCE
      2017-08-06 manywarnings: Add support for C++
      2017-08-06 warnings, manywarnings: Add support for multiple languages
      * admin/merge-gnulib: Don't use m4/manywarnings-c++.m4.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/secure_getenv.c, m4/secure_getenv.m4: Remove.
      * lib/tempname.c, m4/extensions.m4, m4/manywarnings.m4, m4/warnings.m4:
      Copy from gnulib.
      904be8c4
  33. 31 Jul, 2017 1 commit
    • Paul Eggert's avatar
      Avoid most stat calls when completing file names · 3a8d0cc8
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add d-type.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * m4/d-type.m4: New file, copied from gnulib.
      * src/dired.c (DT_UNKNOWN, DT_DIR, DT_LINK)
      [!HAVE_STRUCT_DIRENT_D_TYPE]: New constants.
      (dirent_type): New function.
      (file_name_completion): Use it, to avoid unnecessary calls to
      stat-like functions on GNU/Linux and other platforms with d_type.
      (file_name_completion_stat): Just follow the link; there is no
      need to try first with AT_SYMLINK_NOFOLLOW since the directory
      entry was already checked to exist.
      3a8d0cc8
  34. 24 Jul, 2017 1 commit
    • Paul Eggert's avatar
      Merge from gnulib · 9b971bdd
      Paul Eggert authored
      This incorporates:
      2017-07-23 Rename module 'strftime' to 'nstrftime'
      * admin/merge-gnulib (GNULIB_MODULES): Add nstrftime, remove strftime.
      * build-aux/config.guess: Copy from gnulib.
      * lib/nstrftime.c: Rename from lib/strftime.c.
      * m4/nstrftime.m4: Rename from m4/strftime.m4.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      9b971bdd
  35. 16 Jul, 2017 1 commit
    • Paul Eggert's avatar
      Use explicit_bzero to clear GnuTLS keys · 59f69721
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add explicit_bzero.
      * lib/explicit_bzero.c, m4/explicit_bzero.m4: New files.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * src/gnutls.c (clear_storage): New function.
      (gnutls_symmetric_aead): Use it instead of memset.
      59f69721
  36. 22 Jun, 2017 1 commit
    • Paul Eggert's avatar
      Use unlocked stdio more systematically · f6ef15cf
      Paul Eggert authored
      This can improve performance significantly on stdio-bottlenecked code.
      E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
      * admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
      * lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
      * lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
      * lib-src/profile.c, lib-src/update-game-score.c:
      Include unlocked-io.h instead of stdio.h, since these programs are
      single-threaded.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
      * src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
      * src/lread.c, src/term.c:
      Include sysstdio.h, possibly instead of stdio.h, to define
      the unlocked functions if the system does not provide them.
      * src/charset.c, src/lread.c (getc_unlocked):
      Remove, since sysstdio.h now defines it if needed.
      * src/cm.c (cmputc, cmcheckmagic):
      * src/dispnew.c (update_frame, update_frame_with_menu)
      (update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
      * src/emacs.c (main, Fdump_emacs):
      * src/fileio.c (Fdo_auto_save, Fset_binary_mode):
      * src/image.c (slurp_file, png_read_from_file, png_load_body)
      (our_stdio_fill_input_buffer):
      * src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
      * src/lread.c (readbyte_from_file):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/print.c (printchar_to_stream, strout)
      (Fredirect_debugging_output):
      * src/sysdep.c (reset_sys_modes, procfs_ttyname)
      (procfs_get_total_memory):
      * src/term.c (tty_ring_bell, tty_send_additional_strings)
      (tty_set_terminal_modes, tty_reset_terminal_modes)
      (tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
      (tty_write_glyphs_with_face, tty_insert_glyphs)
      (tty_menu_activate):
      * src/xfaces.c (Fx_load_color_file):
      Use unlocked stdio when it should be safe.
      * src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
      (fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
      (fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
      (putc_unlocked, putchar_unloced): Provide substitutes if not declared.
      f6ef15cf
  37. 17 Jun, 2017 1 commit
    • Philipp Stephani's avatar
      Add command to replace buffer contents · d682f0da
      Philipp Stephani authored
      Add a new command 'replace-buffer-contents' that uses the Myers diff
      algorithm to non-destructively replace the accessible portion of the
      current buffer.  The Myers algorithm is implemented in Gnulib.
      
      * src/editfns.c (Freplace_buffer_contents): New command.
      (set_bit, bit_is_set, buffer_chars_equal): New helper functions.
      (syms_of_editfns): Define new command.
      
      * test/src/editfns-tests.el (replace-buffer-contents-1)
      (replace-buffer-contents-2): New unit tests.
      
      * src/buffer.h (BUF_FETCH_CHAR_AS_MULTIBYTE): New helper macro.
      
      * admin/merge-gnulib (GNULIB_MODULES): Add diffseq.h and minmax.h.
      d682f0da