From: Michael Hoffman <9qobl2n02@sneakemail.com> Date: Thu, 13 Jun 2013 05:27:05 +0000 (-0700) Subject: * term.el (term-suppress-hard-newline): New option (tiny change) X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2016^2~136 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5755011f76526d2ab57482d796a757ecfcfbb3a8;p=emacs.git * term.el (term-suppress-hard-newline): New option (tiny change) (term-emulate-terminal): Respect term-suppress-hard-newline. Fixes: debbugs:12017 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5ff36f1539c..b19601a7b52 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-06-13 Michael Hoffman <9qobl2n02@sneakemail.com> (tiny change) + + * term.el (term-suppress-hard-newline): New option. (Bug#12017) + (term-emulate-terminal): Respect term-suppress-hard-newline. + 2013-06-13 E Sabof (tiny change) * image-dired.el (image-dired-dired-toggle-marked-thumbs): diff --git a/lisp/term.el b/lisp/term.el index 1c67057d3a7..31889a78273 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -560,6 +560,13 @@ This variable is buffer-local." :type 'boolean :group 'term) +(defcustom term-suppress-hard-newline nil + "Non-nil means interpreter should not break long lines with newlines. +This means text can automatically reflow if the window is resized." + :version "24.4" + :type 'boolean + :group 'term) + ;; Where gud-display-frame should put the debugging arrow. This is ;; set by the marker-filter, which scans the debugger's output for ;; indications of the current pc. @@ -2828,8 +2835,9 @@ See `term-prompt-regexp'." (setq count (length decoded-substring)) (setq temp (- (+ (term-horizontal-column) count) term-width)) - (cond ((<= temp 0)) ;; All count chars fit in line. - ((> count temp) ;; Some chars fit. + (cond ((or term-suppress-hard-newline (<= temp 0))) + ;; All count chars fit in line. + ((> count temp) ;; Some chars fit. ;; This iteration, handle only what fits. (setq count (- count temp)) (setq count-bytes