From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#3467: 23.0.94; let + make-local-variable => let value made global Date: Sat, 6 Jun 2009 00:48:16 +0200 Message-ID: References: Reply-To: Lennart Borgman , 3467@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1244242675 32524 80.91.229.12 (5 Jun 2009 22:57:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jun 2009 22:57:55 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, 3467@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 06 00:57:51 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MCiM7-0001Wr-Ow for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Jun 2009 00:57:48 +0200 Original-Received: from localhost ([127.0.0.1]:58402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MCiM7-0005wK-CO for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jun 2009 18:57:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MCiLo-0005eY-OK for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2009 18:57:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MCiLj-0005bg-TT for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2009 18:57:28 -0400 Original-Received: from [199.232.76.173] (port=46178 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MCiLj-0005bO-Kd for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2009 18:57:23 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:45415) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MCiLi-0001Wp-NK for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2009 18:57:23 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n55MvIfc013937; Fri, 5 Jun 2009 15:57:19 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n55Mt7Yf013440; Fri, 5 Jun 2009 15:55:07 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Lennart Borgman Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 05 Jun 2009 22:55:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3467 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3467-submit@emacsbugs.donarmstrong.com id=B3467.124424210812662 (code B ref 3467); Fri, 05 Jun 2009 22:55:06 +0000 Original-Received: (at 3467) by emacsbugs.donarmstrong.com; 5 Jun 2009 22:48:28 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail-bw0-f205.google.com (mail-bw0-f205.google.com [209.85.218.205]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n55MmM5w012650 for <3467@emacsbugs.donarmstrong.com>; Fri, 5 Jun 2009 15:48:24 -0700 Original-Received: by bwz1 with SMTP id 1so2038071bwz.1 for <3467@emacsbugs.donarmstrong.com>; Fri, 05 Jun 2009 15:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ruI7zdqYEvJM+iHyH7qVhRoybgdczgvNw10Wq6Nit+o=; b=bazmt50qI3e8/7mxlxPKmllgYdD9HL2M6aVWlLlij1+0b/o68OCdsQ5A4+KjukJFnL A4V3hDNf2pfeeSTKR/w7jrE8NTdS39iX+1eiwc/G/hEmqXi7THSU3C71Fx8EMFcla6I4 fthJMMqkoNALP/2EdOJ7Q9uLS8okfRwiU0Z3E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bEY/j4IiceCWRo4g1CEuJ3CYnkirqbxnvBF/Kkif7gl8ZdkVL8Hkuqls2zxI42OLpB WNwNgGUPowq0/ZdN5+A2MBHVNliTr2OA6kuvqNoni7pr0mRdpo8wyjKAN+VeYm4hTyfH HJvRYQl8ctnzrfzroOIFMHldNToo2wIpuJSkM= Original-Received: by 10.239.179.6 with SMTP id b6mr292609hbg.161.1244242096862; Fri, 05 Jun 2009 15:48:16 -0700 (PDT) In-Reply-To: X-CrossAssassin-Score: 2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 05 Jun 2009 18:57:28 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:28514 gmane.emacs.pretest.bugs:24571 Archived-At: On Fri, Jun 5, 2009 at 5:04 PM, Lennart Borgman wrote: > On Fri, Jun 5, 2009 at 4:36 PM, Stefan Monnier = wrote: >>> If you eval these lines >>> =C2=A0 (defvar w14 "global") >>> =C2=A0 (defvar w15 "global") >>> =C2=A0 (let ((w14 "let") >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 (w15 "let")) >>> =C2=A0 =C2=A0 (set (make-local-variable 'w14) "local") >>> =C2=A0 =C2=A0 (message "w14 maybe let: in buffer=3D%S, global=3D%S" w14= (default-value 'w14)) >>> =C2=A0 =C2=A0 (message "w15 maybe let: in buffer=3D%S, global=3D%S" w15= (default-value 'w15))) >>> =C2=A0 (message "w14 top level: in buffer=3D%S, global=3D%S" w14 (defau= lt-value 'w14)) >>> =C2=A0 (message "w15 top level: in buffer=3D%S, global=3D%S" w15 (defau= lt-value 'w15)) >> >>> the output will be >> >>> =C2=A0 w14 maybe let: in buffer=3D"local", global=3D"let" >>> =C2=A0 w15 maybe let: in buffer=3D"let", global=3D"let" >>> =C2=A0 w14 top level: in buffer=3D"global", global=3D"let" >>> =C2=A0 w15 top level: in buffer=3D"global", global=3D"global" >> >>> All values here except w14 global value on next last line are arguably >>> correct. The last value of w14 should be "global", not "let". >> >>> It looks like perhaps the call to (make-local-variable w14) does not >>> mark the "global let" value of w14 as let bound (or removes that >>> mark). >> >> Given the way let-binding and buffer-local bindings are currently >> implemented, it's difficult to make it work correctly in all corner >> cases, and even more so without slowing down the common case. >> So don't hold your breath. > > I gave a suggestion in the next message for how to implement this: > Check buffer and frame localness before unbind_to in Flet. Would that > really be expensive? Sigh, and my suggestion was of course unnecessary stupid. What is needed is of course to record values and frame+buffer localness and dito values and reset them. Nothing less than this will ever work correctly, or? And does not this apply to all uses of specbind + unbind_to? Can it be sufficient to just change specbind and unbind_to? Is there anything else that will be affected by changes in the specbind stack? Since info about buffer+frame is alwas needed should specbinding be changed to the below form? struct specbinding { Lisp_Object symbol; Lisp_Object old_value; Lisp_Object old_buffer_value; Lisp_Object old_frame_value; specbinding_func func; Lisp_Object unused; /* Dividing by 16 is faster than by 12 */ Lisp_Object unused; Lisp_Object unused; }; Is this structure used by other functions than specbind and unbind_to?