emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 6490269: Merge from emacs-26


From: Noam Postavsky
Subject: [Emacs-diffs] master 6490269: Merge from emacs-26
Date: Sat, 20 Jul 2019 22:31:03 -0400 (EDT)

branch: master
commit 6490269becdad96ca4b3b9db0d96dbb04ef2ab6a
Merge: f02b9e9 150bdfe
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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
---
 doc/lispref/text.texi      |  2 +-
 doc/misc/forms.texi        |  2 +-
 lisp/emacs-lisp/package.el |  4 ++--
 lisp/term.el               |  9 +++++----
 src/buffer.c               |  6 +++++-
 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 e73141f..7ce54f5 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -2344,7 +2344,7 @@ Here is what it does:
 @itemize
 @item
 First, it checks whether Transient Mark mode is enabled and the region
-is active.  If so, it called @code{indent-region} to indent all the
+is active.  If so, it calls @code{indent-region} to indent all the
 text in the region (@pxref{Region Indent}).
 
 @item
diff --git a/doc/misc/forms.texi b/doc/misc/forms.texi
index d669ed6..9423f94 100644
--- a/doc/misc/forms.texi
+++ b/doc/misc/forms.texi
@@ -431,7 +431,7 @@ file.  Example:
 If the control file does not set @code{forms-format-list} a default
 format is used.  In this situation, Forms mode will deduce the number of
 fields from the data file providing this file exists and
-@code{forms-number-of-records} has not been set in the control file.
+@code{forms-number-of-fields} has not been set in the control file.
 
 The control file can optionally set the following additional Forms mode
 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 9a350aa..53fa15d 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.")
 (defvar package-alist nil
   "Alist of all packages available for activation.
 Each element has the form (PKG . DESCS), where PKG is a package
-name (a symbol) and DESCS is a non-empty list of `package-desc' structure,
-sorted by decreasing versions.
+name (a symbol) and DESCS is a non-empty list of `package-desc'
+structures, sorted by decreasing versions.
 
 This variable is set automatically by `package-load-descriptor',
 called via `package-initialize'.  To change which packages are
diff --git a/lisp/term.el b/lisp/term.el
index dec8f5a..f341104 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -2916,11 +2916,12 @@ See `term-prompt-regexp'."
                 (when (= funny str-length)
                   (let ((partial 0)
                         (count (length decoded-substring)))
-                    (while (eq (char-charset (aref decoded-substring
-                                                   (- count 1 partial)))
-                               'eight-bit)
+                    (while (and (< partial count)
+                                (eq (char-charset (aref decoded-substring
+                                                        (- count 1 partial)))
+                                    'eight-bit))
                       (cl-incf partial))
-                    (when (> partial 0)
+                    (when (> count partial 0)
                       (setq term-terminal-undecoded-bytes
                             (substring decoded-substring (- partial)))
                       (setq decoded-substring
diff --git a/src/buffer.c b/src/buffer.c
index 209e29f..ea785bb 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.  */
 
   DEFVAR_PER_BUFFER ("bidi-display-reordering",
                     &BVAR (current_buffer, bidi_display_reordering), Qnil,
-                    doc: /* Non-nil means reorder bidirectional text for 
display in the visual order.  */);
+                    doc: /* Non-nil means reorder bidirectional text for 
display in the visual order.
+Setting this to nil is intended for use in debugging the display code.
+Don't set to nil in normal sessions, as that is not supported.
+See also `bidi-paragraph-direction'; setting that non-nil might
+speed up redisplay.  */);
 
   DEFVAR_PER_BUFFER ("bidi-paragraph-start-re",
                     &BVAR (current_buffer, bidi_paragraph_start_re), Qnil,
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index 33ed006..5fca002 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."
                     `("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y))
                    (concat y "\n" x)))))
 
+(ert-deftest term-decode-partial () ;; Bug#25288.
+  "Test multibyte characters sent into multiple chunks."
+  ;; Set `locale-coding-system' so test will be deterministic.
+  (let* ((locale-coding-system 'utf-8-unix)
+         (string (make-string 7 ?ш))
+         (bytes (encode-coding-string string locale-coding-system)))
+    (should (equal string
+                   (term-test-screen-from-input
+                    40 1 `(,(substring bytes 0 (/ (length bytes) 2))
+                           ,(substring bytes (/ (length bytes) 2))))))))
+(ert-deftest term-undecodable-input () ;; Bug#29918.
+  "Undecodable bytes should be passed through without error."
+  (let* ((locale-coding-system 'utf-8-unix) ; As above.
+         (bytes "\376\340\360\370")
+         (string (decode-coding-string bytes locale-coding-system)))
+    (should (equal string
+                   (term-test-screen-from-input
+                    40 1 bytes)))))
+
 (provide 'term-tests)
 
 ;;; term-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]