emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feedback on getting rid of `term-suppress-hard-newline'


From: Stefan Monnier
Subject: Re: Feedback on getting rid of `term-suppress-hard-newline'
Date: Sun, 20 Jan 2019 22:04:51 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]