1. 13 Sep, 2017 3 commits
    • Paul Eggert's avatar
      Prefer HTTPS to HTTP for gnu.org · 5da53a01
      Paul Eggert authored
      This patch just changes code files; a followup companion patch
      (much larger) will affect the commentary.  This part is
      separated out to make it easier to review.
      * .dir-locals.el (change-log-mode):
      * lisp/org/org-info.el (org-info-other-documents)
      (org-info-map-html-url):
      * lisp/org/ox-html.el (org-html-creator-string):
      * lisp/startup.el (fancy-startup-text, fancy-about-text)
      (fancy-splash-head):
      * test/lisp/ffap-tests.el (ffap-other-window--bug-25352):
      * test/lisp/thingatpt-tests.el (thing-at-point-test-data):
      Use HTTPS instead of HTTP.
      5da53a01
    • Simen Heggestøyl's avatar
      Add tests for color.el · e7d6c622
      Simen Heggestøyl authored
      * lisp/color.el (color-name-to-rgb, color-complement): Clarify in
      docstrings that RGB triplets should use four digits per component.
      (color-rgb-to-hsl): Break line to avoid "Hidden behind deeper element"
      warning.
      
      * test/lisp/color-tests.el: New file.
      e7d6c622
    • Michael Albinus's avatar
      Improve backward compatibility of tramp-tests · 4ab44f75
      Michael Albinus authored
      * test/lisp/net/tramp-tests.el (seq): Don't require.
      (tramp--test-emacs26-p): New defun.
      (tramp-test10-write-region, tramp-test11-copy-file)
      (tramp-test12-rename-file, tramp-test15-copy-directory)
      (tramp-test21-file-links): Use it.
      (tramp-test16-file-expand-wildcards): Use `copy-sequence'.
      4ab44f75
  2. 12 Sep, 2017 3 commits
    • Eric Abrahamsen's avatar
      Allow write-contents-functions to short-circuit buffer save · 9b980e26
      Eric Abrahamsen authored
      Bug#28412
      
      * lisp/files.el (basic-save-buffer): Re-arrange function so that
        write-contents-functions are run earlier. If they return non-nil,
        consider the buffer saved without requiring the buffer to be
        visiting a file.
        (save-some-buffers): This function should consider any buffer with a
        buffer-local value for write-contents-functions eligible for
        saving.
      * test/lisp/files-tests.el (files-test-no-file-write-contents): New
        test.
      * doc/lispref/files.texi (Saving Buffers): Mention in docs.
      * etc/NEWS: And in NEWS.
      9b980e26
    • Mark Oteiza's avatar
      Implement and-let* · 4612b2a2
      Mark Oteiza authored
      This also includes changes to if-let and when-let.  The single tuple
      special case is ambiguous, and binding a symbol to nil is not as
      useful as binding it to its value outside the lexical scope of the
      binding.  (Bug#28254)
      * etc/NEWS: Mention.
      * lisp/emacs-lisp/subr-x.el (internal--listify):
      (internal--build-binding-value-form): Extend to account for
      solitary symbols and (EXPR) items in binding varlist.
      (if-let*, when-let*): Nix single tuple case and incumbent
      bind-symbol-to-nil behavior.
      (and-let*): New macro.
      (if-let, when-let): Mark obsolete.  Redefine in terms of if-let*, so
      they implicitly gain the new features without breaking existing code.
      * test/lisp/emacs-lisp/subr-x-tests.el: Adjust tests for: lack of
      single-tuple special case, lack of binding solitary symbols to nil,
      and the introduction of uninterned symbols for (EXPR) bindings.  Add
      SRFI-2 test suite adapted to Elisp.
      4612b2a2
    • Michael Albinus's avatar
      Extend tramp-tests according to bug#27986 · 49a42fbd
      Michael Albinus authored
      * test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
      (tramp-test12-rename-file, tramp-test15-copy-directory)
      (tramp-test21-file-links): Extend tests.
      (tramp-test13-make-directory, tramp-test14-delete-directory):
      Specifiy error symbol in `should-error'.
      49a42fbd
  3. 11 Sep, 2017 3 commits
    • Michael Albinus's avatar
      Further optimization in Tramp's file name decomposition · 70045452
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-syntax): Recompute all file name
      components.  Call `custom-set-variables' after loading.
      (tramp-build-prefix-format, tramp-build-prefix-regexp)
      (tramp-build-method-regexp)
      (tramp-build-postfix-method-format)
      (tramp-build-postfix-method-regexp)
      (tramp-build-prefix-ipv6-format)
      (tramp-build-prefix-ipv6-regexp)
      (tramp-build-postfix-ipv6-format)
      (tramp-build-postfix-ipv6-regexp)
      (tramp-build-postfix-host-format)
      (tramp-build-postfix-host-regexp)
      (tramp-build-file-name-regexp)
      (tramp-build-completion-file-name-regexp): New defuns.
      (tramp-prefix-format, tramp-prefix-regexp)
      (tramp-method-regexp, tramp-postfix-method-format)
      (tramp-postfix-method-regexp, tramp-prefix-ipv6-format)
      (tramp-prefix-ipv6-regexp, tramp-postfix-ipv6-format)
      (tramp-postfix-ipv6-regexp, tramp-postfix-host-format)
      (tramp-postfix-host-regexp)
      (tramp-remote-file-name-spec-regexp)
      (tramp-file-name-structure, tramp-file-name-regexp)
      (tramp-completion-file-name-regexp): Convert defuns into defvars.
      (tramp-prefix-regexp-alist)
      (tramp-postfix-method-regexp-alist)
      (tramp-prefix-ipv6-regexp-alist)
      (tramp-postfix-ipv6-regexp-alist)
      (tramp-postfix-host-regexp-alist)
      (tramp-remote-file-name-spec-regexp-alist): Remove.
      (tramp-build-remote-file-name-spec-regexp)
      (tramp-build-file-name-structure): Simplify.
      (tramp-completion-file-name-regexp-alist): New defconst.
      (tramp-tramp-file-p, tramp-dissect-file-name)
      (tramp-make-tramp-file-name)
      (tramp-completion-make-tramp-file-name)
      (tramp-rfn-eshadow-update-overlay-regexp)
      (tramp-register-file-name-handlers)
      (tramp-completion-handle-file-name-all-completions)
      (tramp-completion-dissect-file-name, tramp-clear-passwd):
      * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler):
      * lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered)
      (tramp-compute-multi-hops): Use variables but functions for
      file name components.
      
      * test/lisp/net/tramp-tests.el (tramp-test24-file-name-completion):
      Use variables but functions for file name components.
      70045452
    • Paul Eggert's avatar
      Port tramp-tests to new copy-directory behavior · 29963648
      Paul Eggert authored
      * test/lisp/net/tramp-tests.el (tramp-test15-copy-directory):
      Use directory name as arg for copy-directory when we want
      the special behavior.
      29963648
    • Paul Eggert's avatar
      Fix some make-directory bugs · cf9891e1
      Paul Eggert authored
      * lisp/files.el (files--ensure-directory): New function.
      (make-directory): Use it to avoid bugs when (make-directory FOO t)
      is invoked on a non-directory, or on a directory hierarchy that
      is being built by some other process while Emacs is running.
      * test/lisp/files-tests.el (files-tests--make-directory): New test.
      cf9891e1
  4. 10 Sep, 2017 3 commits
    • Paul Eggert's avatar
      Fix race with rename-file etc. with dir NEWNAME · 01c885f2
      Paul Eggert authored
      This changes the behavior of rename-file etc. slightly.
      The old behavior mostly disagreed with the documentation, and had
      a race condition bug that could allow attackers to modify victims'
      write-protected directories (Bug#27986).
      * doc/lispref/files.texi (Changing Files): Document that in
      rename-file etc., NEWFILE is special if it is a directory name.
      * etc/NEWS: Document the change in behavior.
      * src/fileio.c (directory_like): Remove.  All uses removed.
      (expand_cp_target): Test only whether NEWNAME is a directory name,
      not whether it is currently a directory.  This avoids a race.
      (Fcopy_file, Frename_file, Fadd_name_to_file, Fmake_symbolic_link):
      Document behavior if NEWNAME is a directory name.
      (Frename_file): Simplify now that the destdir behavior occurs
      only when NEWNAME is a directory name.
      * test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
      (tramp-test12-rename-file, tramp--test-check-files):
      Adjust tests to match new behavior.
      01c885f2
    • Paul Eggert's avatar
      Spelling fixes · cdef84fb
      Paul Eggert authored
      * lisp/progmodes/cc-langs.el:
      (c-ambiguous-overloadable-or-identifier-prefixes): Rename from
      c-ambiguous-overloadable-or-identifier-prefices.  Caller changed.
      cdef84fb
    • Mark Oteiza's avatar
      Avoid looking at localized strings · e7165389
      Mark Oteiza authored
      * lisp/xdg.el (xdg-desktop-read-group): Add condition to catch
      localized strings.
      * test/lisp/xdg-tests.el (xdg-desktop-parsing): Add test to ensure
      parsing l10n strings doesn't error but is essentially a no-op.
      e7165389
  5. 09 Sep, 2017 2 commits
    • Mark Oteiza's avatar
      Add function to read all entries in a group · 4131f978
      Mark Oteiza authored
      Use that to extend xdg-desktop-read-file.  Also fix a bug where all
      entries in all groups were read and returned by xdg-desktop-read-file.
      * lisp/xdg.el (xdg-desktop-read-group): New function.
      (xdg-desktop-read-file): Use it.
      * test/data/xdg/malformed.desktop: New file.
      * test/data/xdg/test.desktop: Add another section.
      * test/lisp/xdg-tests.el (xdg-desktop-parsing): Test presence of a key
      in another group.  Test reading a prescribed group.  Test detecting a
      malformed key=value.
      4131f978
    • Mark Oteiza's avatar
      ; Fix previous commit · be9bc8e6
      Mark Oteiza authored
      See https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00101.html
      * test/lisp/xdg.el: Remove match data tests.
      * lisp/xdg.el (xdg-user-dir): Fix docstring. Remove save-match-data.
      (xdg-desktop-read-file, xdg-desktop-strings): Remove save-match-data.
      be9bc8e6
  6. 08 Sep, 2017 2 commits
    • Eli Zaretskii's avatar
      Fix 'directory-file-name' on DOS_NT systems as well · e2a10d7f
      Eli Zaretskii authored
      * src/fileio.c (directory_file_name) [DOS_NT]: Fix the DOS_NT case
      to be consistent with last change.
      
      * test/src/fileio-tests.el (fileio-tests--odd-symlink-chars):
      Disable on MS-Windows.
      (fileio-tests--directory-file-name-dos-nt)
      (fileio-tests--file-name-as-directory-dos-nt): New tests.
      e2a10d7f
    • Paul Eggert's avatar
      Fix bug: (directory-file-name "///") returned "//" · aedc566a
      Paul Eggert authored
      * src/fileio.c (directory_file_name): For "///" and longer,
      return "/", not "//", as per POSIX.
      * test/src/fileio-tests.el (fileio-tests--directory-file-name)
      (fileio-tests--file-name-as-directory): New tests.
      aedc566a
  7. 07 Sep, 2017 1 commit
    • Glenn Morris's avatar
      Skip emacsclient tests if --enable-profiling was used · a0e3f715
      Glenn Morris authored
      * test/lib-src/emacsclient-tests.el
      (emacsclient-test-call-emacsclient): Make it a macro.
      Handle "Profiling timer expired" return from emacsclient.  (Bug#28319)
      (emacsclient-test-alternate-editor-allows-arguments)
      (emacsclient-test-alternate-editor-allows-quotes): Update for above.
      a0e3f715
  8. 06 Sep, 2017 2 commits
    • Mark Oteiza's avatar
      Add XDG desktop file parsing and tests · 9604f9cd
      Mark Oteiza authored
      * lisp/xdg.el: Add support for Desktop Entry Specification.
      (xdg--user-dirs-parse-line): Check if file is readable.
      (xdg-desktop-group-regexp, xdg-desktop-entry-regexp): New variables.
      (xdg--desktop-parse-line, xdg-desktop-read-file, xdg-desktop-strings):
      New functions.
      * test/lisp/xdg-tests.el:
      * test/data/xdg/test.desktop:
      * test/data/xdg/wrong.desktop: New files.
      9604f9cd
    • Glenn Morris's avatar
      Allow for adjusting line length of test backtraces · d48f3005
      Glenn Morris authored
      * test/Makefile.in (TEST_BACKTRACE_LINE_LENGTH): New option.
      (%.log): Respect backtrace line length.
      d48f3005
  9. 05 Sep, 2017 5 commits
  10. 04 Sep, 2017 2 commits
    • Glenn Morris's avatar
      emacsclient-tests: add some debug statements · 514e147d
      Glenn Morris authored
      * test/lib-src/emacsclient-tests.el
      (emacsclient-test-call-emacsclient): Add debug statements.
      514e147d
    • Michael Albinus's avatar
      Work on Tramp's (symbolic) links · 8a65d7a7
      Michael Albinus authored
      * doc/misc/tramp.texi (Traces and Profiles): Mention the
      backtrace when tramp-verbose is greater than or equal to 10.
      
      * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
      Use `tramp-handle-add-name-to-file'.
      
      * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use
      `tramp-handle-add-name-to-file' and `tramp-handle-file-truename'.
      
      * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link): Improve.
      
      * lisp/net/tramp-smb.el (tramp-smb-errors):
      Add "NT_STATUS_CONNECTION_DISCONNECTED" and
      "NT_STATUS_OBJECT_PATH_SYNTAX_BAD".
      (tramp-smb-file-name-handler-alist): Use `tramp-handle-file-truename'.
      (tramp-smb-do-file-attributes-with-stat): Return non-nil only
      if one of the attributes is non-nil.
      (tramp-smb-handle-file-local-copy): Use `file-truename'.
      (tramp-smb-handle-file-truename): Move to tramp.el.
      (tramp-smb-handle-insert-directory): Show symlinks.
      (tramp-smb-handle-make-symbolic-link): Improve.
      (tramp-smb-read-file-entry): Handle extended file modes in Samba.
      
      * lisp/net/tramp.el (tramp-handle-add-name-to-file)
      (tramp-handle-file-truename): New defuns.
      
      * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Extend test.
      (tramp--test-check-files): Make check for "smb".
      8a65d7a7
  11. 03 Sep, 2017 1 commit
  12. 02 Sep, 2017 1 commit
    • Philipp Stephani's avatar
      Improve error messages for improper plists (Bug#27726) · 71766a45
      Philipp Stephani authored
      * src/fns.c (Fplist_put, Flax_plist_get, Flax_plist_put)
      (Fplist_member, syms_of_fns): Use ‘plistp’ as pseudo-predicate for
      improper plists instead of ‘listp.’
      
      * test/src/fns-tests.el (plist-get/odd-number-of-elements)
      (lax-plist-get/odd-number-of-elements)
      (plist-put/odd-number-of-elements)
      (lax-plist-put/odd-number-of-elements)
      (plist-member/improper-list): Add unit tests.
      71766a45
  13. 01 Sep, 2017 5 commits
  14. 31 Aug, 2017 1 commit
    • Samuel Freilich's avatar
      Do not split line before width of fill-prefix · cda26e64
      Samuel Freilich authored
      When auto-filling a paragraph, don't split a line before the width of the
      fill-prefix, creating a subsequent line that is as long or longer (Bug#20774).
      * lisp/simple.el (do-auto-fill): Only consider break-points that are later in
      the line than the width of the fill-prefix.  This is a more general solution
      than the previous logic, which only skipped over the exact fill-prefix.  The
      fill-prefix doesn't necessarily match the prefix of the first line of a
      paragraph in adaptive-fill-mode.
      cda26e64
  15. 30 Aug, 2017 2 commits
    • Reuben Thomas's avatar
      Add support for arguments in emacsclient's ALTERNATE_EDITOR (Bug #25082) · 98f01a13
      Reuben Thomas authored
      * lib-src/emacsclient.c (fail): Parse ALTERNATE_EDITOR, or
      corresponding command-line argument, into quote- or space-separated
      tokens.  If a token starts with a quote, then it naturally is expected
      to end with a quote; escaping is not supported. This is enough to cope
      with the typical case of requiring the initial path to be quoted,
      common on Windows where it may contain spaces.
      * etc/NEWS: Document.
      * doc/emacs/misc.texi: Likewise.
      * doc/man/emacsclient.1: Tweak to remove the implication that only an
      editor can be specified (the manual already mentions a “command”).
      Fix a small error where “EDITOR” is referred to rather than
      “ALTERNATE_EDITOR”.
      * test/lib-src/emacsclient-tests.el: Add tests.
      98f01a13
    • Michael Albinus's avatar
      Improve symlinks for Tramp · 9376ea3f
      Michael Albinus authored
      * lisp/files.el (files--splice-dirname-file): Quote whole file.
      
      * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link):
      Do not expand TARGET, it could be remote.
      (tramp-sh-handle-file-truename): Check for cyclic symlink also
      in case of readlink.  Quote result if it looks remote.
      (tramp-sh-handle-file-local-copy): Use `file-truename'.
      
      * test/lisp/net/tramp-tests.el (tramp-test08-file-local-copy)
      (tramp-test09-insert-file-contents): Test also file missing.
      (tramp-test21-file-links): Extend test.
      9376ea3f
  16. 28 Aug, 2017 1 commit
    • Michael Albinus's avatar
      Further fixes in tramp-smb.el · 3a19e6ec
      Michael Albinus authored
      * lisp/net/tramp-smb.el (tramp-smb-handle-file-truename): New defun.
      (tramp-smb-file-name-handler-alist): Use it.
      (tramp-smb-handle-make-symbolic-link): Unquote target.
      
      * test/lisp/net/tramp-tests.el
      (tramp--test-ignore-make-symbolic-link-error): New defmacro.
      (tramp-test18-file-attributes, tramp-test21-file-links)
      (tramp--test-check-files): Use it.
      3a19e6ec
  17. 27 Aug, 2017 3 commits
    • Tom Tromey's avatar
      Fix auto-fill bug in js-mode · 9e79a31c
      Tom Tromey authored
      * lisp/progmodes/js.el (js-do-auto-fill): New function.
      (js-mode): Set normal-auto-fill-function.
      * test/lisp/progmodes/js-tests.el (js-mode-fill-comment-bug): New
      test.
      9e79a31c
    • Michael Albinus's avatar
      Tramp cleanup · 79cc9445
      Michael Albinus authored
      * lisp/net/tramp-sh.el (tramp-sh-extra-args): Remove compat code.
      (tramp-sh-handle-make-symbolic-link): More robust check for
      TARGET remoteness.
      
      * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory):
      Disable copying by tar temporarily, it doesn't work reliably.
      (tramp-smb-do-file-attributes-with-stat): Resolve symlink.
      (tramp-smb-handle-make-symbolic-link): Fix implementation.
      
      * lisp/net/tramp.el (tramp-handle-file-symlink-p): Simplify.
      
      * test/lisp/net/tramp-tests.el (tramp-test21-file-links):
      Extend test.
      79cc9445
    • Paul Eggert's avatar
      Do not munge contents of local symbolic links · e8001d4c
      Paul Eggert authored
      This lets Emacs deal with arbitrary local symlinks without
      mishandling their contents (Bug#28156).  For example,
      (progn (shell-command "ln -fs '~' 'x'") (rename-file "x" "/tmp/x"))
      now consistently creates a symbolic link from '/tmp/x' to '~'.
      Formerly, it did that only if the working directory was on the
      same filesystem as /tmp; otherwise, it expanded the '~' to
      the user's home directory.
      * lisp/dired.el (dired-get-filename): Use files--name-absolute-system-p
      instead of rolling our own code.
      * lisp/files.el (files--name-absolute-system-p): New function.
      (file-truename, file-chase-links): Use it to avoid mishandling
      symlink contents that begin with ~.
      (copy-directory, move-file-to-trash):
      Use concat rather than expand-file-name, to avoid mishandling
      symlink contents that begin with ~.
      * src/fileio.c (Fmake_symbolic_link): Do not expand leading "~" in the
      target unless interactive.  Strip leading "/:" if interactive.
      (emacs_readlinkat): Do not prepend "/:" to the link target if
      it starts with "/" and contains ":" before NUL.
      * test/src/fileio-tests.el (try-link): Rename from try-char,
      and accept a string instead of a char.  All uses changed.
      (fileio-tests--symlink-failure): Also test leading ~, and "/:",
      to test the new behavior.
      e8001d4c