From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: master 48aacbf292 2/2: Make many seldom-used generalized variables obsolete Date: Sat, 10 Sep 2022 15:02:00 +0800 Message-ID: <87o7vnyaon.fsf@localhost> 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="7453"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "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 09:02:52 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 1oWuVw-0001kR-43 for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Sep 2022 09:02:52 +0200 Original-Received: from localhost ([::1]:52992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWuVu-00062v-RJ for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Sep 2022 03:02:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWuUI-0005FX-KK for emacs-devel@gnu.org; Sat, 10 Sep 2022 03:01:15 -0400 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:33540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWuUF-0001eJ-S9 for emacs-devel@gnu.org; Sat, 10 Sep 2022 03:01:10 -0400 Original-Received: by mail-pg1-x52c.google.com with SMTP id g4so3566972pgc.0 for ; Sat, 10 Sep 2022 00:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=0d8ExlUthXnsOxy8hY8bscmy+cHC2PhYZcci4ec1tc0=; b=IaJdtcMBjrPk7KAzxRVSaaZd8vIlzPfJNrirWhqceAHaFLfD4VFBnC+j59n+grDK7g Ua5SGojRAlGOUkwSPlBaqy7duu0JaSYbH7ONY2kUx8lDty4XiX6Xt1X7J3D33xCzUx3k USaze8Ul2gxMo4RggZ7kMK4NdJNqhrno41GhA8JFNBn+HAjqphYfET9rYoUzLS/JpfYb ENx4ATHrKwkQYtk7YbQzNN6k8GLbmT0fB0lFQgtYUv8CXcNArUUt8ymBBeroqNVdhSMl BzU71y9tGsScjBLmnNbzVeMsAcD7kApHiL8PZX27x68K+9XFklPfkxjRatXOP0m5E1l4 6nww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=0d8ExlUthXnsOxy8hY8bscmy+cHC2PhYZcci4ec1tc0=; b=OIC5u35NUTE5UkdfRNAXBrrikLtqw1UJw/sIZbgEjt/gm/AoCwsukTAQayE7fdSSSN d6t3U9B46wO7gLxkN8hlhBYlMRLNjeji3yOLVNJHyLCN22888ox2dFFJOFIcdAiGpzcJ jHw52o/PnuoUhPWvrwNERAh3sGlyMgx5eusE4iNk2/fbe2MxmFAdcY/lzTMDN93v5zab vHvLpt8O6WOITpS1NGQoaGuWEBPEtMQCdyY4rBQJJ6yJmvc0omSYVv3+PLUEkvUeyUTr pvVjf8j6ij7vhBmkJ+9WCKQwZREDJJj1He05lT7l4RIqdKJL4M3eS1q7QqlJa0esV92V Giww== X-Gm-Message-State: ACgBeo0bPkHWjUFEsFhdrpUZzKH7+YSSl/b3AcuzebNL47ltFaa172Jq mYVoQKzFUcNMI79mD+qxNTo= X-Google-Smtp-Source: AA6agR52jOLD9zerHtZmOZ54WbiHtLo0Pn+u4mSz/UFwcrdzL0f5RGF2ZyfSKW3C6QD+fGDrL5eyew== X-Received: by 2002:a63:4714:0:b0:42b:82d9:b617 with SMTP id u20-20020a634714000000b0042b82d9b617mr14725446pga.223.1662793266206; Sat, 10 Sep 2022 00:01:06 -0700 (PDT) Original-Received: from localhost ([1.83.154.15]) by smtp.gmail.com with ESMTPSA id e12-20020a17090301cc00b0016be834d54asm1493154plh.306.2022.09.10.00.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Sep 2022 00:01:05 -0700 (PDT) In-Reply-To: <877d2bohgm.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=yantar92@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:295108 Archived-At: Lars Ingebrigtsen writes: > "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. > > Just delete and insert instead Well. What about `replace-buffer-contents'? (For context, this is a very minor issue, and I am not pushing hard for it. Just a minor annoyance.) >> 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. > > I don't think anybody could guess what (setf (point-min) 2) actually > does without reading the expanded code. Sure, but not all the generalized variables were obsoleted. Do you claim that all the remaining generalized variables are simple enough to not require documentation? I am pretty sure that third-party setters may still do non-obvious things. Would it be possible to accept docstring in gv-define-setter and then display it in the help buffer for the relevant variable? -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92