From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#26624: 26.0.50; Generalized variable `buffer-local-value' does't restore local flag Date: Sun, 04 Feb 2018 19:01:15 +0000 Message-ID: References: <87zid6udys.fsf@drachen> <87mv13mim5.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1147dcfe81228905646792bf" X-Trace: blaine.gmane.org 1517770834 11205 195.159.176.226 (4 Feb 2018 19:00:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Feb 2018 19:00:34 +0000 (UTC) Cc: 26624@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 04 20:00:29 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiPWJ-0001Mm-Lt for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Feb 2018 20:00:07 +0100 Original-Received: from localhost ([::1]:55430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiPYK-0002It-GX for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Feb 2018 14:02:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiPYD-0002I4-Nt for bug-gnu-emacs@gnu.org; Sun, 04 Feb 2018 14:02:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiPYA-0004b5-LB for bug-gnu-emacs@gnu.org; Sun, 04 Feb 2018 14:02:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49438) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eiPYA-0004av-GL for bug-gnu-emacs@gnu.org; Sun, 04 Feb 2018 14:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eiPY9-0007Oa-Tw for bug-gnu-emacs@gnu.org; Sun, 04 Feb 2018 14:02:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Feb 2018 19:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26624 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26624-submit@debbugs.gnu.org id=B26624.151777089428388 (code B ref 26624); Sun, 04 Feb 2018 19:02:01 +0000 Original-Received: (at 26624) by debbugs.gnu.org; 4 Feb 2018 19:01:34 +0000 Original-Received: from localhost ([127.0.0.1]:57335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiPXh-0007Nn-Le for submit@debbugs.gnu.org; Sun, 04 Feb 2018 14:01:33 -0500 Original-Received: from mail-lf0-f51.google.com ([209.85.215.51]:46817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiPXf-0007Nb-Sv for 26624@debbugs.gnu.org; Sun, 04 Feb 2018 14:01:32 -0500 Original-Received: by mail-lf0-f51.google.com with SMTP id q194so38725289lfe.13 for <26624@debbugs.gnu.org>; Sun, 04 Feb 2018 11:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YWeHbmk2UKue9segs+RsUtqaTF5E83BMbKaBwMzrCqs=; b=rym1s0gudg5bmCr3VfTHkDPx3eWpIY5ZP/BGRaW5LVM5PbMFoBr7wCbmV7WDNUkF+J cSFDZjvzPpkMp+PpU+q21we8fVGtvS1Ch6JPy7EQFfpcc66Xwm3MigLsYbnlVQ41W2g5 WIbjyprL5O7XkgWs0qDovXLaYJ8eMhMruwb4qVW3pZHx7wcas7F+BYfeAMsJtX9S60Q3 de08XpeGglNaBmpQg+l5IViqdwGO4L3a8RkaA5x+Zget3ZGaBPOoY4wAQABQBiQp7hJq WQZ22nx+DAN+8D6WA32W3uyE/5R3rjzoI4N9z2p1P22xgzmwfwQWTjOJTCO8XE611EKz MliA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YWeHbmk2UKue9segs+RsUtqaTF5E83BMbKaBwMzrCqs=; b=leLcrDbXn8ihsPegg9oRxUyIR38fu2MKiNNDnkQiMd/cLNvxuEVur+Ez92OqHB4bbH sydzwZxCXy9nspl/8QqaB+7WGjTCafGn6GPuzw/E3iQGbO6J8EqQMFMx1WR3NFOqv35k 0YruawqvT0XuM8iRlK7xiZKsfpdcDJ/z40iJoOQgeZfAtUx23MT60J9yrg88ekLcDxsh A8upQX77AuRofYLnildTsp8efd1z7Kb+RpBSAivWcEtGiK+ttU8sq1uoqtQo8MC0sW7O LliIDb5ssVwXhRwsjlt3PGuDY3HsPWKUeX0lLBt58kPcAwGt87n0+q714i3JrKS8O43r oNRQ== X-Gm-Message-State: AKwxytc+EaBvUqP9sEf/4xFnJC35kFKMbwQeuDWfvAmeaPoH1X9HxykP vUd4Dcg8ssIv9PmxwJtBMA99pVi11HV5tTMrbx8= X-Google-Smtp-Source: AH8x227n18TDqVpVa5j52EZBoCj74i8kvSYC431e8I1OclkF7/9qqHtAKx+W2+TNAPDm3dHvIBgmTXmUUSA+9GecOdE= X-Received: by 10.25.149.143 with SMTP id x137mr30421011lfd.119.1517770885897; Sun, 04 Feb 2018 11:01:25 -0800 (PST) In-Reply-To: <87mv13mim5.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142899 Archived-At: --001a1147dcfe81228905646792bf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Michael Heerdegen schrieb am Mi., 24. Jan. 2018 um 15:33 Uhr: > Philipp Stephani writes: > > > Thanks for this great analysis. Given this, it seems that the place > > definition for `buffer-local-value' should be removed from gv.el. > > But hmm - surely there are other functions where `cl-letf' doesn't > exactly restore the previous state - `alist-get', for example: > > #+begin_src emacs-lisp > (setq my-alist '((x . 1))) > (ignore (cl-letf (((alist-get 'y my-alist) 17)) my-alist)) > my-alist > =3D=3D> ((y) (x . 1)) > #+end_src > > (admittedly, this is not as serious as the `buffer-local-value' case). > Also, as another, different problematic case, the manual warns about > `point' to be used with `cl-letf'. > > So, I wonder if, instead of removing the gv-setter definition for > `buffer-local-value', we should instead add some more text about how > `cl-letf' can have surprising effects to the manual. > > > I think we should spend significant efforts to avoid surprises. In this case, if it means we should remove `alist-get' as well from the forms supported by `cl-letf', then I think that's what we should do. The documentation for `cl-letf' clearly states: "On exit, either normally or because of a =E2=80=98throw=E2=80=99 or error, the PLACEs are set back to t= heir original values." If it can't do that for some place form, it shouldn't be allowed. --001a1147dcfe81228905646792bf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Michae= l Heerdegen <michael_heerdeg= en@web.de> schrieb am Mi., 24. Jan. 2018 um 15:33=C2=A0Uhr:
Philipp Stephani <p.stephani2@gmail.com> writes:<= br>
> Thanks for this great analysis. Given this, it seems that the place > definition for `buffer-local-value' should be removed from gv.el.<= br>
But hmm - surely there are other functions where `cl-letf' doesn't<= br> exactly restore the previous state - `alist-get', for example:

#+begin_src emacs-lisp
(setq my-alist '((x . 1)))
(ignore (cl-letf (((alist-get 'y my-alist) 17)) my-alist))
my-alist
=3D=3D> ((y) (x . 1))
#+end_src

(admittedly, this is not as serious as the `buffer-local-value' case).<= br> Also, as another, different problematic case, the manual warns about
`point' to be used with `cl-letf'.

So, I wonder if, instead of removing the gv-setter definition for
`buffer-local-value', we should instead add some more text about how `cl-letf' can have surprising effects to the manual.



I think we should spend significant ef= forts to avoid surprises. In this case, if it means we should remove `alist= -get' as well from the forms supported by `cl-letf', then I think t= hat's what we should do. The documentation for `cl-letf' clearly st= ates: "On exit, either normally or
because of a =E2=80=98thr= ow=E2=80=99 or error, the PLACEs are set back to their original
v= alues." If it can't do that for some place form, it shouldn't = be allowed.
--001a1147dcfe81228905646792bf--