From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Why doesn't emacs yield more? Date: Thu, 29 Aug 2019 15:30:12 +0300 Message-ID: <83h860b1d7.fsf@gnu.org> References: Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="88403"; mail-complaints-to="usenet@blaine.gmane.org" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 29 14:30:25 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i3JZI-000MqR-RG for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Aug 2019 14:30:24 +0200 Original-Received: from localhost ([::1]:49360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3JZH-0006po-4J for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Aug 2019 08:30:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41232) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3JZ3-0006oJ-0U for help-gnu-emacs@gnu.org; Thu, 29 Aug 2019 08:30:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i3JZ1-00058u-Fy for help-gnu-emacs@gnu.org; Thu, 29 Aug 2019 08:30:08 -0400 Original-Received: from [176.228.60.248] (port=4172 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i3JZ0-0001Ch-Ln for help-gnu-emacs@gnu.org; Thu, 29 Aug 2019 08:30:07 -0400 In-reply-to: (message from ndame on Thu, 29 Aug 2019 11:33:42 +0200 (CEST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:121393 Archived-At: > From: ndame > Date: Thu, 29 Aug 2019 11:33:42 +0200 (CEST) > > I inadvertently pasted a huge elisp list structure into a buffer > and it took me 10 seconds or so to regain control, because emacs > was bogged down by formatting/highlighting the list I think. I'm guessing most of the time was taken by redisplay. Unless by "pasting" you mean something other than just C-y. I'd suggest to tell more details about the Lisp list structure in question and what you did to paste it. Otherwise, this discussion runs a risk of lacking a solid basis, and could easily be talking about things irrelevant to your use case. > It tried to hit C-g several times to no avail which made me > think: why doesn't emacs yield more during long operations by > checking if the user canceled the operation? Emacs does check for C-g during prolonged operations, but only when it runs Lisp code. I don't think that's what took most of the time in your case. Assuming it was redisplay that took most of the time: you cannot interrupt it, not by default. What would be the purpose of that? Emacs cannot allow the display to be left in a state that is inconsistent with the contents of the buffer, so it will immediately reenter another redisplay cycle. What you can do is type M-< to go to the beginning of the buffer. If the problematic portion of the buffer will then be off-screen, you should be able to stop waiting. You could also set redisplay-dont-pause non-nil, but IME it helps only in a small fraction of use cases, and otherwise its effect is for the worse. > I don't mean putting checks everywhere manually, but using some > automatic code translator which would inject such checks > automatically in the source codes of loops or something, before > the actual compilation of emacs. > > Would it be a big performance hit? I don't know if the check > could be inlined somehow. Was something like this discussed > before? We already do all that when running Lisp code.