summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2018-07-28 07:50:36 -0700
committerGlenn Morris <rgm@gnu.org>2018-07-28 07:50:36 -0700
commit4713f5d7423f0a8f2a2dd147cec70982145562d6 (patch)
treeb052f21a286e65e2030119246b9ddf8fa8a716cf
parent1bcf5d02da96784a04034b4c0aba8fdfa1413c4e (diff)
parentbd52f37cae3fbc25e576f9b0a1ba42596790965f (diff)
downloademacs-4713f5d7423f0a8f2a2dd147cec70982145562d6.tar.gz
Merge from origin/emacs-26
bd52f37 (origin/emacs-26) ; Fix last change: only MinGW runtime 5.0.2... 024d20f Fix compilation with mingw.org's MinGW 5.x headers 38b6748 Update the list of special forms in the ELisp manual 8579105 Don't fail to indent-sexp before a full sexp (Bug#31984) d24c5f2 Fix calls to modifications hooks in replace-buffer-contents 71a9151 * src/character.c (char_width): Support glyphs with faces. (... 0feb673 Display raw bytes as belonging to 'eight-bit' charset 2e2f00f ; * doc/emacs/mule.texi (International Chars): Fix last change. 00561b5 Fix inaccurate text in the user manual 5cfb7a3 Copyedits in tramp.texi, improved example with bash's readline 6f8f358 Minor Tramp doc update 2585fcb File Shadowing is not available on MS Windows 39da592 ; Minor markup change in indent.texi 2f00ffe ; bookmark-jump: Add comment about last change.
-rw-r--r--doc/emacs/files.texi2
-rw-r--r--doc/emacs/indent.texi21
-rw-r--r--doc/emacs/mule.texi19
-rw-r--r--doc/lispref/eval.texi3
-rw-r--r--doc/lispref/frames.texi10
-rw-r--r--doc/misc/tramp.texi52
-rw-r--r--lib-src/pop.c8
-rw-r--r--lisp/bookmark.el3
-rw-r--r--lisp/descr-text.el6
-rw-r--r--lisp/emacs-lisp/lisp-mode.el24
-rw-r--r--lisp/international/mule-diag.el3
-rw-r--r--lisp/simple.el2
-rw-r--r--nt/inc/ms-w32.h7
-rw-r--r--nt/inc/sys/socket.h5
-rw-r--r--src/character.c15
-rw-r--r--src/editfns.c19
-rw-r--r--test/lisp/emacs-lisp/lisp-mode-tests.el11
-rw-r--r--test/lisp/shadowfile-tests.el24
18 files changed, 154 insertions, 80 deletions
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index f0a11fde555..a7cc57e4e94 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -881,6 +881,8 @@ You can answer ``no'' to bypass copying of this file, this time. If
you want to cancel the shadowing permanently for a certain file, use
@w{@kbd{M-x shadow-cancel}} to eliminate or change the shadow file group.
+File Shadowing is not available on MS Windows.
+
@node Time Stamps
@subsection Updating Time Stamps Automatically
@cindex time stamps
diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi
index b38e85819ce..bf43909edf3 100644
--- a/doc/emacs/indent.texi
+++ b/doc/emacs/indent.texi
@@ -60,9 +60,9 @@ repositioned to the first non-whitespace character on the line.
@node Indentation Commands
@section Indentation Commands
-Apart from the @key{TAB} (@code{indent-for-tab-command}) command,
-Emacs provides a variety of commands to perform indentation in other
-ways.
+Apart from the @kbd{@key{TAB}} (@code{indent-for-tab-command})
+command, Emacs provides a variety of commands to perform indentation
+in other ways.
@table @kbd
@item C-M-o
@@ -113,8 +113,8 @@ appears after the newline that is deleted. @xref{Fill Prefix}.
@item C-M-\
@kindex C-M-\
@findex indent-region
-Indent all the lines in the region, as though you had typed @key{TAB}
-at the beginning of each line (@code{indent-region}).
+Indent all the lines in the region, as though you had typed
+@kbd{@key{TAB}} at the beginning of each line (@code{indent-region}).
If a numeric argument is supplied, indent every line in the region to
that column number.
@@ -128,11 +128,12 @@ in the region, moving the affected lines as a rigid unit.
If called with no argument, the command activates a transient mode for
adjusting the indentation of the affected lines interactively. While
-this transient mode is active, typing @key{LEFT} or @key{RIGHT}
-indents leftward and rightward, respectively, by one space. You can
-also type @kbd{S-@key{LEFT}} or @kbd{S-@key{RIGHT}} to indent leftward
-or rightward to the next tab stop (@pxref{Tab Stops}). Typing any
-other key disables the transient mode, and resumes normal editing.
+this transient mode is active, typing @kbd{@key{LEFT}} or
+@kbd{@key{RIGHT}} indents leftward and rightward, respectively, by one
+space. You can also type @kbd{S-@key{LEFT}} or @kbd{S-@key{RIGHT}} to
+indent leftward or rightward to the next tab stop (@pxref{Tab Stops}).
+Typing any other key disables the transient mode, and resumes normal
+editing.
If called with a prefix argument @var{n}, this command indents the
lines forward by @var{n} spaces (without enabling the transient mode).
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 401c83dd49a..6c0c5b23989 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -156,12 +156,19 @@ system encodes the character safely and with a single byte
(@pxref{Coding Systems}). If the character's encoding is longer than
one byte, Emacs shows @samp{file ...}.
- As a special case, if the character lies in the range 128 (0200
-octal) through 159 (0237 octal), it stands for a raw byte that
-does not correspond to any specific displayable character. Such a
-character lies within the @code{eight-bit-control} character set,
-and is displayed as an escaped octal character code. In this case,
-@kbd{C-x =} shows @samp{part of display ...} instead of @samp{file}.
+@cindex eight-bit character set
+@cindex raw bytes
+ On rare occasions, Emacs encounters @dfn{raw bytes}: single bytes
+whose values are in the range 128 (0200 octal) through 255 (0377
+octal), which Emacs cannot interpret as part of a known encoding of
+some non-ASCII character. Such raw bytes are treated as if they
+belonged to a special character set @code{eight-bit}; Emacs displays
+them as escaped octal codes (this can be customized; @pxref{Display
+Custom}). In this case, @kbd{C-x =} shows @samp{raw-byte} instead of
+@samp{file}. In addition, @kbd{C-x =} shows the character codes of
+raw bytes as if they were in the range @code{#x3FFF80..#x3FFFFF},
+which is where Emacs maps them to distinguish them from Unicode
+characters in the range @code{#x0080..#x00FF}.
@cindex character set of character at point
@cindex font of character at point
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi
index 4e8b0df7b58..c9401be2535 100644
--- a/doc/lispref/eval.texi
+++ b/doc/lispref/eval.texi
@@ -507,9 +507,6 @@ Emacs Lisp with a reference to where each is described.
@item setq-default
@pxref{Creating Buffer-Local}
-@item track-mouse
-@pxref{Mouse Tracking}
-
@item unwind-protect
@pxref{Nonlocal Exits}
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 6678644bec7..ba4b9313731 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -3373,10 +3373,10 @@ occur. That is useful, because normally you don't want to track the
mouse forever---only until some other event, such as the release of a
button.
-@defspec track-mouse body@dots{}
-This special form executes @var{body}, with generation of mouse motion
-events enabled. Typically, @var{body} would use @code{read-event} to
-read the motion events and modify the display accordingly. @xref{Motion
+@defmac track-mouse body@dots{}
+This macro executes @var{body}, with generation of mouse motion events
+enabled. Typically, @var{body} would use @code{read-event} to read
+the motion events and modify the display accordingly. @xref{Motion
Events}, for the format of mouse motion events.
The value of @code{track-mouse} is that of the last form in @var{body}.
@@ -3396,7 +3396,7 @@ on (@pxref{Pointer Shape}). Therefore, Lisp programs that need the
mouse pointer to retain its original shape during dragging should bind
@code{track-mouse} to the value @code{dragging} at the beginning of
their @var{body}.
-@end defspec
+@end defmac
The usual purpose of tracking mouse motion is to indicate on the screen
the consequences of pushing or releasing a button at the current
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index a96f4ddf74c..463f10e7d72 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -1242,7 +1242,7 @@ improvement is not always true.
@cindex default user
@defopt tramp-default-user
-@value{tramp} file name can omit the user name part since
+A @value{tramp} file name can omit the user name part since
@value{tramp} substitutes the currently logged-in user name. However
this substitution can be overridden with @code{tramp-default-user}.
For example:
@@ -1457,7 +1457,7 @@ support this command.
@subsection Tunneling with ssh
-With ssh, you could use the @code{ProxyCommand} entry in the
+With ssh, you could use the @code{ProxyCommand} entry in
@file{~/.ssh/config}:
@example
@@ -1593,12 +1593,12 @@ A function dedicated to @file{/etc/hosts} for host names.
@item @code{tramp-parse-passwd}
@findex tramp-parse-passwd
-A function which parses @file{/etc/passwd} files for user names.
+A function which parses @file{/etc/passwd} for user names.
@item @code{tramp-parse-etc-group}
@findex tramp-parse-etc-group
-A function which parses @file{/etc/group} files for group names.
+A function which parses @file{/etc/group} for group names.
@item @code{tramp-parse-netrc}
@findex tramp-parse-netrc
@@ -2198,7 +2198,7 @@ of the secretfile is now owned by the user logged in from
When @code{backup-directory-alist} is @code{nil} (the default), such
problems do not occur.
-To ``turn off'' the backup feature for @value{tramp} files and stop
+To ``turn off'' the backup feature for remote files and stop
@value{tramp} from saving to the backup directory, use this:
@lisp
@@ -2260,12 +2260,11 @@ The backup file name of
@vindex auto-save-file-name-transforms
Just as for backup files, similar issues of file naming affect
-auto-saving @value{tramp} files. Auto-saved files are saved in the
-directory specified by the user option
-@code{auto-save-file-name-transforms}. By default this is set to
-the local temporary directory. But in some versions of Debian
-GNU/Linux, this points to the source directory where the Emacs was
-compiled. Reset such values to a valid directory.
+auto-saving remote files. Auto-saved files are saved in the directory
+specified by the user option @code{auto-save-file-name-transforms}.
+By default this is set to the local temporary directory. But in some
+versions of Debian GNU/Linux, this points to the source directory
+where the Emacs was compiled. Reset such values to a valid directory.
Set @code{auto-save-file-name-transforms} to @code{nil} to save
auto-saved files to the same directory as the original file.
@@ -2769,8 +2768,8 @@ hard-coded, fixed name. Note that using @code{:0} for X11 display name
here will not work as expected.
An alternate approach is specify @code{ForwardX11 yes} or
-@code{ForwardX11Trusted yes} in the file @file{~/.ssh/config} on the
-local host.
+@code{ForwardX11Trusted yes} in @file{~/.ssh/config} on the local
+host.
@subsection Running @code{shell} on a remote host
@@ -3450,6 +3449,19 @@ source "$@{HOME@}/.iterm2_shell_integration.bash"
@end group
@end example
+And finally, bash's readline should not use key bindings like
+@samp{C-j} to commands. Disable this in your @file{~/.inputrc}:
+
+@example
+@group
+$if term=dumb
+# Don't bind Control-J or it messes up @value{tramp}.
+$else
+"\C-j": next-history
+$endif
+@end group
+@end example
+
@item
Echoed characters after login
@@ -3586,13 +3598,13 @@ When testing, ensure the remote shell is the same shell
How to get notified after @value{tramp} completes file transfers?
Make Emacs beep after reading from or writing to the remote host with
-the following code in @file{~/.emacs} file.
+the following code in @file{~/.emacs}.
@lisp
@group
(defadvice tramp-handle-write-region
(after tramp-write-beep-advice activate)
- "Make tramp beep after writing a file."
+ "Make @value{tramp} beep after writing a file."
(interactive)
(beep))
@end group
@@ -3600,7 +3612,7 @@ the following code in @file{~/.emacs} file.
@group
(defadvice tramp-handle-do-copy-or-rename-file
(after tramp-copy-beep-advice activate)
- "Make tramp beep after copying a file."
+ "Make @value{tramp} beep after copying a file."
(interactive)
(beep))
@end group
@@ -3608,7 +3620,7 @@ the following code in @file{~/.emacs} file.
@group
(defadvice tramp-handle-insert-file-contents
(after tramp-insert-beep-advice activate)
- "Make tramp beep after inserting a file."
+ "Make @value{tramp} beep after inserting a file."
(interactive)
(beep))
@end group
@@ -3646,7 +3658,7 @@ then set them with a hook as follows:
@item
-Why is @file{~/.sh_history} file on the remote host growing?
+Why is @file{~/.sh_history} on the remote host growing?
@vindex tramp-histfile-override
@vindex HISTFILE@r{, environment variable}
@@ -3667,7 +3679,7 @@ undesired results when using @command{bash} as remote shell.
Another approach is to disable @value{tramp}'s handling of the
@env{HISTFILE} at all by setting @code{tramp-histfile-override} to
@code{nil}. In this case, saving history could be turned off by
-putting this shell code in the @file{.bashrc} or @file{.kshrc} file:
+putting this shell code in @file{.bashrc} or @file{.kshrc}:
@example
@group
@@ -3684,7 +3696,7 @@ fi
@end example
For @option{ssh}-based method, add the following line to your
-@file{~/.ssh/environment} file:
+@file{~/.ssh/environment}:
@example
HISTFILE=/dev/null
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 10aac957d4b..731f951fd14 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -30,8 +30,12 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "ntlib.h"
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 /* for getaddrinfo stuff */
-#include <winsock2.h>
-#include <ws2tcpip.h>
+#if defined __MINGW32_VERSION && __MINGW32_VERSION >= 5000002L
+# include <windows.h>
+#else
+# include <winsock2.h>
+#endif
+# include <ws2tcpip.h>
#undef getaddrinfo
#define getaddrinfo sys_getaddrinfo
#undef freeaddrinfo
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index ea7fcb12467..58a279473d0 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1110,6 +1110,9 @@ DISPLAY-FUNC would be `switch-to-buffer-other-window'."
(unless bookmark
(error "No bookmark specified"))
(bookmark-maybe-historicize-string bookmark)
+ ;; Don't use `switch-to-buffer' because it would let the
+ ;; window-point override the bookmark's point when
+ ;; `switch-to-buffer-preserve-window-point' is non-nil.
(bookmark--jump-via bookmark (or display-func 'pop-to-buffer-same-window)))
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index d8f8188eb1e..466e44aeee8 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -404,6 +404,12 @@ relevant to POS."
(charset (if eight-bit-p 'eight-bit
(or (get-text-property pos 'charset)
(char-charset char))))
+ ;; TIS620.2533 overlaps eight-bit-control, but we want to
+ ;; show eight-bit for raw bytes, not some obscure character
+ ;; set no one heard of.
+ (charset (if (eq charset 'tis620-2533)
+ 'eight-bit
+ charset))
(composition (find-composition pos nil nil t))
(component-chars nil)
(display-table (or (window-display-table)
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 25b61a23a94..6313c63ecfe 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1195,14 +1195,22 @@ ENDPOS is encountered."
(setq endpos (copy-marker
(if endpos endpos
;; Get error now if we don't have a complete sexp
- ;; after point. We actually look for a sexp which
- ;; ends after the current line so that we properly
- ;; indent things like #s(...). This might not be
- ;; needed if Bug#15998 is fixed.
- (let ((eol (line-end-position)))
- (save-excursion (while (and (< (point) eol) (not (eobp)))
- (forward-sexp 1))
- (point))))))
+ ;; after point.
+ (save-excursion
+ (let ((eol (line-end-position)))
+ (forward-sexp 1)
+ ;; We actually look for a sexp which ends
+ ;; after the current line so that we properly
+ ;; indent things like #s(...). This might not
+ ;; be needed if Bug#15998 is fixed.
+ (condition-case ()
+ (while (and (< (point) eol) (not (eobp)))
+ (forward-sexp 1))
+ ;; But don't signal an error for incomplete
+ ;; sexps following the first complete sexp
+ ;; after point.
+ (scan-error nil)))
+ (point)))))
(save-excursion
(while (let ((indent (lisp-indent-calc-next parse-state))
(ppss (lisp-indent-state-ppss parse-state)))
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 87a2e993bb4..c9829e352ec 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -355,7 +355,8 @@ meanings of these arguments."
(:iso-revision-number "ISO revision number: "
number-to-string)
(:supplementary-p
- "Used only as a parent of some other charset." nil)))
+ "Used only as a parent or a subset of some other charset,
+or provided just for backward compatibility." nil)))
(let ((val (get-charset-property charset (car elt))))
(when val
(if (cadr elt) (insert (cadr elt)))
diff --git a/lisp/simple.el b/lisp/simple.el
index 8d770478aa9..a45e2597163 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1410,7 +1410,7 @@ in *Help* buffer. See also the command `describe-char'."
(if (or (not coding)
(eq (coding-system-type coding) t))
(setq coding (default-value 'buffer-file-coding-system)))
- (if (eq (char-charset char) 'eight-bit)
+ (if (and (>= char #x3fff80) (<= char #x3fffff))
(setq encoding-msg
(format "(%d, #o%o, #x%x, raw-byte)" char char char))
;; Check if the character is displayed with some `display'
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index ff4317817e0..d15b6da1a74 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -455,7 +455,12 @@ extern char *get_emacs_configuration_options (void);
windows.h. For this to have proper effect, config.h must always be
included before windows.h. */
#define _WINSOCKAPI_ 1
-#define _WINSOCK_H
+#if !(defined __MINGW32_VERSION && __MINGW32_VERSION >= 5000002L)
+/* mingw.org's MinGW 5.x changed how it includes winsock.h and time.h,
+ and now defining _WINSOCK_H skips the definition of struct timeval,
+ which we don't want. */
+# define _WINSOCK_H
+#endif
/* Defines size_t and alloca (). */
#include <stdlib.h>
diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h
index 2582cbdaef1..de282c467e6 100644
--- a/nt/inc/sys/socket.h
+++ b/nt/inc/sys/socket.h
@@ -49,6 +49,11 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#define timeval ws_timeval
#endif
+#if defined __MINGW32_VERSION && __MINGW32_VERSION >= 5000002L
+/* Need winerror.h before winsock2.h with mingw.org's MinGW 5.x,
+ otherwise some error codes are not defined. */
+# include <winerror.h>
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
/* process.c uses uint16_t (from C99) for IPv6, but
diff --git a/src/character.c b/src/character.c
index 6a689808043..b17f44b1422 100644
--- a/src/character.c
+++ b/src/character.c
@@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "lisp.h"
#include "character.h"
#include "buffer.h"
+#include "dispextern.h"
#include "composite.h"
#include "disptab.h"
@@ -288,13 +289,15 @@ char_width (int c, struct Lisp_Char_Table *dp)
if (VECTORP (disp))
for (i = 0, width = 0; i < ASIZE (disp); i++)
{
+ int c;
ch = AREF (disp, i);
- if (CHARACTERP (ch))
- {
- int w = CHARACTER_WIDTH (XFASTINT (ch));
- if (INT_ADD_WRAPV (width, w, &width))
- string_overflow ();
- }
+ if (GLYPH_CODE_P (ch))
+ c = GLYPH_CODE_CHAR (ch);
+ else if (CHARACTERP (ch))
+ c = XFASTINT (ch);
+ int w = CHARACTER_WIDTH (c);
+ if (INT_ADD_WRAPV (width, w, &width))
+ string_overflow ();
}
}
return width;
diff --git a/src/editfns.c b/src/editfns.c
index 522cb5dcef2..0fbc5aad8c3 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3256,21 +3256,9 @@ differences between the two buffers. */)
Instead, we announce a single modification for the entire
modified region. But don't do that if the caller inhibited
modification hooks, because then they don't want that. */
- ptrdiff_t from, to;
if (!inhibit_modification_hooks)
{
- ptrdiff_t k, l;
-
- /* Find the first character position to be changed. */
- for (k = 0; k < size_a && !bit_is_set (ctx.deletions, k); k++)
- ;
- from = BEGV + k;
-
- /* Find the last character position to be changed. */
- for (l = size_a; l > k && !bit_is_set (ctx.deletions, l - 1); l--)
- ;
- to = BEGV + l;
- prepare_to_modify_buffer (from, to, NULL);
+ prepare_to_modify_buffer (BEGV, ZV, NULL);
specbind (Qinhibit_modification_hooks, Qt);
modification_hooks_inhibited = true;
}
@@ -3322,9 +3310,8 @@ differences between the two buffers. */)
if (modification_hooks_inhibited)
{
- ptrdiff_t updated_to = to + ZV - BEGV - size_a;
- signal_after_change (from, to - from, updated_to - from);
- update_compositions (from, updated_to, CHECK_INSIDE);
+ signal_after_change (BEGV, size_a, ZV - BEGV);
+ update_compositions (BEGV, ZV, CHECK_INSIDE);
}
return Qnil;
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el
index 0b052e9fc30..30f606d3816 100644
--- a/test/lisp/emacs-lisp/lisp-mode-tests.el
+++ b/test/lisp/emacs-lisp/lisp-mode-tests.el
@@ -125,6 +125,17 @@ noindent\" 3
#s(foo
bar)\n"))))
+(ert-deftest indent-sexp-cant-go ()
+ "`indent-sexp' shouldn't error before a sexp."
+ ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31984#32.
+ (with-temp-buffer
+ (emacs-lisp-mode)
+ (insert "(())")
+ (goto-char (1+ (point-min)))
+ ;; Paredit calls `indent-sexp' from this position.
+ (indent-sexp)
+ (should (equal (buffer-string) "(())"))))
+
(ert-deftest lisp-indent-region ()
"Test basics of `lisp-indent-region'."
(with-temp-buffer
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index 2affe778deb..085ab476ffe 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -15,10 +15,22 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see `http://www.gnu.org/licenses/'.
+;; along with this program. If not, see `https://www.gnu.org/licenses/'.
;;; Commentary:
+;; Some of the tests require access to a remote host files. Since
+;; this could be problematic, a mock-up connection method "mock" is
+;; used. Emulating a remote connection, it simply calls "sh -i".
+;; Tramp's file name handlers still run, so this test is sufficient
+;; except for connection establishing.
+
+;; If you want to test a real Tramp connection, set
+;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order to
+;; overwrite the default value. If you want to skip tests accessing a
+;; remote host, set this environment variable to "/dev/null" or
+;; whatever is appropriate on your system.
+
;; A whole test run can be performed calling the command `shadowfile-test-all'.
;;; Code:
@@ -64,6 +76,7 @@
Per definition, all files are identical on the different hosts of
a cluster (or site). This is not tested here; it must be
guaranteed by the originator of a cluster definition."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(let ((text-quoting-style 'grave) ;; We inspect the *Messages* buffer!
@@ -187,6 +200,7 @@ guaranteed by the originator of a cluster definition."
Per definition, all files are identical on the different hosts of
a cluster (or site). This is not tested here; it must be
guaranteed by the originator of a cluster definition."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(let ((shadow-info-file shadow-test-info-file)
@@ -293,6 +307,7 @@ guaranteed by the originator of a cluster definition."
(ert-deftest shadow-test02-files ()
"Check file manipulation functions."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(let ((shadow-info-file shadow-test-info-file)
@@ -368,6 +383,7 @@ guaranteed by the originator of a cluster definition."
(ert-deftest shadow-test03-expand-cluster-in-file-name ()
"Check canonical file name of a cluster or site."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(let ((shadow-info-file shadow-test-info-file)
@@ -438,6 +454,7 @@ guaranteed by the originator of a cluster definition."
(ert-deftest shadow-test04-contract-file-name ()
"Check canonical file name of a cluster or site."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(let ((shadow-info-file shadow-test-info-file)
@@ -498,6 +515,7 @@ guaranteed by the originator of a cluster definition."
(ert-deftest shadow-test05-file-match ()
"Check `shadow-same-site' and `shadow-file-match'."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(let ((shadow-info-file shadow-test-info-file)
@@ -556,6 +574,7 @@ guaranteed by the originator of a cluster definition."
(ert-deftest shadow-test06-literal-groups ()
"Check literal group definitions."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(let ((shadow-info-file shadow-test-info-file)
@@ -620,6 +639,7 @@ guaranteed by the originator of a cluster definition."
(ert-deftest shadow-test07-regexp-groups ()
"Check regexp group definitions."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(let ((shadow-info-file shadow-test-info-file)
@@ -686,6 +706,7 @@ guaranteed by the originator of a cluster definition."
(ert-deftest shadow-test08-shadow-todo ()
"Check that needed shadows are added to todo."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(skip-unless (file-writable-p shadow-test-remote-temporary-file-directory))
@@ -810,6 +831,7 @@ guaranteed by the originator of a cluster definition."
(ert-deftest shadow-test09-shadow-copy-files ()
"Check that needed shadow files are copied."
+ (skip-unless (not (memq system-type '(windows-nt ms-dos))))
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
(let ((backup-inhibited t)