From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#7728: 24.0.50; GDB backtrace from abort Date: Thu, 13 Jan 2011 14:06:58 -0800 Message-ID: <5BBB2AD4CF5B4B66A75E12B8D7BBD637@us.oracle.com> References: <30041A5C411E45A7B7AF7A9ECA3AA0BE@us.oracle.com><83y67echvm.fsf@gnu.org> <837heopknq.fsf@gnu.org> <4D2D5E29.3010502@gmx.at> <26B139ADC64E4827BE54938B3CF26872@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1294957481 24740 80.91.229.12 (13 Jan 2011 22:24:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 13 Jan 2011 22:24:41 +0000 (UTC) Cc: 7728@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 13 23:24:36 2011 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.69) (envelope-from ) id 1PdVau-0001VS-4y for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jan 2011 23:24:36 +0100 Original-Received: from localhost ([127.0.0.1]:37655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdVat-0003Ua-Fm for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jan 2011 17:24:35 -0500 Original-Received: from [140.186.70.92] (port=38223 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdVah-0003RF-HX for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2011 17:24:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdVad-0004uG-Ly for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2011 17:24:23 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdVad-0004tf-JJ for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2011 17:24:19 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PdVE5-00031a-Og; Thu, 13 Jan 2011 17:01:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jan 2011 22:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7728 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7728-submit@debbugs.gnu.org id=B7728.129495605211610 (code B ref 7728); Thu, 13 Jan 2011 22:01:01 +0000 Original-Received: (at 7728) by debbugs.gnu.org; 13 Jan 2011 22:00:52 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PdVDv-00031D-0e for submit@debbugs.gnu.org; Thu, 13 Jan 2011 17:00:51 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PdVDt-000311-Hr for 7728@debbugs.gnu.org; Thu, 13 Jan 2011 17:00:50 -0500 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p0DM8G9u020525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Jan 2011 22:08:19 GMT Original-Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p0DLUjJK010326; Thu, 13 Jan 2011 22:08:15 GMT Original-Received: from abhmt004.oracle.com by acsmt353.oracle.com with ESMTP id 924028751294956417; Thu, 13 Jan 2011 14:06:57 -0800 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 13 Jan 2011 14:06:56 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcuzaEcKDw0BaFqXR0O8OdACrwEsoQAAXoLA In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 13 Jan 2011 17:01:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , 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:43338 Archived-At: > I'm just telling you what's the right way to do it. I appreciate that. But it's not related to what's needed to fix this bug. That's all I was trying to say. > > Sorry, but I have never, ever suffered from "those things". > > Then either you were lucky to only use the code after I fixed > it, or you don't know what I'm talking about. The typical > misuse looks like: > (save-window-excursion (let ((b (find-file "foo"))) blabla)) > instead of (let ((b (find-file-noselect "foo"))) blabla) > > I.e. call code that may modify the window-layout whereas what > the caller wants is something else, so he uses > save-window-excursion to "undo" those changes. But of course, > with pop-up-frames and friends, in many/most cases the code may > not only modify the window-layout but also create a new frame, > which can't really be undone because the creation > itself is already user-visible, and save-window-excursion > won't even try to undo it anyway. It's good to have that pointed out, of course. But no, I don't believe I've used `s-w-e' like that. I tend to use `find-file-noselect' much more than `find-file' anyway. I call `find-file' typically only from `find-file' wrapper commands and such. But I get your point. I expect that both you and I have come across places now and then where we needed to fix code because of interactions with frames. I don't think it's common that such source bugs stay hidden from us long, precisely because we use frames more than most people do. Problems such as you point out are, I imagine, more common with developers who test only in an environment where frames are _not_ used very much. It makes sense to draw special attention to such gotchas in that case. > > And `save-window-excursion' _has_ always been used for this kind of > > thing in Emacs AFAIK - revisionism notwithstanding. > > I didn't know that. Can you point at some examples? Nope, sorry. But you can imagine, I think, that before `with-selected-frame' existed `s-w-e' was used for similar use cases. ;-) However, grepping for `with-selected-frame' in the Emacs sources shows very few hits, and all of them correspond to code (e.g. function defs) that was inexistent in older releases (e.g. Emacs 20). So no, I don't see an example offhand where code that used `s-w-e' might have been "upgraded" to code that uses `with-selected-frame'. > You know I always consider any crash as a bug in the C code, even if > it's triggered by Elisp code. Yes, I hope (and assume) so. The question is whether the C fix will still allow the same behavior as previously. I really hope so. So let's please just assume here that (a) the source code I mentioned is not doing something ill-advised, verboten, off-the-wall, or silly wrt this bug, and (b) it doesn't need to be changed for things to work properly, but rather (c) the C code should be fixed so that such source code and its byte-compilation continues to work as before. I will help to diagnose things at my end if I can be of assistance, but let's please not concentrate on having the user source code be changed to effect a workaround. That `save-window-excursion', like other things in Emacs Lisp, can be misused or might otherwise not DTRT in some cases is not the question here. For my use case it DTRT, and has been doing it, for this code, for years. This code needs to work not just for my own setup (with a standalone minibuffer etc. - the case for the reported crash), but more importantly for other setups, including more common setups. It works well, I believe, so let's not worry here and now about improving it. That's all.