From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56110: 27+; switching from line-mode to char-mode Date: Sun, 26 Jun 2022 04:17:26 -0400 Message-ID: References: <875ykvs9gq.fsf@electra.home.arpa> <87wndaw84w.fsf@web.de> <87sfnyw6m7.fsf@web.de> <877d58obnn.fsf@web.de> <87k097mi81.fsf@web.de> <87wnd5aqdq.fsf@web.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35019"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: "C. Michailidis" , 56110@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 26 10:18:10 2022 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 1o5NT8-0008vJ-7j for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 10:18:10 +0200 Original-Received: from localhost ([::1]:58294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5NT7-0005IF-3h for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 04:18:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5NT0-0005I5-46 for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 04:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52785) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5NSz-0002VF-SB for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 04:18:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o5NSz-00061O-MT for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 04:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Jun 2022 08:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56110 X-GNU-PR-Package: emacs Original-Received: via spool by 56110-submit@debbugs.gnu.org id=B56110.165623146523125 (code B ref 56110); Sun, 26 Jun 2022 08:18:01 +0000 Original-Received: (at 56110) by debbugs.gnu.org; 26 Jun 2022 08:17:45 +0000 Original-Received: from localhost ([127.0.0.1]:46682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5NSj-00060u-Bq for submit@debbugs.gnu.org; Sun, 26 Jun 2022 04:17:45 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5NSg-00060g-Qu for 56110@debbugs.gnu.org; Sun, 26 Jun 2022 04:17:43 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C8834440858; Sun, 26 Jun 2022 04:17:36 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 89342440218; Sun, 26 Jun 2022 04:17:35 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656231455; bh=TRU9B1ndUtcQkN7U95fZzw1oqRr33mcSm44v62dhh4c=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=JzpPN0J2NdwlIUwri6wChaTVLrooj3qP3gNquPJtslwZ7Ju7Htdl4+BmCjONRhBY8 gqhcZzwW9MQKbutQK9UFW7fpnLQeCzwfMIXaYyGynbxbvM+bF+PtU6kG/Qibg7SI/D QGGGjvN5DqCoeJtUILDiQVi4MFong+aAtd6odEqxdFEAx4A+weAMlBWSIkb4UtAQIK zmHcVyA+hpJ4Ic1ypN+zOggnQwlckx6r+TX87/62DEiJleuU5JYLxde2ZOf8aHpkEt El2XmodI125GeGsEtLJkX7FLcQB/tWrdcq/RO5hBGDc2jELzagNGgzYkGYemPZ4Pqt XY0MERGy+Bt8w== Original-Received: from alfajor (165.63.10.93.rev.sfr.net [93.10.63.165]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C218712020D; Sun, 26 Jun 2022 04:17:34 -0400 (EDT) In-Reply-To: <87wnd5aqdq.fsf@web.de> (Michael Heerdegen's message of "Sat, 25 Jun 2022 14:17:53 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:235309 Archived-At: > First: Don't buffer local variables come with the same problem? The problem is somewhat orthogonal to buffer-local vs global, yes. > Second: When somebody changes a binding using `add/remove-function` with > a scope limited to the scope of my `let', we have no problem. Indeed. > So let's assume a global scope is wanted. Then that somebody still has > to figure out what exactly to add-function to, and if the currently seen > value is not the global one, or what the scope of the currently seen > binding is. Bindings can be local or buffer local. The same holds if they want to use `let` (except that it's a lot more difficult to let-bind the global value of a variable when there is a buffer-local value). > Then one has to figure out if the binding (variable), or the value is to > be modified. I don't understand what you mean by that. > You yourself got it wrong in this case. So using > `add/remove-function` is still absolutely nontrivial if I used > `add-function' instead of `let'. Yup. The purpose is not to protect you from your own errors, but to let you write code whose semantics is more precisely the ones you need such that the interaction with other code out there will be correct even for "unexpected" code. > Finally, what about variables that can be bound to functions but also > other types like strings? You can't use `add-function' on them, right? That's right (well, you still can if the variable currently holds a function, but it's less convenient in any case). Stefan