1. 28 Apr, 2019 1 commit
    • Philipp Stephani's avatar
      Export major version of latest Emacs supported by emacs-module.h. · 4d97e1a9
      Philipp Stephani authored
      This is useful if module authors want to support multiple versions of
      emacs-module.h.
      
      * configure.ac (emacs_major_version): Define substitution.
      
      * src/emacs-module.h.in (EMACS_MAJOR_VERSION): Define macro.
      
      * doc/lispref/internals.texi (Module Initialization): Document
      EMACS_MAJOR_VERSION preprocessor macro.
      
      * test/data/emacs-module/mod-test.c (emacs_module_init): Verify
      behavior of EMACS_MAJOR_VERSION.
      4d97e1a9
  2. 24 Apr, 2019 3 commits
    • Philipp Stephani's avatar
      Unbreak build when building without GMP support. · 4eb7f9ef
      Philipp Stephani authored
      Add support for a new preprocessor macro EMACS_MODULE_HAVE_MPZ_T to
      emacs-module.h.  If this macro is defined, assume that mpz_t is
      already defined and don’t include gmp.h.
      
      Don’t document the new macro for now, as it’s unclear whether we want
      to support this in modules outside the Emacs tree.
      
      * src/emacs-module.h.in: Allow user to prevent inclusion of gmp.h.
      
      * src/emacs-module.c: Use mini-gmp if GMP is unavailable.  Don’t
      include gmp.h.
      
      * src/lisp.h: Don’t require gmp.h.  It’s not needed for lisp.h.
      
      * test/Makefile.in (GMP_LIB, GMP_OBJ): New variables.
      ($(test_module)): Use them.
      
      * test/data/emacs-module/mod-test.c: Use mini-gmp if GMP is unavailable.
      4eb7f9ef
    • Philipp Stephani's avatar
      Add module functions to convert from and to big integers. · e290a7d1
      Philipp Stephani authored
      * src/module-env-27.h: Add new module functions to convert big
      integers.
      
      * src/emacs-module.h.in (emacs_mpz): Define if GMP is available.
      
      * src/emacs-module.c (module_extract_big_integer)
      (module_make_big_integer): New functions.
      (initialize_environment): Use them.
      
      * test/data/emacs-module/mod-test.c (Fmod_test_double): New test
      function.
      (emacs_module_init): Define it.
      
      * test/src/emacs-module-tests.el (mod-test-double): New unit test.
      
      * doc/lispref/internals.texi (Module Values): Document new functions.
      e290a7d1
    • Philipp Stephani's avatar
      Add conversions to and from struct timespec to module interface. · bffceab6
      Philipp Stephani authored
      Time values are a fundamental data type, and such conversions are hard
      to implement within modules because of the various forms of time
      values in Emacs Lisp.  Adding dedicated conversion functions can
      significantly simplify module code dealing with times.
      
      This approach uses nanosecond precision.  While Emacs in theory has
      support for higher-precision time values, in practice most languages
      and standards, such as POSIX, C, Java, and Go, have settled on
      nanosecond-precision integers to represent time.
      
      * src/emacs-module.h.in: Add header for struct timespec.
      
      * src/module-env-27.h: Add module functions for time conversion.
      
      * src/emacs-module.c (module_extract_time, module_make_time): New
      functions.
      (initialize_environment): Use them.
      
      * test/data/emacs-module/mod-test.c (Fmod_test_add_nanosecond): New
      test function.
      (emacs_module_init): Define it.
      
      * test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid)
      (mod-test-add-nanosecond/nil, mod-test-add-nanosecond/invalid): New
      unit tests.
      
      * doc/lispref/internals.texi (Module Values): Document time
      conversion functions.
      bffceab6
  3. 24 Feb, 2019 1 commit
    • Philipp Stephani's avatar
      Ignore pending_signals when checking for quits. · 72ec233f
      Philipp Stephani authored
      pending_signals is often set if no quit is pending.  This results in
      bugs in module code if the module returns but no quit is actually
      pending.
      
      As a better alternative, add a new process_input environment function
      for Emacs 27.  That function processes signals (like maybe_quit).
      
      * configure.ac: Add module snippet for Emacs 27.
      
      * src/module-env-27.h: New file.
      
      * src/emacs-module.h.in: Add process_input function to environment
      interface.
      
      * src/emacs-module.c (module_should_quit): Use QUITP macro to check
      whether the caller should quit.
      (module_process_input): New function.
      (initialize_environment): Use it.
      
      * src/eval.c: Remove obsolete comment.
      
      * test/data/emacs-module/mod-test.c (signal_wrong_type_argument)
      (signal_errno): New helper functions.
      (Fmod_test_sleep_until): New test module function.
      
      * test/src/emacs-module-tests.el (mod-test-sleep-until): New unit
      test.
      
      * doc/lispref/internals.texi (Module Misc): Document process_input.
      72ec233f
  4. 01 Jan, 2019 1 commit
  5. 01 Jan, 2018 1 commit
  6. 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
  7. 01 Jul, 2017 2 commits
  8. 17 Jun, 2017 1 commit