From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Feedback on getting rid of `term-suppress-hard-newline'
Date: Sun, 20 Jan 2019 22:04:51 -0500 [thread overview]
Message-ID: <jwvva2id8iq.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 871s56sw98.fsf@gmail.com
> I changed the property name to 'term-line-wrap'.
Thanks,
>>>> + (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' ?
Various minor reasons:
- it also allows modifying text with `read-only` text-property.
- It allows the wrapped code to change read-only-mode if it wants/needs to,
whereas let-binding buffer-read-only means that if the wrapped code
changes read-only-mode, we'll silently undo this change at the end.
- `buffer-read-only` is a variable to *set* or *unset* rather than
to let-bind temporarily. Using inhibit-read-only clarifies that you
just want to temporarily override the read-only-ness rather than to
change the read-only-mode.
Depending on the situation, different things matter more.
Here it likely doesn't make much of a difference in practice, but the
normal style is to bind inhibit-read-only: that's what it's for.
> One more question, should I deprecate 'term-suppress-hard-newline' as
> part of this changeset ?
I think it should mark it as obsolete, yes.
Stefan
next prev parent reply other threads:[~2019-01-21 3:04 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
2019-01-21 0:14 ` John Shahid
2019-01-21 3:04 ` Stefan Monnier [this message]
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=jwvva2id8iq.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.