unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: John Shahid <jvshahid@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 31662@debbugs.gnu.org
Subject: bug#31662: [PATCH] fix double counting bug in term.el
Date: Sat, 02 Jun 2018 02:43:23 +0000	[thread overview]
Message-ID: <87r2lpc3i5.fsf@gmail.com> (raw)
In-Reply-To: <876032aps6.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]


Noam Postavsky <npostavs@gmail.com> writes:

> John Shahid <jvshahid@gmail.com> writes:
>
>> Thanks for the feedback. I fixed both issues in the attached patch.
>
> Thanks, looks good.
>
>> Subject: [PATCH] * lisp/term.el (term-emulate-terminal): fix column double
>>  counting
>
> Minor nitpick ChangeLog formatting nitpick, the sentence should be
> capitalized and end with a period.

fixed in the attached patch

>
> Have you assigned copyright for Emacs?  (the patch is small enough to go
> in regardless, but it would need to be marked as a tiny change)

Yes I did. Should I attach the signed assignment to the bug report ?

cheers,

-js


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-term.el-term-emulate-terminal-Fix-column-double.patch --]
[-- Type: text/x-diff, Size: 1737 bytes --]

From 26219852992155889e142fb2b45f559ec6318c28 Mon Sep 17 00:00:00 2001
From: John Shahid <jvshahid@gmail.com>
Date: Wed, 30 May 2018 23:55:16 -0400
Subject: [PATCH] * lisp/term.el (term-emulate-terminal): Fix column double
 counting.

---
 lisp/term.el            | 3 ++-
 test/lisp/term-tests.el | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/term.el b/lisp/term.el
index 19e68ddb49..715f39bbbf 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -2904,7 +2904,8 @@ term-emulate-terminal
                   (when (not (or (eobp) term-insert-mode))
                     (let ((pos (point)))
                       (term-move-columns columns)
-                      (delete-region pos (point))))
+                      (delete-region pos (point))
+                      (setq term-current-column nil)))
                   ;; In insert mode if the current line
                   ;; has become too long it needs to be
                   ;; chopped off.
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index 8aaa61a210..72a9ad1ef7 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -89,6 +89,13 @@ term-test-screen-from-input
                                               "\e[2;1Hc"
                                               "\e[1;2Hb"
                                               "\e[1;1Ha") "" t))))
+  (should (equal "abcde    j"
+                 (term-test-screen-from-input
+                  10 12 '("abcdefghij"
+                          "\e[H"  ;move back to point-min
+                          "abcde"
+                          "    j"))))
+
   ;; Relative positioning.
   (should (equal "ab\ncd"
                  (term-test-screen-from-input
-- 
2.17.1


  reply	other threads:[~2018-06-02  2:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31  4:49 bug#31662: [PATCH] fix double counting bug in term.el John Shahid
2018-05-31 22:51 ` Noam Postavsky
2018-06-01  2:51   ` John Shahid
2018-06-02  2:24     ` Noam Postavsky
2018-06-02  2:43       ` John Shahid [this message]
2018-06-02  3:13         ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r2lpc3i5.fsf@gmail.com \
    --to=jvshahid@gmail.com \
    --cc=31662@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).