From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Patch for fields of `struct buffer' Date: Mon, 14 Feb 2011 20:34:59 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1297712261 21639 80.91.229.12 (14 Feb 2011 19:37:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 14 Feb 2011 19:37:41 +0000 (UTC) Cc: tromey@redhat.com, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 14 20:37:36 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pp4Eq-00086H-0j for ged-emacs-devel@m.gmane.org; Mon, 14 Feb 2011 20:37:36 +0100 Original-Received: from localhost ([127.0.0.1]:32959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pp4Ep-0006XD-EO for ged-emacs-devel@m.gmane.org; Mon, 14 Feb 2011 14:37:35 -0500 Original-Received: from [140.186.70.92] (port=57747 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pp4Ef-0005vS-P0 for emacs-devel@gnu.org; Mon, 14 Feb 2011 14:37:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pp4E6-0000Nd-FF for emacs-devel@gnu.org; Mon, 14 Feb 2011 14:36:51 -0500 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:59693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pp4E3-00007J-AQ; Mon, 14 Feb 2011 14:36:47 -0500 Original-Received: by wwb17 with SMTP id 17so5265622wwb.30 for ; Mon, 14 Feb 2011 11:35:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=62RekzXu5mfL8B59xMa2CTR6lfjgrXitzM1Kfx+ZzWA=; b=C1uRmo4B1vO6ApXuNYhSXWh52hpfYj1SW48maOexVcZ0eWqU74+OTm0bbUN8v1xKPJ TAFG8Q+NlXBxSY1qRHEUWOC0TXpODsYrjx7y8ugUNqNXQFJ/fggSSEFf5uAIoHVq4fUI 6YLyxn8e7PL0ElN8q4IPO7w9YAZkqTQSomidE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=jbYMm27H1EXr6UUpCHnKUTuTmcd92dgoH8HCXaZ8j6O+C/6/ncR1IO+C3qJ0X0zOD/ lKLe013Y+8KMw/Y9SadiAYWyCZpnCnA61siiEAEz1R55r3fNY8mXawkbov/PSl3dN847 ML1ceX7WH7B/R6NhAlcUJMECiNwL+9YqUYLLQ= Original-Received: by 10.216.89.71 with SMTP id b49mr3587117wef.28.1297712121663; Mon, 14 Feb 2011 11:35:21 -0800 (PST) Original-Received: by 10.216.230.24 with HTTP; Mon, 14 Feb 2011 11:34:59 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:136014 Archived-At: On Mon, Feb 14, 2011 at 6:47 PM, Stefan Monnier wrote: >> =C2=A0 =C2=A0 I also expect some really nasty cases showing up when you = try to rewind >> =C2=A0 =C2=A0 a thread's bindings. =C2=A0E.g. if a let-binding that was = originally applied >> =C2=A0 =C2=A0 to a global variable has to be rewound (i.e. re-applied) t= o a variable >> =C2=A0 =C2=A0 that has become buffer-local in the mean time. > >> This issue arises now within the single Emacs thread, and we already >> handle it. > > Not really, because we never rewind, we only unwind. =C2=A0We do have to > solve related problems when unwinding, and indeed it is tricky and has > suffered from very long standing bugs. > >> I don't recall just how we do, but we hardly ever get a complaint >> about it. > > Gerd fixed in Emacs-21 a bug that was known for a long time (when you > sometimes had to do (let (blbla) (save-current-buffer ...)) to make sure > that the unwinding would take place in the same buffer as when the vars > were bound). =C2=A0Since then I've fixed another related bug in some less > common case, and someone else (can't remember who right now, Lennart > maybe?) found a third one (between Emacs-22 and 23). > For this last bug, I tried to do a "thorough code review" to try and > convince myself that we really did get it right this time, but > I wouldn't bet my life on it. > > AFAIK, none of those 3 bugs were related to new features, so getting > dynamic let-bindings to work right in the presence of buffer-local > variables has taken in the order of what ... 20 years? ;-) Is maybe a reason that those bugs that shows up in complicated relations are easily missed because you may believe that the bug is somewhere else - and that is "confirmed" when you fix something else. A problem is that those bugs tends to be more likely to show up the more complicated elisp code Emacs have to handle. I guess this make unit tests very important.