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: Thu, 23 Jun 2022 17:45:55 -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> 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="3460"; 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 Fri Jun 24 00:05:20 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 1o4Uwy-0000gc-1n for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jun 2022 00:05:20 +0200 Original-Received: from localhost ([::1]:33240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4Uww-0005ob-DR for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Jun 2022 18:05:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4UfH-0004A2-Vt for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2022 17:47:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4UfG-0008QU-Fr for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2022 17:47:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o4UfG-00089X-DZ for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2022 17:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Jun 2022 21:47:02 +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.165602076931278 (code B ref 56110); Thu, 23 Jun 2022 21:47:02 +0000 Original-Received: (at 56110) by debbugs.gnu.org; 23 Jun 2022 21:46:09 +0000 Original-Received: from localhost ([127.0.0.1]:40188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4UeO-00088Q-SK for submit@debbugs.gnu.org; Thu, 23 Jun 2022 17:46:09 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4UeL-00087n-GQ for 56110@debbugs.gnu.org; Thu, 23 Jun 2022 17:46:07 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9580E808A2; Thu, 23 Jun 2022 17:45:59 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3264880636; Thu, 23 Jun 2022 17:45:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656020758; bh=OO89aehSf9oKJsPIgE3XdIymog8ro5WlyYYE9V6/Cyg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=jkZeNUIBpqSw39/kENIyG65BOiPdtoOKmEw5VfgoPJcrh5OvUQv8UDaGRGlQmM6NA 5J0IIoPxVivqGCWVBnJEClHRNJ6WQR63+yGU65kud439Vup+4DXORBKOb10H4yDsYF xFNhoMOKszDqoJeVtOjvBFqenJGFvCHyOdX9UoqfMSTHWjCvZrm1427t1GLtb3CDCS A3QkqJ7zIrLwqXcXSiUtVkbX4AWSEEwnUuCiwMnI1BFN5qVHhBxyPWQC/pT0WoQz7+ nq25kJQqIJlVrmTDGR7hIe/KAxtlefKgmvLbDij7PizGs1Xgp2fv2Ms4+oOS+eB5JT IDidjw5QQEpTA== Original-Received: from alfajor (196.214.25.93.rev.sfr.net [93.25.214.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7B0901204B7; Thu, 23 Jun 2022 17:45:57 -0400 (EDT) In-Reply-To: <87k097mi81.fsf@web.de> (Michael Heerdegen's message of "Thu, 23 Jun 2022 18:56:30 +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:235140 Archived-At: > I want. The initial revision by Richard already looks like > > #+begin_src emacs-lisp > (unwind-protect > (progn > (setq term-input-sender (symbol-function 'term-send-string)) > (end-of-line) > (term-send-input)) > (setq term-input-sender save-input-sender)) > #+end_src I have no idea why it was written that way. There's been all kinds of bugs linked to `let` bindings interacting with buffer-local bindings, but that doesn't seem to explain it either. It's probably just an accident of history. >> If you don't, then `let` is not the same: e.g. if some other code uses >> `add/remove-function` on that variable within your `let`, their changes >> will be lost when your `let` ends. > Yeah, such things - but I don't think anything like this is crucial > here. So you prefer taking the risk that such a thing happens at some point in the future, or that someone copies this code without knowing what were your assumptions? Personally, I prefer using `add/remove-function` and stop worrying about those risks. After all, that's part of the reason why I developed them. Stefan