all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Feedback on getting rid of `term-suppress-hard-newline'
Date: Wed, 16 Jan 2019 11:51:50 -0500	[thread overview]
Message-ID: <jwv36psimfa.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 87sgxsr8p0.fsf@gmail.com

> 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.

>> +    (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`.

>> +    (let (buffer-read-only)
>> +      (delete-char 1))))

Never let-bind `buffer-read-only`: let-bind `inhibit-read-only` instead.

>> +    ;; delete all fake newlines

Please capitalize and punctuate your comments.

>> +          (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.




  reply	other threads:[~2019-01-16 16:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 12:14 Feedback on getting rid of `term-suppress-hard-newline' John Shahid
2019-01-16 14:14 ` John Shahid
2019-01-16 16:51   ` Stefan Monnier [this message]
2019-01-21  0:14     ` John Shahid
2019-01-21  3:04       ` Stefan Monnier
2019-01-21 20:32         ` John Shahid
2019-02-20 14:54           ` John Shahid
2019-02-21 14:55           ` Stefan Monnier
2019-02-24 18:00             ` John Shahid
     [not found]               ` <jwvh8cs6fzt.fsf-monnier+emacs@gnu.org>
     [not found]                 ` <87k1ho26vc.fsf@gmail.com>
     [not found]                   ` <87h8cr9is1.fsf@gmail.com>
2019-02-27 12:54                     ` Fwd: " John Shahid

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

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

  git send-email \
    --in-reply-to=jwv36psimfa.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.