From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#35316: 26.2; Emacs lags in c++-mode buffer when editing with iedit-mode on Date: Sun, 19 May 2019 13:41:14 -0400 Message-ID: <87mujibav9.fsf@gmail.com> References: <20190516150457.GA639@ACM> <20190516161704.GA527@ACM> <871s0xop2o.fsf@gmail.com> <20190517100118.GB5011@ACM> <87lfz5c7b5.fsf@gmail.com> <20190519114019.GA5262@ACM> <877eamd1in.fsf@gmail.com> <20190519142615.GB5262@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="41242"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: Amos Bird , 35316@debbugs.gnu.org, Zhang Haijun To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 19 19:42:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSPp8-000AX1-Ac for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 May 2019 19:42:14 +0200 Original-Received: from localhost ([127.0.0.1]:51571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSPp6-0003Pv-NC for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 May 2019 13:42:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSPox-0003Pq-BG for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 13:42:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSPow-00048S-AH for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 13:42:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50167) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSPow-00048M-66; Sun, 19 May 2019 13:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hSPow-0001Gx-1i; Sun, 19 May 2019 13:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 19 May 2019 17:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35316 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 35316-submit@debbugs.gnu.org id=B35316.15582876854838 (code B ref 35316); Sun, 19 May 2019 17:42:01 +0000 Original-Received: (at 35316) by debbugs.gnu.org; 19 May 2019 17:41:25 +0000 Original-Received: from localhost ([127.0.0.1]:35478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSPoK-0001Fy-N1 for submit@debbugs.gnu.org; Sun, 19 May 2019 13:41:24 -0400 Original-Received: from mail-io1-f54.google.com ([209.85.166.54]:46752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSPoI-0001Fl-0P for 35316@debbugs.gnu.org; Sun, 19 May 2019 13:41:23 -0400 Original-Received: by mail-io1-f54.google.com with SMTP id q21so9210168iog.13 for <35316@debbugs.gnu.org>; Sun, 19 May 2019 10:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=VpeAC8ZzGKFJlT+HtUlBzbMAshwEwwj3HhO6xOfobPw=; b=rL7guFmvRfg6ACpxWVh0GTeoa4rKIelBE52cc92F0V9tZH57GdmIDk8GDg+3abK1OP xJ/T8dsdb52YTxLRn0zzK2jNTSK4pIuhfzJyGNY+f1JnuL4p3aeLqG3+PU46+JjAdQTn Fdl0MSmHl66DxwWYOMMnPEXsgUrgWr+7+3SkKDuZj6DlaBow4nAnXmVE1UUVJSf0Uk// iVm/XsC/LLL25ZOpwe0sRSzDd+aUV11R7a6nkxySPwsZ9TnF8WfhXw1bBVIXeBBHWe8u gH418GqCKe7aXHxSYEeQxQPijUr7AOg74G5c0xj32eeEP2owo4Xr7lK0olKupVjsutiR JNOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=VpeAC8ZzGKFJlT+HtUlBzbMAshwEwwj3HhO6xOfobPw=; b=LhxyvugREIhmyv9sPW+xxA/MWFK7+XpiXXJ34jUSiERcnysGVxRWHa5xMEHTEmqKxa QL6QmqpLOUOi/S34oEIXt/+Xpc/2pUfjaUZHdVN792hzhBQQdQx33Omu6UUGUPd1M19n 1lnFWscrHq1/H4Bzj/8nCCzy0MnC6PvXEUJi32hn/858JWB+yJbdpe+/Z0EHbKWuT9NT D6y085vzPmKJoFmIWhFnB+q29EP+6oPOUvr+Bf75+xIFCdxEot9h2oUbVoc41VAtVsbr Xd3fYrJYM+uDibXAh5Nzjza21iT+o1+9YDdAMX6alqbPoSXwEEt7xbdIwPdfwxJGLCCf e82g== X-Gm-Message-State: APjAAAUtS4jrbVnBikTc0oXwx7t58E3s1gsBPix/8TkR8spdLEpRriTH hbINO3qsty9HNAcVrHdH4KY= X-Google-Smtp-Source: APXvYqxrtOPjKHjUER2k0NtfdyzMkO+UrwSxnj58jTlhUOoDHeZYb+1MJM9HFFxOwz6N6f2pXfbS9Q== X-Received: by 2002:a5d:9616:: with SMTP id w22mr3885789iol.40.1558287676138; Sun, 19 May 2019 10:41:16 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id k1sm4603210ioc.71.2019.05.19.10.41.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 19 May 2019 10:41:15 -0700 (PDT) In-Reply-To: <20190519142615.GB5262@ACM> (Alan Mackenzie's message of "Sun, 19 May 2019 14:26:15 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159554 Archived-At: Alan Mackenzie writes: >> Would something like this work: > >> (defvar iedit-inhibit-update nil) > >> (defun iedit-update-occurrences-2 (occurrence after beg end &optional change) >> ... >> ;; Let other modification hooks run, but don't recurse infinitely. >> (unless iedit-inhibit-update >> (let ((inhibit-modification-hooks nil) >> (iedit-inhibit-update t)) >> ... > > I haven't actually tried it, but gut feeling says this approach might be > problematic. It could end up inserting into/deleting from each overlay > many times. Or some of the insertions/deletions wouldn't get the change > hooks called for them, depending on how the rest of the code is split > into the two "..."s. Sorry, it was a bit unclear, the first "..." was just intended to be the docstring. I.e., the code I put in there should be at the top-level of the function, and wrap the rest of the code. > It might also be even less clean than the explicit calls to > before/after-change-functions. Although it misses text property and overlay change hooks. >> See also Bug#25111 "How modification-hooks let-bind >> inhibit-modification-hooks?" https://debbugs.gnu.org/25111 > > Thanks. I was considering raising the same issue in a bug myself. > #25111 is still open, I think (the web interface doesn't explicitly > say), Yes, it's open. > and I think the doc is objectively wrong. It doesn't state that > when modification-hooks is called, inhibit-modification-hooks has > already been set to non-nil. That was what caught me out when I wrote > the previous (garbage) patch on ?Thursday. Yeah, it's a tricky case. The docs are definitely not adequate.