From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master 48aacbf292 2/2: Make many seldom-used generalized variables obsolete Date: Sat, 10 Sep 2022 10:21:40 -0400 Message-ID: References: <166111278304.2846.13033924580993120733@vcs2.savannah.gnu.org> <20220821201303.AD1E6C0088A@vcs2.savannah.gnu.org> <877d2w1ua0.fsf@tcd.ie> <87pmgojy0m.fsf@gnus.org> <87tu5fzu2r.fsf@localhost> <877d2bohgm.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39849"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Ihor Radchenko , "Basil L. Contovounesios" , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 10 16:22:25 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oX1NI-000AEe-RE for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Sep 2022 16:22:25 +0200 Original-Received: from localhost ([::1]:43174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oX1NH-0003E0-Hx for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Sep 2022 10:22:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX1Mi-0002YC-0z for emacs-devel@gnu.org; Sat, 10 Sep 2022 10:21:48 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX1Mf-0005WE-QB for emacs-devel@gnu.org; Sat, 10 Sep 2022 10:21:47 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 86A38440157; Sat, 10 Sep 2022 10:21:43 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0DA47442423; Sat, 10 Sep 2022 10:21:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1662819702; bh=Q211jcMabp8T8JuAVPBT6pm7FFG6LMqVjkt/Kxp1Jps=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=UHA2MPJm90hZ3Bz2z6Q7UhukLsc7t81B1q8/fhOSH1f6E7gAo8AH98mfQ4uTekqGw sn3Rm67ovq1/9ikJ4/SpKNkqMclCwljIsLhxB9UJp9QthizJ5XWzFdzYk2vMPcCkHu iMxXXY6dIbF6QPhH6KBAWinN12cfuIKEklx0VYeVPsbRxZx6TtYfo6vR6J/iS22tDN 1wPTj9xSopOowIYkRiAsYVucvFRY0VXnw0SfAxWcj/JvGUwZ14URFKDTzmAnHCB1N3 oFk7QI7HjvrQiNAVXO1w/1wKhSvyYI1Um3AVNh6EVPDKtJkYmgxIskkRYeEXwbf6WA r0OdmOuoWCxxQ== Original-Received: from pastel (unknown [157.52.9.190]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9A3C11207FF; Sat, 10 Sep 2022 10:21:41 -0400 (EDT) In-Reply-To: <877d2bohgm.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 10 Sep 2022 08:45:45 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:295124 Archived-At: Lars Ingebrigtsen [2022-09-10 08:45:45] wrote: > Ihor Radchenko writes: >> This commit also obsoleted a number of generalized variables used by >> Org. In particular, `buffer-substring', and `buffer-string'. >> >> While it is indeed possible to set buffer contents without the above >> variables, it cannot (AFAIK) be done using a single function call. >> Would it be possible to provide a function replacement for setting a >> buffer text in the whole buffer/buffer region? > > "Setting a buffer text" is something that is un-Emacsey, in my opinion. > That is, (setf (buffer-substring ...) ...) is pretending that we're > operating on some object, but instead we're altering global (buffer) > state. Ihor doesn't specifically ask to keep the generalized variable, but to offer some straightforward replacement. > Just delete and insert instead That's indeed what `cl--set-buffer-substring` (the workhorse of the current gv-expander) does, but it's not ideal: it should insert first and then delete, so as to better preserve markers. For this reason, I do think we should provide a function to do that. >> Also, obsoleting `buffer-file-name' revealed one potentially concerning >> fact about generalized variables. The expansion of `buffer-file-name' >> setter, `set-visited-file-name' "... also renames the buffer to >> correspond to the new file." I am now wondering if there are any >> non-obvious side effects when using other generalized variables - there >> is (AFAIK) no documentation about what exactly various setters for >> generalized variables do other than occasional paragraph in the manual. > > All these obsoleted generalised variables had non-obvious side effects, > which is why I obsoleted them. +1 Stefan