diff options
| author | Noam Postavsky | 2019-07-20 22:02:36 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-07-20 22:02:36 -0400 |
| commit | 6490269becdad96ca4b3b9db0d96dbb04ef2ab6a (patch) | |
| tree | 20cccad69113acfe3072dcf50a677b06c6d7b4fb | |
| parent | f02b9e9a6ff701d041ef86afe8b9a92ba8e4fd30 (diff) | |
| parent | 150bdfe43acde8423612cbff4eafbbb88878b497 (diff) | |
| download | emacs-6490269becdad96ca4b3b9db0d96dbb04ef2ab6a.tar.gz emacs-6490269becdad96ca4b3b9db0d96dbb04ef2ab6a.zip | |
Merge from emacs-26
150bdfe43a Handle completely undecoded input in term (Bug#29918)
021f32cca1 * doc/misc/forms.texi (Control File Format): Fix a doc error.
76538d09b7 Fix typo in package-alist docstring
b2fde4b5e8 * doc/lispref/text.texi (Mode-Specific Indent): Fix a typo...
7e62778548 ; Another minor change in 'bidi-display-reordering's doc s...
4455ddbe56 Improve doc string of 'bidi-display-reordering'
34ee26dd93 Add warning to bidi-display-reordering doc string
# Conflicts:
# lisp/term.el
# test/lisp/term-tests.el
| -rw-r--r-- | doc/lispref/text.texi | 2 | ||||
| -rw-r--r-- | doc/misc/forms.texi | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 4 | ||||
| -rw-r--r-- | lisp/term.el | 9 | ||||
| -rw-r--r-- | src/buffer.c | 6 | ||||
| -rw-r--r-- | test/lisp/term-tests.el | 19 |
6 files changed, 33 insertions, 9 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index e73141faf4c..7ce54f59c69 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -2344,7 +2344,7 @@ Here is what it does: | |||
| 2344 | @itemize | 2344 | @itemize |
| 2345 | @item | 2345 | @item |
| 2346 | First, it checks whether Transient Mark mode is enabled and the region | 2346 | First, it checks whether Transient Mark mode is enabled and the region |
| 2347 | is active. If so, it called @code{indent-region} to indent all the | 2347 | is active. If so, it calls @code{indent-region} to indent all the |
| 2348 | text in the region (@pxref{Region Indent}). | 2348 | text in the region (@pxref{Region Indent}). |
| 2349 | 2349 | ||
| 2350 | @item | 2350 | @item |
diff --git a/doc/misc/forms.texi b/doc/misc/forms.texi index d669ed6d038..9423f946091 100644 --- a/doc/misc/forms.texi +++ b/doc/misc/forms.texi | |||
| @@ -431,7 +431,7 @@ file. Example: | |||
| 431 | If the control file does not set @code{forms-format-list} a default | 431 | If the control file does not set @code{forms-format-list} a default |
| 432 | format is used. In this situation, Forms mode will deduce the number of | 432 | format is used. In this situation, Forms mode will deduce the number of |
| 433 | fields from the data file providing this file exists and | 433 | fields from the data file providing this file exists and |
| 434 | @code{forms-number-of-records} has not been set in the control file. | 434 | @code{forms-number-of-fields} has not been set in the control file. |
| 435 | 435 | ||
| 436 | The control file can optionally set the following additional Forms mode | 436 | The control file can optionally set the following additional Forms mode |
| 437 | variables. Most of them have default values that are good for most | 437 | variables. Most of them have default values that are good for most |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 9a350aadaca..53fa15d4199 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -547,8 +547,8 @@ name (a symbol) and DESC is a `package--bi-desc' structure.") | |||
| 547 | (defvar package-alist nil | 547 | (defvar package-alist nil |
| 548 | "Alist of all packages available for activation. | 548 | "Alist of all packages available for activation. |
| 549 | Each element has the form (PKG . DESCS), where PKG is a package | 549 | Each element has the form (PKG . DESCS), where PKG is a package |
| 550 | name (a symbol) and DESCS is a non-empty list of `package-desc' structure, | 550 | name (a symbol) and DESCS is a non-empty list of `package-desc' |
| 551 | sorted by decreasing versions. | 551 | structures, sorted by decreasing versions. |
| 552 | 552 | ||
| 553 | This variable is set automatically by `package-load-descriptor', | 553 | This variable is set automatically by `package-load-descriptor', |
| 554 | called via `package-initialize'. To change which packages are | 554 | called via `package-initialize'. To change which packages are |
diff --git a/lisp/term.el b/lisp/term.el index dec8f5a3178..f3411044b25 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -2916,11 +2916,12 @@ See `term-prompt-regexp'." | |||
| 2916 | (when (= funny str-length) | 2916 | (when (= funny str-length) |
| 2917 | (let ((partial 0) | 2917 | (let ((partial 0) |
| 2918 | (count (length decoded-substring))) | 2918 | (count (length decoded-substring))) |
| 2919 | (while (eq (char-charset (aref decoded-substring | 2919 | (while (and (< partial count) |
| 2920 | (- count 1 partial))) | 2920 | (eq (char-charset (aref decoded-substring |
| 2921 | 'eight-bit) | 2921 | (- count 1 partial))) |
| 2922 | 'eight-bit)) | ||
| 2922 | (cl-incf partial)) | 2923 | (cl-incf partial)) |
| 2923 | (when (> partial 0) | 2924 | (when (> count partial 0) |
| 2924 | (setq term-terminal-undecoded-bytes | 2925 | (setq term-terminal-undecoded-bytes |
| 2925 | (substring decoded-substring (- partial))) | 2926 | (substring decoded-substring (- partial))) |
| 2926 | (setq decoded-substring | 2927 | (setq decoded-substring |
diff --git a/src/buffer.c b/src/buffer.c index 209e29f0f19..ea785bbcd70 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5659,7 +5659,11 @@ This variable is never applied to a way of decoding a file while reading it. */ | |||
| 5659 | 5659 | ||
| 5660 | DEFVAR_PER_BUFFER ("bidi-display-reordering", | 5660 | DEFVAR_PER_BUFFER ("bidi-display-reordering", |
| 5661 | &BVAR (current_buffer, bidi_display_reordering), Qnil, | 5661 | &BVAR (current_buffer, bidi_display_reordering), Qnil, |
| 5662 | doc: /* Non-nil means reorder bidirectional text for display in the visual order. */); | 5662 | doc: /* Non-nil means reorder bidirectional text for display in the visual order. |
| 5663 | Setting this to nil is intended for use in debugging the display code. | ||
| 5664 | Don't set to nil in normal sessions, as that is not supported. | ||
| 5665 | See also `bidi-paragraph-direction'; setting that non-nil might | ||
| 5666 | speed up redisplay. */); | ||
| 5663 | 5667 | ||
| 5664 | DEFVAR_PER_BUFFER ("bidi-paragraph-start-re", | 5668 | DEFVAR_PER_BUFFER ("bidi-paragraph-start-re", |
| 5665 | &BVAR (current_buffer, bidi_paragraph_start_re), Qnil, | 5669 | &BVAR (current_buffer, bidi_paragraph_start_re), Qnil, |
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el index 33ed006cf8b..5fca002f07c 100644 --- a/test/lisp/term-tests.el +++ b/test/lisp/term-tests.el | |||
| @@ -305,6 +305,25 @@ This is a reduced example from GNU nano's initial screen." | |||
| 305 | `("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y)) | 305 | `("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y)) |
| 306 | (concat y "\n" x))))) | 306 | (concat y "\n" x))))) |
| 307 | 307 | ||
| 308 | (ert-deftest term-decode-partial () ;; Bug#25288. | ||
| 309 | "Test multibyte characters sent into multiple chunks." | ||
| 310 | ;; Set `locale-coding-system' so test will be deterministic. | ||
| 311 | (let* ((locale-coding-system 'utf-8-unix) | ||
| 312 | (string (make-string 7 ?ш)) | ||
| 313 | (bytes (encode-coding-string string locale-coding-system))) | ||
| 314 | (should (equal string | ||
| 315 | (term-test-screen-from-input | ||
| 316 | 40 1 `(,(substring bytes 0 (/ (length bytes) 2)) | ||
| 317 | ,(substring bytes (/ (length bytes) 2)))))))) | ||
| 318 | (ert-deftest term-undecodable-input () ;; Bug#29918. | ||
| 319 | "Undecodable bytes should be passed through without error." | ||
| 320 | (let* ((locale-coding-system 'utf-8-unix) ; As above. | ||
| 321 | (bytes "\376\340\360\370") | ||
| 322 | (string (decode-coding-string bytes locale-coding-system))) | ||
| 323 | (should (equal string | ||
| 324 | (term-test-screen-from-input | ||
| 325 | 40 1 bytes))))) | ||
| 326 | |||
| 308 | (provide 'term-tests) | 327 | (provide 'term-tests) |
| 309 | 328 | ||
| 310 | ;;; term-tests.el ends here | 329 | ;;; term-tests.el ends here |