From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.bugs Subject: bug#71370: 30.0.50; Please un-obsolete buffer-substring as a generalized variable Date: Wed, 19 Jun 2024 23:05:50 -0500 Message-ID: <545868c6-1a14-4a3f-9939-da2477c0a902@alphapapa.net> References: <87iky4zedz.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25391"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 71370@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 20 06:06:38 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sK94G-0006II-PG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Jun 2024 06:06:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sK93l-0004SG-Bk; Thu, 20 Jun 2024 00:06:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sK93g-0004S0-Fy for bug-gnu-emacs@gnu.org; Thu, 20 Jun 2024 00:06:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sK93f-00023n-32 for bug-gnu-emacs@gnu.org; Thu, 20 Jun 2024 00:06:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sK93i-0007FW-DC for bug-gnu-emacs@gnu.org; Thu, 20 Jun 2024 00:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Adam Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Jun 2024 04:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71370 X-GNU-PR-Package: emacs Original-Received: via spool by 71370-submit@debbugs.gnu.org id=B71370.171885636127859 (code B ref 71370); Thu, 20 Jun 2024 04:06:02 +0000 Original-Received: (at 71370) by debbugs.gnu.org; 20 Jun 2024 04:06:01 +0000 Original-Received: from localhost ([127.0.0.1]:42147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK93h-0007FH-9c for submit@debbugs.gnu.org; Thu, 20 Jun 2024 00:06:01 -0400 Original-Received: from bird.elm.relay.mailchannels.net ([23.83.212.17]:27865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK93e-0007F4-IF for 71370@debbugs.gnu.org; Thu, 20 Jun 2024 00:06:00 -0400 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D401C4C43D6; Thu, 20 Jun 2024 04:05:52 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a234.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E33184C43D9; Thu, 20 Jun 2024 04:05:51 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1718856351; a=rsa-sha256; cv=none; b=bh9dfZZk6fayVvGpS8TmOU7J/SXjVZ5wHntseE3NnBhzeLkd6EQDz+foUMkXXfPzgCI1kK 5UojLE2oCbu7q6dgMxlWspXVjNTc2yrZ09NxjRgHbmeDrkjz5l9TrDwrMfkZwlAyGuRP3P 7aloqkiMmqRaCbvCL84C4cvu3EFez+QC8DEB5fSbKUyeu2lUZXRa6Q+xpjN5zHhqRxr7ye 1chAtIA/Lu7siHyoOFaPtx7fbTKBT+xdGdZOpoG4BYlqWuVuD0qoleBneRKAq7LwqHe1OK GHowNnNWPaJgmPAvAks/FjkKF/ZQlzPurs198ncp4FrwWWRYceOddPtSEZzQ2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1718856351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Wu9j7d9DwINXxKiqCCD/waiqI+crHB9cDZI1zVNMocg=; b=GSzDJoX3KC7ayrxh/ZELha1L4KIagaZd+KTbhPkI8BC/qjHsp08dTBUM0OZR51d3/uQhFT nkAk2XoAG8++a4s9dj+aFEljEZKH36tiywEZzDvctnAz9am4D0SXdZNvGPnG+vbkRe8KKU DDomVR26NEy5ACch6nM8pQLAJ7XS+A0CKjfloWnGKWLTLkm+p5UqP3rTZVjPidChEqZKbD dcGIeAbmjDoOcYxL4bX/+sMsEudTuEvBBVWpdUvj4nTsC1OsyEORfU/9+cBnurg3LXz8A5 dtNoHl7kNkli6Ukt3IhLyugiG2c7bovMVWBOCwSEmItj0PbVPP/bHvGvJoWDdw== ARC-Authentication-Results: i=1; rspamd-7f76976655-9hqsp; auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net X-MailChannels-Auth-Id: dreamhost X-Army-Abortive: 0bc943a14165bfdf_1718856352741_860903619 X-MC-Loop-Signature: 1718856352741:626584412 X-MC-Ingress-Time: 1718856352741 Original-Received: from pdx1-sub0-mail-a234.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.114.240.136 (trex/6.9.2); Thu, 20 Jun 2024 04:05:52 +0000 Original-Received: from [10.130.113.13] (unknown [45.92.229.138]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: adam@alphapapa.net) by pdx1-sub0-mail-a234.dreamhost.com (Postfix) with ESMTPSA id 4W4Rjq2q4hzd0; Wed, 19 Jun 2024 21:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1718856351; bh=Wu9j7d9DwINXxKiqCCD/waiqI+crHB9cDZI1zVNMocg=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=WHZPG0iFEpxHIuVFOdjOx6fLKUrcny+nih1h+Ls+rQVedkuY7vozpwG7GfZQTy0S/ tm/XHgbMnGPQXoFNJTr3MkVGLCC7+m8k4vm7bf3leUCYfHWsSCghJISPDvVlvPZTrl HFI0HnQdWVW+hIIG91VMQcb6BDzzlaL2yGCHCv4Lwzx2LzdTxP0dL0vv5z80tmaxR6 /rMWFJKp9NPwEGaIEHTJr6hvVrOcwLQp78HWmE5hWXwpw0Jl309qkbsbu5RbJnT5kX QqFOz19btlZM6LCN3+kOW2UVFRfHYwYvFsy56CDRB9lETV9PxbVhG0dF9X0eHUKoPC mxN0XNvuVVkSQ== Content-Language: en-US In-Reply-To: <87iky4zedz.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287522 Archived-At: Hi Michael, On 6/19/24 18:44, Michael Heerdegen wrote: > Adam Porter writes: > >> ┌──── >> │ (let ((inhibit-read-only t)) >> │ (setf (buffer-substring (oref (magit-current-section) start) >> │ (oref (magit-current-section) end)) >> │ "foobar\n")) >> └──── >> >> Otherwise, one would have to use `delete-region' and then `insert', >> which is more cumbersome and error-prone. > > I guess alternatively you could define a helper function and make that > `setf'able, like > > #+begin_src emacs-lisp > (defalias 'magit-buffer-substring #'buffer-substring) > (gv-define-simple-setter magit-buffer-substring > cl--set-buffer-substring) > #+end_src I guess one could, but that would seem like making use of the marked-obsolete functionality in a roundabout way, and I'd guess that if it were eventually deprecated and removed, that would stop working, too (which one could work around by importing all of the old code, but it would be simpler to not obsolete it in the first place). --Adam, who will one day be marked obsolete, but whose time has not yet come, either. ;)