1. 25 Apr, 2019 3 commits
    • Stephen Leake's avatar
      Add new file completion tables, change project.el to allow using them · d2a5283a
      Stephen Leake authored
      * lisp/file-complete-root-relative.el: New file.
      
      * lisp/uniquify-files.el: New file.
      
      * test/lisp/progmodes/uniquify-files-resources/: New directory
      containing files for testing uniquify-files.
      
      * test/lisp/progmodes/uniquify-files-test.el: New file; test
      uniquify-files.
      
      * lisp/files.el (path-files): New function; useful with new completion
      tables.
      
      * lisp/progmodes/project.el (project-file-completion-table): Use
      file-complete-root-relative completion table.
      (project-find-file): Add optional FILENAME parameter.
      (project--completing-read-strict): Rewrite to just use the given
      completion table; extracting the common directory is now done by
      file-complete-root-relative. This also allows using the new
      uniquify-files completion table.
      
      * lisp/minibuffer.el (completion-category-defaults): Add
      uniquify-file.
      (completing-read-default): Add final step to call completion table
      with 'alist action if supported.
      d2a5283a
    • Stephen Berman's avatar
      Make wdired-mode ignore ls file indicators · 6d8e0fc5
      Stephen Berman authored
      * lisp/wdired.el (wdired--restore-dired-filename-prop): When
      dired-listing-switches includes "F" or "classify", don't treat
      appended indicator characters as part of the file name (bug#34915).
      
      * test/lisp/wdired-tests.el (wdired-test-bug34915): New test.
      6d8e0fc5
    • Michael R. Mauger's avatar
      * lisp/progmodes/sql.el · a1386fa6
      Michael R. Mauger authored
      (sql-is-sqli-buffer-p): New function.
      (sql-generate-unique-sqli-buffer-name): Refactor and use it.
      (sql-product-interactive): Simplify name logic.
      * test/lisp/progmodes/sql-tests.el
      (sql-tests-placeholder-filter-harness): New macro.
      (sql-tests-placeholder-filter-simple)
      (sql-tests-placeholder-filter-ampersand)
      (sql-tests-placeholder-filter-period): Refactored tests and use macro.
      (sql-tests-buffer-naming-harness): New macro.
      (sql-tests-buffer-naming-default)
      (sql-tests-buffer-naming-multiple)
      (sql-tests-buffer-naming-explicit)
      (sql-tests-buffer-naming-universal-argument)
      (sql-tests-buffer-naming-existing): New tests.
      a1386fa6
  2. 24 Apr, 2019 6 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 missing GMP library to test module. · 553220fc
      Philipp Stephani authored
      * test/Makefile.in (GMP_LIB): Define variable.
      ($(test_module)): Use it.
      553220fc
    • Philipp Stephani's avatar
      Clarify rounding mode when converting to struct timespec. · c4bacb12
      Philipp Stephani authored
      * doc/lispref/internals.texi (Module Values): Clarify that the
      truncation is towards negative infinity.
      
      * test/data/emacs-module/mod-test.c (Fmod_test_nanoseconds): Add test
      function.
      (emacs_module_init): Define it.
      
      * test/src/emacs-module-tests.el (mod-test-nanoseconds): New unit test.
      c4bacb12
    • Philipp Stephani's avatar
      Fix return type of make_time. · 534c33cf
      Philipp Stephani authored
      make_time is documented to return a (TICKS . HZ) pair, so we can’t use
      make_lisp_time.  Introduce a new conversion function instead.
      
      * src/emacs-module.c (module_make_time): Use timespec_to_lisp to
      correct return type.
      
      * src/timefns.c (timespec_to_lisp): New function.
      (make_lisp_time): Use it.
      
      * test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid):
      Check return type.
      534c33cf
    • 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. 23 Apr, 2019 1 commit
    • Philipp Stephani's avatar
      Small fix for a JSON unit test. · b59429a4
      Philipp Stephani authored
      * test/src/json-tests.el (json-parse-string/null): Make JSON object
      syntactically valid.  This test is supposed to check whether an
      escaped null character causes an error, but without quoting the string
      it would be syntactically invalid in any case.
      b59429a4
  4. 22 Apr, 2019 1 commit
    • Michael Albinus's avatar
      Some changes in tramp-tests · 02894982
      Michael Albinus authored
      * test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
      Check for backward compatibility.
      (tramp-test33-environment-variables): Apply a better check for
      unset variable.
      02894982
  5. 21 Apr, 2019 1 commit
    • Michael R. Mauger's avatar
      * lisp/progmodes.sql.el · 23d8cfb9
      Michael R. Mauger authored
      (sql-product-alist): Corrected :terminator defns.
      (sql-debug-send): New variable.
      (sql-send-string): Use it and correct buffer context.
      (sql-send-magic-terminator): Use `sql-input-sender'.
      (sql-placeholders-filter): Bug#11481 Don't recursively replace placeholders
      * test/lisp/progmodes/sql-tests.el
      (sql-test-placeholder-filter): Test placeholder functionality.
      23d8cfb9
  6. 20 Apr, 2019 1 commit
  7. 19 Apr, 2019 5 commits
    • Philipp Stephani's avatar
      Make warning about unescaped character literals more helpful. · 0b4b380c
      Philipp Stephani authored
      See Bug#31676.
      
      * lisp/emacs-lisp/byte-run.el
      (byte-run--unescaped-character-literals-warning): New defun.
      
      * src/lread.c (load_warn_unescaped_character_literals): Use new defun.
      (syms_of_lread): Define symbol for new defun.
      
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Use new
      defun.
      
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals):
      test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
      0b4b380c
    • Michael Albinus's avatar
      ; Remove instrumentation in tramp-tests · 0eb47c25
      Michael Albinus authored
      0eb47c25
    • Philipp Stephani's avatar
      Remove :stop key from make-process. · 5c5e3095
      Philipp Stephani authored
      This has never worked and caused issues such as Bug#30460.
      
      * src/process.c (Fmake_process): Don't accept :stop key any more.
      (syms_of_process): Define needed symbol 'null'.
      
      * test/src/process-tests.el (make-process/stop): New unit test.
      
      * doc/lispref/processes.texi (Asynchronous Processes): Remove :stop
      key from manual.
      5c5e3095
    • Michael Albinus's avatar
      Adapt tramp-test32-shell-command · 3ff7d732
      Michael Albinus authored
      * test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
      Check "tput" before running `shell-command-width' test.
      3ff7d732
    • Philipp Stephani's avatar
      Add a new user option 'ido-big-directories'. · f5e3c2cc
      Philipp Stephani authored
      This provides an alternative to 'ido-max-directory-size', for
      directories that are statically known to be too big for Ido
      completion.
      
      * lisp/ido.el (ido-big-directories): New user option.
      (ido-directory-too-big-p): Use it.
      
      * test/lisp/ido-tests.el (ido-directory-too-big-p): New unit test.
      f5e3c2cc
  8. 18 Apr, 2019 2 commits
  9. 17 Apr, 2019 7 commits
  10. 15 Apr, 2019 2 commits
    • Eli Zaretskii's avatar
      Minor change in a comment · 74412e7d
      Eli Zaretskii authored
      * test/src/callproc-tests.el
      (call-process-w32-debug-spawn-error): Minor copyedits of the
      commentary.
      74412e7d
    • Noam Postavsky's avatar
      Let debugger handle process spawn errors on w32 (Bug#33016) · 9800df69
      Noam Postavsky authored
      Since child_setup() is called between block_input()...unblock_input(),
      when an error is signaled the Lisp debugger is prevented from
      starting.  Therefore, let the callers signal the error instead (which
      they already do for non-w32 platforms, just the error message needs an
      update).
      * src/callproc.c (child_setup) [WINDOWSNT]: Don't call
      report_file_error here.
      (call_process) [WINDOWNT]:
      * src/process.c (create_process) [WINDOWSNT]: Call report_file_errno
      here instead, after the unblock_input() call, same as for !WINDOWSNT.
      * src/lisp.h (CHILD_SETUP_ERROR_DESC): New preprocessor define.  Flip
      the containing ifndef DOS_NT branches so that it's ifdef DOS_NT.
      * src/eval.c (when_entered_debugger): Remove.
      (syms_of_eval) <internal-when-entered-debugger>: Define it as a Lisp
      integer variable instead.
      (maybe_call_debugger): Update comment.
      * test/src/process-tests.el (make-process-w32-debug-spawn-error):
      * test/src/callproc-tests.el (call-process-w32-debug-spawn-error): New
      tests.
      9800df69
  11. 14 Apr, 2019 1 commit
  12. 13 Apr, 2019 2 commits
    • Michael Albinus's avatar
      Fix last patch · bfa9e745
      Michael Albinus authored
      bfa9e745
    • Michael Albinus's avatar
      Replace (skip-unless nil) by tag :unstable in test packages · ae21fb3d
      Michael Albinus authored
      * test/lisp/filenotify-tests.el (file-notify--deftest-remote):
      Use tag :unstable if SKIP is non-nil.
      
      * test/lisp/net/tramp-tests.el (tramp-test36-vc-registered):
      Use ert-skip instead of (skip-unless nil).
      
      * test/lisp/progmodes/python-tests.el
      (python-tests--python-nav-end-of-statement--infloop): Use tag
      :unstable instead of (skip-unless nil).
      ae21fb3d
  13. 12 Apr, 2019 2 commits
    • Dmitry Gutov's avatar
      Add :array-type option to json-parse-string · b41c1ca1
      Dmitry Gutov authored
      * src/json.c (enum json_array_type): New type.
      (struct json_configuration): New field array_type.
      (json_parse_args): Rename the last argument.  Handle the
      :array-type keyword argument (bug#32793).
      (Fjson_parse_string): Update the docstring accordingly.
      (json_to_lisp): Handle the case of :array-type being `list'.  Add
      a call to 'rarely_quit' inside the loop.
      (syms_of_json): Define new symbols.
      (Fjson_serialize, Fjson_insert, Fjson_parse_string)
      (Fjson_parse_buffer): Update the config struct initializers.
      b41c1ca1
    • Basil L. Contovounesios's avatar
      Move proper-list-p tests to fns-tests.el · 0c4c96d7
      Basil L. Contovounesios authored
      This follows the move of proper-list-p from lisp/subr.el to
      src/fns.c in 2018-07-24T15:58:46-07:00!eggert@cs.ucla.edu.
      * test/lisp/subr-tests.el (subr-tests--proper-list-p): Move from
      here...
      * test/src/fns-tests.el (test-proper-list-p): ...to here.
      0c4c96d7
  14. 10 Apr, 2019 3 commits
    • Stefan Monnier's avatar
      * test/lisp/progmodes/python-tests.el: "Fix" failing test · 0cef057b
      Stefan Monnier authored
      (python-tests--python-nav-end-of-statement--infloop): Disable.
      0cef057b
    • Jackson Ray Hamilton's avatar
      Add new defcustom js-jsx-align->-with-< · f2901072
      Jackson Ray Hamilton authored
      * lisp/progmodes/js.el (js-jsx-align->-with-<): New variable for users
      to control one opinionated aspect of JSX indentation.  It defaults to
      the style seen in the React docs, which many users expected as the
      “correct” indentation.  Still, the old SGML-style of indentation could
      be desirable too, especially since it was the old default.  This
      ensures users have a way of getting back the old behavior.
      (js-jsx--contextual-indentation): Respect js-jsx-align->-with-<.
      
      * test/manual/indent/jsx-align-gt-with-lt.jsx: New test for
      js-jsx-align->-with-<.
      f2901072
    • Jackson Ray Hamilton's avatar
      Add new defcustom js-jsx-indent-level · 5772971f
      Jackson Ray Hamilton authored
      * lisp/progmodes/js.el (js-jsx-indent-level): New variable for users
      to set JSX indentation differently than JS, like before.
      (js-jsx--contextual-indentation): Respect js-jsx-indent-level when
      it’s set.
      
      * test/manual/indent/jsx-indent-level.jsx: New test for
      js-jsx-indent-level.
      5772971f
  15. 09 Apr, 2019 3 commits
    • Jackson Ray Hamilton's avatar
      Permit non-ASCII identifiers in JS · 18bbfc4c
      Jackson Ray Hamilton authored
      * lisp/progmodes/js.el (js--name-start-re): Generally allow
      identifiers to begin with non-ASCII letters.  This is of particular
      importance to JSX parsing.
      
      * test/manual/indent/jsx-unclosed-2.jsx: Add test to ensure non-ASCII
      characters are parsed properly.
      18bbfc4c
    • Jackson Ray Hamilton's avatar
      Improve whitespace and unary keyword parsing · 7a9dac5c
      Jackson Ray Hamilton authored
      * lisp/progmodes/js.el (js--name-start-chars): Remove, adding these
      chars back to js--name-start-re.
      (js--name-start-re): Add chars back from js--name-start-chars.
      
      (js-jsx--tag-start-re): Improve regexp to capture the tag name (so it
      can be disambiguated from a unary keyword), to match newlines (which
      are common in this spot), and to require at least one whitespace
      character before the attribute name.
      
      (js-jsx--matched-tag-type): Ensure the “tag name” isn’t possibly a
      unary keyword.
      
      (js-jsx--self-closing-re, js-jsx--matching-close-tag-pos): Allow
      whitespace around “<” and “>”.
      
      * test/manual/indent/jsx-unclosed-2.jsx: Add tests for unary keyword
      and whitespace parsing.
      7a9dac5c
    • Jackson Ray Hamilton's avatar
      Optimize js-jsx--matching-close-tag-pos · 7b2e3c60
      Jackson Ray Hamilton authored
      This function’s performance was having a noticeable impact when
      editing large JSX structures.  Improve its performance
      slightly (elapsed time will be cut in half according to ELP).
      
      * lisp/progmodes/js.el (js-jsx--tag-re): Remove.
      (js-jsx--matched-tag-type): Simplify implementation with respect to
      the new implementation of js-jsx--matching-close-tag-pos.
      (js-jsx--self-closing-re): Simplify regexp slightly in sync with a
      generally simpler matching algorithm.
      (js-jsx--matching-close-tag-pos): Optimize matching algorithm by using
      multiple simple regexp searches, rather than one big complex search.
      
      * test/manual/indent/jsx-unclosed-2.jsx: Use the term “inequality” and
      add a test for a possible parsing foible.
      7b2e3c60