From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Feedback on getting rid of `term-suppress-hard-newline' Date: Sun, 20 Jan 2019 22:04:51 -0500 Message-ID: References: <87efanc576.fsf@gmail.com> <87sgxsr8p0.fsf@gmail.com> <871s56sw98.fsf@gmail.com> NNTP-Posting-Host: ciao.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ciao.gmane.org 1548040829 6935 195.159.176.228 (21 Jan 2019 03:20:29 GMT) X-Complaints-To: usenet@ciao.gmane.org NNTP-Posting-Date: Mon, 21 Jan 2019 03:20:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 21 04:20:27 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1glQ8P-0001iS-A6 for ged-emacs-devel@m.gmane.org; Mon, 21 Jan 2019 04:20:25 +0100 Original-Received: from localhost ([127.0.0.1]:47390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glQ8Y-0004wi-4P for ged-emacs-devel@m.gmane.org; Sun, 20 Jan 2019 22:20:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glQ7N-0004B5-VU for emacs-devel@gnu.org; Sun, 20 Jan 2019 22:19:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glPvQ-0004FT-CA for emacs-devel@gnu.org; Sun, 20 Jan 2019 22:07:01 -0500 Original-Received: from [195.159.176.228] (port=55270 helo=ciao.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1glPvQ-0004Et-56 for emacs-devel@gnu.org; Sun, 20 Jan 2019 22:07:00 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1glPtI-000vZg-2U for emacs-devel@gnu.org; Mon, 21 Jan 2019 04:04:48 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@ciao.gmane.org Cancel-Lock: sha1:0BFchP+HKSnKPi29IZSLC7bwDcw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.228 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232559 Archived-At: > 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