1. 05 Jun, 2017 15 commits
    • Andy Moreton's avatar
      Fix check for package-unsigned-archives during retrieval · f858c585
      Andy Moreton authored
      * lisp/emacs-lisp/package.el (package--download-one-archive):
      Fix check for package-unsigned-archives.
    • Noah Friedman's avatar
    • Philipp Stephani's avatar
      Fix undefined behavior in mapbacktrace · 3d9d976a
      Philipp Stephani authored
      * src/eval.c (Fmapbacktrace): Don't assume that PDL is still valid.
    • Eli Zaretskii's avatar
      Fix emacs-module-tests on MS-Windows · 9ae5c0a2
      Eli Zaretskii authored
      * src/print.c (print_vectorlike): Make sure module function's
      address prints with a leading "0x".  This fixes emacs-module-tests
      on MS-Windows.  Fix whitespace.
      * src/dynlib.c (dynlib_addr): Remove unused variable.  Update
    • Philipp Stephani's avatar
      Use unwind protection to clean up data structures in modules · 5d29c0f0
      Philipp Stephani authored
      Reuse existing functionality and simplify the code a bit.
      * src/emacs-module.c (Fmodule_load): Use unwind protection to clean up
      runtime object.
      (funcall_module): Use unwind protection to clean up environment
      (finalize_environment): Simplify signature.
      (finalize_environment_unwind, finalize_runtime_unwind): New functions.
    • Michael Albinus's avatar
    • Michael Albinus's avatar
      Some minor tweaks in tramp-tests.el · 751d5920
      Michael Albinus authored
      * test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name-relative):
      Let it pass for all gfvs based methods.
      (tramp-test24-file-name-completion): Run method and host
      completion for all syntaxes only when expensive tests are enabled.
      Do not check host completion for gvfs based methods.
      (tramp--test-gvfs-p): Add optional METHOD argument.
      (tramp--test-afp-or-smb-p): Remove.
    • Michael Albinus's avatar
      Fix error in Tramp rsync method · 792de924
      Michael Albinus authored
      * lisp/net/tramp-sh.el (tramp-methods) <rsync>: Add "-c" argument.
      Otherwise, `tramp-test10-write-region' could fail.
    • Philipp Stephani's avatar
      Inline module_has_cleanup · 13e9493e
      Philipp Stephani authored
      This constant is only used once, and we fail compilation anyway if
      it's false.
      * src/emacs-module.c (MODULE_SETJMP_1): Inline __has_attribute.
    • Philipp Stephani's avatar
    • Paul Eggert's avatar
      Omit space that broke ‘make check’ · 646b74e5
      Paul Eggert authored
      * src/print.c (print_vectorlike): Omit stray space.
    • Paul Eggert's avatar
      Remove easserts etc. from emacs-module.c · 6e4abc9d
      Paul Eggert authored
      Most of these seem to run afoul of the comment "Do NOT use
      'eassert' for checking validity of user code in the module."
      * src/emacs-module.c (MODULE_FUNCTION_BEGIN_NO_CATCH)
      (module_non_local_exit_check, module_non_local_exit_clear)
      (module_non_local_exit_get, module_non_local_exit_signal)
      (module_non_local_exit_throw, module_make_string):
      Remove unnecessary easserts that pointers are nonnull.
      Hardware checks this for us nowadays, and the checks
      just clutter up the code.
      (module_extract_integer): Remove unnecessary verify that
      a C signed integer is in the range INTMAX_MIN..INTMAX_MAX.
      The C standard guarantees this.
      (module_copy_string_contents): Remove unnecessary eassert
      that Lisp strings are null-terminated.
      (module_function_arity): Remove unnecessary easserts that
      function arities are in range.
    • Paul Eggert's avatar
      Remove unnecessary checking in emacs-module.c · 620d6537
      Paul Eggert authored
      * src/emacs-module.c (module_copy_string_contents):
      Remove checking, as string lengths are always nonnegative and less
      than STRING_BYTES_BOUND, and this is checked elsewhere.
      (module_make_string): Check length against STRING_BYTES_BOUND, a
      tighter bound than MOST_POSITIVE_FIXNUM.  (funcall_module): Don't
      assume that an out-of-range integer is nonnegative.
    • Paul Eggert's avatar
      SCHARS and STRING_BYTES are nonnegative · cef90102
      Paul Eggert authored
      Tell the compiler that SCHARS and STRING_BYTES are nonnegative, in
      the hopes that this will optimize a bit better.  Also, check this
      at runtime if ENABLE_CHECKING.
      * src/lisp.h (SCHARS, STRING_BYTES):
      eassume that these functions return nonnegative values.
      eassert that newsize is nonnegative.
    • Noam Postavsky's avatar
  2. 04 Jun, 2017 18 commits
    • Philipp Stephani's avatar
      Remove an unused error symbol · 2aa8b156
      Philipp Stephani authored
      * src/emacs-module.c (syms_of_module): Remove unused error symbol
    • Philipp Stephani's avatar
      Support quitting in modules · 66da3f4a
      Philipp Stephani authored
      The idea is that modules should call env->should_quit from time to
      time and return as quickly as possible if it returns true.
      * src/emacs-module.c (module_should_quit): New module function.
      (initialize_environment): Use it.
      (funcall_module): Process potential pending quit.
      * src/eval.c (maybe_quit): Add reference to module_should_quit.
    • Philipp Stephani's avatar
      Use more specific errors for module load failure · d3720172
      Philipp Stephani authored
      * src/emacs-module.c (syms_of_module): Add more specific error
      (Fmodule_load): Use them.
    • Philipp Stephani's avatar
      Remove an unneeded assertion · 27445a82
      Philipp Stephani authored
      * src/emacs-module.c (module_copy_string_contents): Remove unneeded
      assertion.  If this assertion triggers, we raise an error anyway.
    • Philipp Stephani's avatar
      Guard against signed integer overflows · a8a93b11
      Philipp Stephani authored
      * src/emacs-module.c (module_extract_integer)
      (module_copy_string_contents, module_make_string): Guard against
      signed integer overflows.
    • Philipp Stephani's avatar
      Add a couple more assertions to the module code · 54970624
      Philipp Stephani authored
      These can help module authors debug crashes.
      * emacs-module.c (module_non_local_exit_check)
      (module_non_local_exit_clear, module_non_local_exit_get)
      (module_non_local_exit_signal, module_non_local_exit_throw)
      (module_copy_string_contents, module_make_string)
      (funcall_module, initialize_environment): Add assertions
    • Philipp Stephani's avatar
      ; Grammar fix · fb3a9fd3
      Philipp Stephani authored
    • Philipp Stephani's avatar
      ; Small comment fix · 034275eb
      Philipp Stephani authored
      * emacs-module.c (MODULE_FUNCTION_BEGIN): Don't say that the error
      value should be a sentinel value, because in almost all cases it
    • Philipp Stephani's avatar
      Use ATTRIBUTE_MAY_ALIAS where alias violations are likely · 9be8b2bf
      Philipp Stephani authored
      In particular, alias violations are likely for the return values of
      dlsym(3), which get cast around arbitrarily.
      * src/emacs-module.c (Fmodule_load): Use ATTRIBUTE_MAY_ALIAS.
    • Philipp Stephani's avatar
      Simplify interface of dynlib_attr. · 366e25a6
      Philipp Stephani authored
      Instead of returning bool, set the argument pointers to NULL if the
      information is not available.
      * src/dynlib.c (dynlib_addr): Don't return bool.
    • Philipp Stephani's avatar
      Rationalize environment lifetime management functions · 045d21c2
      Philipp Stephani authored
      * src/emacs-module.c (Fmodule_load, funcall_module): Adapt callers.
      (finalize_environment): Add parameter for public part of the
      environment, like 'initialize_environment'.  Add assertions.
    • Philipp Stephani's avatar
      Rework printing of module functions · 3b0080de
      Philipp Stephani authored
      Fix a FIXME in emacs-module.c.  Put the printing into print.c, like
      other types.
      * src/print.c (print_vectorlike): Add code to print module functions.
      * src/emacs-module.c (funcall_module): Stop calling
      'module_format_fun_env'.  Now that module functions are first-class
      objects, they can be added to signal data directly.
      (module_handle_signal): Remove now-unused function
      * test/src/emacs-module-tests.el (mod-test-sum-test): Adapt unit test.
      * src/eval.c (funcall_lambda): Adapt call to changed signature of
    • Philipp Stephani's avatar
      Define helper macro to reduce code duplication · 18396997
      Philipp Stephani authored
      * src/emacs-module.c (MODULE_FUNCTION_BEGIN_NO_CATCH): New helper
      (MODULE_FUNCTION_BEGIN, module_type_of, module_is_not_nil, module_eq):
      Use it.
    • Philipp Stephani's avatar
      Remove two FIXMEs that can't be fixed · db743842
      Philipp Stephani authored
    • Eli Zaretskii's avatar
      Avoid slow startup in daemon mode when global-linum-mode is on · bd3c6eec
      Eli Zaretskii authored
      * lisp/linum.el (linum-on): Don't turn on linum-mode in a
      non-client frame of a daemon session.  (Bug#27210)
    • Paul Eggert's avatar
      Fix eldoc bug with curved quote · 7dd9e7e9
      Paul Eggert authored
      * lisp/progmodes/elisp-mode.el (elisp-get-fnsym-args-string):
      Substitute quotes in documentation before returning it (Bug#27159).
    • Paul Eggert's avatar
      Tune ‘format’ after recent fix · d5fcf9e4
      Paul Eggert authored
      * doc/lispref/strings.texi (Formatting Strings):
      * src/editfns.c (Fformat): Format field numbers no longer need
      to be unique, reverting the previous doc change since that has
      now been fixed.  Also, document that %% should not have modifiers.
      * src/editfns.c (styled_format): Improve performance.  Remove
      the need for the new prepass over the format string, by using
      a typically-more-generous bound for the info array size.
      Initialize the info array lazily.  Move string inspection to
      the same area to help caching.  Avoid the need for a
      converted_to_string bitfield by using EQ.  Cache arg in a
      local and avoid some potential aliasing issues to help the
      compiler.  Info array is now 0-origin, not 1-origin.
    • Nikolay Kudryavtsev's avatar
      Improve of file-local-name use in vc-git-checkin · 6ad42aec
      Nikolay Kudryavtsev authored
      * lisp/vc/vc-git.el (vc-git-checkin): Use file-local-name only
      when calling git commit.
  3. 03 Jun, 2017 7 commits