Sorry it took me a while to get back to you. I fixed most of the issues you mentioned but I had a few questions (see below). Stefan Monnier writes: >> ping > > FWIW, I think this makes a lot of sense, so please go ahead. > A few comments below, > > > Stefan > > >>> @@ -1106,6 +1106,7 @@ term-mode >>> (make-local-variable 'term-scroll-show-maximum-output) >>> (make-local-variable 'term-ptyp) >>> (make-local-variable 'term-exec-hook) >>> + (setq-local filter-buffer-substring-function 'term-filter-buffer-substring) > > Please use `add-function` to modify filter-buffer-substring-function. Done. > >>> + (put-text-property old-point (point) 'term-newline t))) > > I'd recommend you use a more explicit name which doesn't just state the > obvious "this is a newline in term mode". E.g. something like > `term-wrap-newline`. I changed the property name to 'term-line-wrap'. > >>> + (let (buffer-read-only) >>> + (delete-char 1)))) > > Never let-bind `buffer-read-only`: let-bind `inhibit-read-only` > instead. Done. I am curious to know why I shouldn't let-bind 'buffer-read-only' ? > >>> + ;; delete all fake newlines > > Please capitalize and punctuate your comments. Done. > >>> + (when (> len width) >>> + (goto-char (+ bol width)) > > Not sure how well term deals with wide chars (e.g. TAB or chinese > chars), but this code of yours clearly won't help. I think you > want to test current-column rather than `len` and then you want > move-to-column rather than advancing by N chars. I made the change in the attached patch. I don't have any fonts locally that are suitable for displaying Chinese characters so I couldn't test those. I tested with Arabic characters (e.g. 'C-x 8 RET ARABIC LIGATURE AKBAR ISOLATED FORM') and I don't think 'current-column' is reporting the right column number. In this case, it reports column count of 1 which isn't right. It does work though with tab characters. One more question, should I deprecate 'term-suppress-hard-newline' as part of this changeset ?