From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-trunk-diffs] Changes to emacs/src/sysdep.c Date: Sun, 05 Dec 2004 17:33:27 -0500 Message-ID: <87acss4c0y.fsf-monnier+emacs@gnu.org> References: <87hdnb9f4m.fsf-monnier+emacs@gnu.org> <878y8cze6i.fsf@jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1102286010 5452 80.91.229.6 (5 Dec 2004 22:33:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 5 Dec 2004 22:33:30 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 05 23:33:25 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cb4wX-0003Ox-00 for ; Sun, 05 Dec 2004 23:33:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cb56G-00089P-5B for ged-emacs-devel@m.gmane.org; Sun, 05 Dec 2004 17:43:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Cb568-00088o-S3 for emacs-devel@gnu.org; Sun, 05 Dec 2004 17:43:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Cb567-00088J-UD for emacs-devel@gnu.org; Sun, 05 Dec 2004 17:43:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cb567-000889-QQ for emacs-devel@gnu.org; Sun, 05 Dec 2004 17:43:19 -0500 Original-Received: from [209.226.175.54] (helo=tomts10-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cb4wN-0000Pv-97; Sun, 05 Dec 2004 17:33:15 -0500 Original-Received: from alfajor ([67.68.219.169]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041205223314.TJAL1863.tomts10-srv.bellnexxia.net@alfajor>; Sun, 5 Dec 2004 17:33:14 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 95445D73CB; Sun, 5 Dec 2004 17:33:27 -0500 (EST) Original-To: Juri Linkov In-Reply-To: <878y8cze6i.fsf@jurta.org> (Juri Linkov's message of "Sun, 05 Dec 2004 22:23:23 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) 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: main.gmane.org gmane.emacs.devel:30721 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30721 >>> What did you wish to do using emergency escape under a window system? >> Get out of a infinite elisp loop executed while inhibit-quit is non-nil >> (e.g. an infinite loop in a post-command-hook or a timer). > I don't quite understand why it is assumed that everything run by > a post-command-hook or a timer is a critical code not allowed to be > interrupted with C-g? The way existing code is written, allowing quit could lead to corrupted states, so we can't just change it. Furthermore, the problem of uninterruptible code is not limited to post-command-hook and timers. So I'd rather have a general solution: a form of C-g that tries really hard to interrupt the current code, even if it risks putting the process in a somewhat corrupted state. >> Yes, I can kill the Emacs process, but it's a real pity to have to do >> that when there's nothing really wrong with it. Of course, all those >> cases are bugs we should fix, but they do happen, sometimes while >> writing/testing/debugging code. > Is it a bug that regex.c can't detect long or infinite loops? It can probably be considered as a performance bug (the complexity of regexp matching should be O(n*m) where `n' and `m' are the size of the text and of the regexp), but since we're not going to switch over to a different algorithm any time soon (especially seeing as we're forking further away from a clean non-Emacs-specific regexp.c), we just have to live with it. As for "detection", it's basically impossible, no. OTOH it shouldn't be too hard to obey C-g. Stefan