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, 02 Jul 2017 16:53:33 +0000 Message-ID: References: <87zid6udys.fsf@drachen> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1137da0645c6110553587e7d" X-Trace: blaine.gmane.org 1499014468 1267 195.159.176.226 (2 Jul 2017 16:54:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Jul 2017 16:54:28 +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 Jul 02 18:54:22 2017 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 1dRi8P-0007vd-WA for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Jul 2017 18:54:10 +0200 Original-Received: from localhost ([::1]:58645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRi8V-0006J2-4k for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Jul 2017 12:54:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRi8N-0006Iv-BR for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2017 12:54:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRi8I-0002Kc-EL for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2017 12:54:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46280) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dRi8I-0002KP-9P for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2017 12:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dRi8H-0007db-Ta for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2017 12:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Jul 2017 16:54: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.149901443129343 (code B ref 26624); Sun, 02 Jul 2017 16:54:01 +0000 Original-Received: (at 26624) by debbugs.gnu.org; 2 Jul 2017 16:53:51 +0000 Original-Received: from localhost ([127.0.0.1]:48957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRi87-0007dD-HZ for submit@debbugs.gnu.org; Sun, 02 Jul 2017 12:53:51 -0400 Original-Received: from mail-oi0-f47.google.com ([209.85.218.47]:36748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRi86-0007cy-3F for 26624@debbugs.gnu.org; Sun, 02 Jul 2017 12:53:50 -0400 Original-Received: by mail-oi0-f47.google.com with SMTP id x187so10236105oig.3 for <26624@debbugs.gnu.org>; Sun, 02 Jul 2017 09:53:49 -0700 (PDT) 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=FjlZdnO1Jn5HbS6Y8ot5ANMkbLGaDNbC3TUZUkP+jZA=; b=qUbdwQ5VqJJksbVQuHFE6vOs8IueXlqu2lvo2STR/0uEWNzuQEksTBPVSpjkuzFfy9 pciZBRoUYPYmuoSMfC/F46idUe5my3tEHZXu9VLfulwdRZLFAcnm8JG/qjyrslGuNJYM v+VefXTg332IvvdHLnDdtYOex67+ISH2KeTIQcEXQimRmkupXGfOsbpimEFWJ3+tAE5W iMntdUch5X3oQsultPk9RCpyJbSam7M2iOOxm0lEJe1YAeG2cXnLrIN3oWYGxWbw0fHp jJyDVtikSBH59RScgi9AnrfuTeKXQr7HfTxGTzueIi3HEC0mZtnYAOQOhD3tHi6B4FaT ODsw== 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=FjlZdnO1Jn5HbS6Y8ot5ANMkbLGaDNbC3TUZUkP+jZA=; b=oJZZ1Akv0+ylB14tkzu9tVRI9N2wWHaQg7rADdUS+l/icWOSHq2j3Isgidd3S2hglO 4viyIaRl1oF3/Ewmdj50BVPmGlB5SfG82mLavRTgufOPzqow9K+oCGhK4tp/+K6LNu+H xGATlojvplRScgrpP7Te0X3560TkV835/RT5GGVvBPBF1vXsdJ1HH7xRGH7QS4BXuELR B2UhHHaOlZeIcD9ob/V2ezC6CxnC7ReoqfbfraTMda9KW/34218RQ+hQbOxNghrK38A3 z6aCqt3ep5oViEbDv1KePm83PrTZ3n8T748MXZB9M5SQCyTCcM42NK0C81UEX/B4dolN wsmQ== X-Gm-Message-State: AKS2vOxjAuHyEIbafgI3qwmcJ6kSlauDCe850/XocTC93EdLUqHaP3VL TIVIRADBCppjovSWrCaiB5S8O6eYSw== X-Received: by 10.202.244.215 with SMTP id s206mr15714689oih.25.1499014424281; Sun, 02 Jul 2017 09:53:44 -0700 (PDT) In-Reply-To: <87zid6udys.fsf@drachen> 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:134098 Archived-At: --001a1137da0645c6110553587e7d Content-Type: text/plain; charset="UTF-8" Michael Heerdegen schrieb am So., 18. Juni 2017 um 06:17 Uhr: > Philipp Stephani writes: > > > It's possible to fix this (see attached patch), but at the expense of > > breaking other valid use cases such as (cl-incf (buffer-local-value > > ...)). Not sure whether the bug can be fixed at all without breaking > > other stuff. > > I have no solution, but some thoughts. > > The more I think about it, the more I come to the conclusion that > `buffer-local-value' does not have a well defined according place. > > The function `buffer-local-value' is not injective: it maps different > states to the same value because it can't express whether the VARIABLE's > binding is buffer-local or not. But we need this information because we > need to undo creating a buffer local binding in the setter when closing > the `letf'. > > And the setter, accepting only a value for the binding, isn't > surjective, because the argument doesn't hold any information of > buffer-localness. Moreover, we want the setter to always create a > buffer-local binding in one situation (setf), but this isn't true for > the setter we need to use for `cl-letf'. > > We could widen the semantics of `cl-letf' to do what we want in this > case, but I'm not sure if it's worth the trouble. Not if there are more > cases like this. > > Thanks for this great analysis. Given this, it seems that the place definition for `buffer-local-value' should be removed from gv.el. --001a1137da0645c6110553587e7d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Michae= l Heerdegen <michael_heerdeg= en@web.de> schrieb am So., 18. Juni 2017 um 06:17=C2=A0Uhr:
Philipp Stephani <p.stephani2@gmail.com> writes:<= br>
> It's possible to fix this (see attached patch), but at the expense= of
> breaking other valid use cases such as (cl-incf (buffer-local-value > ...)). Not sure whether the bug can be fixed at all without breaking > other stuff.

I have no solution, but some thoughts.

The more I think about it, the more I come to the conclusion that
`buffer-local-value' does not have a well defined according place.

The function `buffer-local-value' is not injective: it maps different states to the same value because it can't express whether the VARIABLE&= #39;s
binding is buffer-local or not.=C2=A0 But we need this information because = we
need to undo creating a buffer local binding in the setter when closing
the `letf'.

And the setter, accepting only a value for the binding, isn't
surjective, because the argument doesn't hold any information of
buffer-localness.=C2=A0 Moreover, we want the setter to always create a
buffer-local binding in one situation (setf), but this isn't true for the setter we need to use for `cl-letf'.

We could widen the semantics of `cl-letf' to do what we want in this case, but I'm not sure if it's worth the trouble.=C2=A0 Not if ther= e are more
cases like this.


Thanks for this great analysis. Given = this, it seems that the place definition for `buffer-local-value' shoul= d be removed from gv.el.
--001a1137da0645c6110553587e7d--