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: Sat, 17 Jun 2017 13:10:20 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="001a113e1e7e5799bb055227a00f" X-Trace: blaine.gmane.org 1497705081 19109 195.159.176.226 (17 Jun 2017 13:11:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Jun 2017 13:11:21 +0000 (UTC) To: 26624@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 17 15:11:17 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 1dMDVR-0004Fd-UH for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Jun 2017 15:11:14 +0200 Original-Received: from localhost ([::1]:34666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMDVR-0004Es-RR for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Jun 2017 09:11:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMDVJ-0004Ed-Lt for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 09:11:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMDVG-0001ct-73 for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 09:11:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMDVG-0001cn-0l for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 09:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dMDVF-00029d-Kp for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 09:11: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: Sat, 17 Jun 2017 13:11: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.14977050398255 (code B ref 26624); Sat, 17 Jun 2017 13:11:01 +0000 Original-Received: (at 26624) by debbugs.gnu.org; 17 Jun 2017 13:10:39 +0000 Original-Received: from localhost ([127.0.0.1]:52231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dMDUt-000294-EV for submit@debbugs.gnu.org; Sat, 17 Jun 2017 09:10:39 -0400 Original-Received: from mail-ot0-f173.google.com ([74.125.82.173]:34941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dMDUr-00028r-TL for 26624@debbugs.gnu.org; Sat, 17 Jun 2017 09:10:38 -0400 Original-Received: by mail-ot0-f173.google.com with SMTP id u13so31022295otd.2 for <26624@debbugs.gnu.org>; Sat, 17 Jun 2017 06:10:37 -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; bh=ZDBfxDEQHDiYrdyaKXlX+ZDoWn+VwRRxBCv2nC7edCQ=; b=PB1ENeZbEXcjZ1fWvmgPx1wWdESeKfPoXn/pFGurtR93SbtztsPbyYy2j1ARNLhr// ND1v7RLVLKJmBZC6pBff2wym0Hmn/ki/KKCmtNMkIV9XxymwbF1Xpf8sV6j0KRK0LCu+ 0rI+y1vp0dSKiv/0d9kjUQOr7/Ur4jIAWbnp7mD8h6cQCob9Z49Pi+Jaxs2HCY90Iq6P fgpMvhL4etBZ5MzXKxfGSBELlBqW4oZ55H7BQU9qSRMKTsxN3t0PSgBnb8dX4CZyJZFq DFb+ZTukLLau9hwF92JMW0g9o3sj54ULF+rqknK7WRo2y6+9RwD7vPphCc+TiyBCKZal Ot9A== 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; bh=ZDBfxDEQHDiYrdyaKXlX+ZDoWn+VwRRxBCv2nC7edCQ=; b=sR8+d6YbcJbdOztCKlEtVA1Xg1C1h0cmEqvc/ebhkQGvodq50vvEhb8LqAk8cp52Ez zXjtlanRdZ0KsPD52pNLDAsk7xUpBPwIyOQpEkn2q4MOnkFCkJhjMlaLtSTVMQSILb04 24JvMr1laU6VgyblQOS45VAgqqA3ozd0e1NQJKX3TFXeHn59z6JvPPuOpt7nM8T+XDxe ywzXeHBbV4oTovGf9hugo7TsZDRmolH8ikUhlYuhCXbOXcyvrT2tgVGz/Kn8IRhHwB7p N4rd6sJBVUurY1WjLnhx+V0XQZNLni4yzI/XCR32kCYStVH7ZN9Fekw7jKzg2sTkt0G8 5eRw== X-Gm-Message-State: AKS2vOwrHg4ABjlU7vRB7vs+RajcgOXTTZOnLpzMQ8MuLNnTXSCcXg1D Sp1s8g8I2FvDBsVlk2jDYsIaRL2fusVk X-Received: by 10.157.24.51 with SMTP id b48mr7969239ote.143.1497705030840; Sat, 17 Jun 2017 06:10:30 -0700 (PDT) In-Reply-To: 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:133696 Archived-At: --001a113e1e7e5799bb055227a00f Content-Type: multipart/alternative; boundary="001a113e1e7e5799b6055227a00d" --001a113e1e7e5799b6055227a00d Content-Type: text/plain; charset="UTF-8" Philipp Stephani schrieb am So., 23. Apr. 2017 um 19:14 Uhr: > > In *scratch*, evaluate: > > (defvar foo-test-var nil) > (with-temp-buffer > (list (list (buffer-local-value 'foo-test-var (current-buffer)) > (local-variable-p 'foo-test-var) > (local-variable-if-set-p 'foo-test-var)) > (cl-letf (((buffer-local-value 'foo-test-var (current-buffer)) > 123)) > (list (buffer-local-value 'foo-test-var (current-buffer)) > (local-variable-p 'foo-test-var) > (local-variable-if-set-p 'foo-test-var))) > (list (buffer-local-value 'foo-test-var (current-buffer)) > (local-variable-p 'foo-test-var) > (local-variable-if-set-p 'foo-test-var)))) > > The result is: > > ((nil nil nil) (123 t t) (nil t t)) > > But expected is: > > ((nil nil nil) (123 t t) (nil nil nil)) > > i.e. the local flag of the variable should be reset. > > 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. --001a113e1e7e5799b6055227a00d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am So., 23. Apr. 2017 um 19:14=C2=A0Uhr:

In *scratch*, evaluate:

(defvar foo-test-var nil)
(with-temp-buffer
=C2=A0 (list (list (buffer-local-value 'foo-test-var (current-buffer))<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (local-variable-p 'foo= -test-var)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (local-variable-if-set-p &= #39;foo-test-var))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (cl-letf (((buffer-local-value 'foo-test-va= r (current-buffer)) 123))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (list (buffer-local-value 'foo-test-= var (current-buffer))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (local-variable-p &= #39;foo-test-var)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (local-variable-if-= set-p 'foo-test-var)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (list (buffer-local-value 'foo-test-var (cu= rrent-buffer))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (local-variable-p 'foo= -test-var)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (local-variable-if-set-p &= #39;foo-test-var))))

The result is:

((nil nil nil) (123 t t) (nil t t))

But expected is:

((nil nil nil) (123 t t) (nil nil nil))

i.e. the local flag of the variable should be reset.


It's possible to fix this (see attache= d 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 al= l without breaking other stuff.=C2=A0
--001a113e1e7e5799b6055227a00d-- --001a113e1e7e5799bb055227a00f Content-Type: text/plain; charset="US-ASCII"; name="0001-Have-cl-letf-restore-buffer-local-status-Bug-26624.txt" Content-Disposition: attachment; filename="0001-Have-cl-letf-restore-buffer-local-status-Bug-26624.txt" Content-Transfer-Encoding: base64 Content-ID: <15cb62bd81f3568ecbb1> X-Attachment-Id: 15cb62bd81f3568ecbb1 RnJvbSAzNzg5YjdiODQzZWM0MTdhZTNiZTVkMGYyNDQwOTU1OWE0NmJjYzkzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwIFN0ZXBoYW5pIDxwaHN0QGdvb2dsZS5j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mRvdy1wb2ludCAsdyAs dikpCiAoZ3YtZGVmaW5lLXNldHRlciB3aW5kb3ctc3RhcnQgKHYgJm9wdGlvbmFsIHcpIGAoc2V0 LXdpbmRvdy1zdGFydCAsdyAsdikpCiAKLShndi1kZWZpbmUtc2V0dGVyIGJ1ZmZlci1sb2NhbC12 YWx1ZSAodmFsIHZhciBidWYpCi0gIChtYWNyb2V4cC1sZXQyIG5pbCB2IHZhbAotICAgIGAod2l0 aC1jdXJyZW50LWJ1ZmZlciAsYnVmIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgLHZhcikgLHYp KSkpCisoZ3YtZGVmaW5lLWV4cGFuZGVyIGJ1ZmZlci1sb2NhbC12YWx1ZQorICAobGFtYmRhIChk byB2YXIgYnVmKQorICAgIChtYWNyb2V4cC1sZXQyKiBuaWwgKCh2YXIgdmFyKSAoYnVmIGJ1Zikp CisgICAgICAoZnVuY2FsbCBkbworICAgICAgICAgICAgICAgYChpZiAobG9jYWwtdmFyaWFibGUt cCAsdmFyICxidWYpCisgICAgICAgICAgICAgICAgICAgIChidWZmZXItbG9jYWwtdmFsdWUgLHZh ciAsYnVmKQorICAgICAgICAgICAgICAgICAgIzE9JyM6dW5ib3VuZCkKKyAgICAgICAgICAgICAg IChsYW1iZGEgKHZhbCkKKyAgICAgICAgICAgICAgICAgYCh3aXRoLWN1cnJlbnQtYnVmZmVyICxi dWYKKyAgICAgICAgICAgICAgICAgICAgKGlmIChlcSAsdmFsICMxIykKKyAgICAgICAgICAgICAg ICAgICAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICx2YXIpCisgICAgICAgICAgICAgICAgICAg ICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJsZSAsdmFyKSAsdmFsKSkpKSkpKSkKIAogKGd2LWRl ZmluZS1leHBhbmRlciBhbGlzdC1nZXQKICAgKGxhbWJkYSAoZG8ga2V5IGFsaXN0ICZvcHRpb25h bCBkZWZhdWx0IHJlbW92ZSkKZGlmZiAtLWdp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gICAgICAgICAgICAgIChwcm9n biAoY2wtaW5jZiBidWYtY2FsbHMpIChjdXJyZW50LWJ1ZmZlcikpKQorICAgICAgICAgICAgICAg ICAndW5ib3VuZCkpCisgICAgICAgIChzaG91bGQgKGVxdWFsIChidWZmZXItbG9jYWwtdmFsdWUg J2d2LXRlc3RzLS12YXIgKGN1cnJlbnQtYnVmZmVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAg J3VuYm91bmQpKQorICAgICAgICAoc2hvdWxkIChsb2NhbC12YXJpYWJsZS1wICdndi10ZXN0cy0t dmFyKSkKKyAgICAgICAgKHNob3VsZCAobG9jYWwtdmFyaWFibGUtaWYtc2V0LXAgJ2d2LXRlc3Rz LS12YXIpKSkKKyAgICAgIChzaG91bGQgKGVxdWFsIChidWZmZXItbG9jYWwtdmFsdWUgJ2d2LXRl c3RzLS12YXIgKGN1cnJlbnQtYnVmZmVyKSkKKyAgICAgICAgICAgICAgICAgICAgICdkZWZhdWx0 KSkKKyAgICAgIChzaG91bGQtbm90IChsb2NhbC12YXJpYWJsZS1wICdndi10ZXN0cy0tdmFyKSkK KyAgICAgIChzaG91bGQtbm90IChsb2NhbC12YXJpYWJsZS1pZi1zZXQtcCAnZ3YtdGVzdHMtLXZh cikpCisgICAgICAoc2hvdWxkIChlcXVhbCB2YXItY2FsbHMgMSkpCisgICAgICAoc2hvdWxkIChl cXVhbCBidWYtY2FsbHMgMSkpKSkpCisKKzs7OyBndi10ZXN0cy5lbCBlbmRzIGhlcmUKLS0gCjIu MTMuMQoK --001a113e1e7e5799bb055227a00f--