Commit 4713f5d7 authored by Glenn Morris's avatar Glenn Morris

Merge from origin/emacs-26

bd52f37c (origin/emacs-26) ; Fix last change: only MinGW runtime 5.0.2...
024d20f8 Fix compilation with mingw.org's MinGW 5.x headers
38b67488 Update the list of special forms in the ELisp manual
85791053 Don't fail to indent-sexp before a full sexp (Bug#31984)
d24c5f26 Fix calls to modifications hooks in replace-buffer-contents
71a91515 * src/character.c (char_width): Support glyphs with faces.  (...
0feb6733 Display raw bytes as belonging to 'eight-bit' charset
2e2f00f8 ; * doc/emacs/mule.texi (International Chars): Fix last change.
00561b59 Fix inaccurate text in the user manual
5cfb7a39 Copyedits in tramp.texi, improved example with bash's readline
6f8f358e Minor Tramp doc update
2585fcb1 File Shadowing is not available on MS Windows
39da592d ; Minor markup change in indent.texi
2f00ffe5 ; bookmark-jump: Add comment about last change.
parents 1bcf5d02 bd52f37c
......@@ -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
......
......@@ -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).
......
......@@ -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
......
......@@ -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}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)))
......
......@@ -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)
......
......@@ -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)))
......
......@@ -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)))
......
......@@ -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'
......
......@@ -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>
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment