From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#62749: 28.2; Emacs keeps opening related file from vc-diff buffer Date: Mon, 15 May 2023 19:46:36 +0300 Organization: LINKOV.NET Message-ID: <86ttwdlffv.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28270"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: Dmitry Gutov , 62749@debbugs.gnu.org To: Oleksandr Gavenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 15 19:06:15 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pybeJ-00079Y-Be for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 May 2023 19:06:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pybe8-0001Ua-QM; Mon, 15 May 2023 13:06:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pybe6-0001MY-HM for bug-gnu-emacs@gnu.org; Mon, 15 May 2023 13:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pybe6-0007I5-7A for bug-gnu-emacs@gnu.org; Mon, 15 May 2023 13:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pybe6-0005uc-1N for bug-gnu-emacs@gnu.org; Mon, 15 May 2023 13:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 May 2023 17:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62749 X-GNU-PR-Package: emacs Original-Received: via spool by 62749-submit@debbugs.gnu.org id=B62749.168417033122651 (code B ref 62749); Mon, 15 May 2023 17:06:01 +0000 Original-Received: (at 62749) by debbugs.gnu.org; 15 May 2023 17:05:31 +0000 Original-Received: from localhost ([127.0.0.1]:44251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pybda-0005tH-QT for submit@debbugs.gnu.org; Mon, 15 May 2023 13:05:31 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:38923) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pybdY-0005sx-0f for 62749@debbugs.gnu.org; Mon, 15 May 2023 13:05:28 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 5562A24000C; Mon, 15 May 2023 17:05:19 +0000 (UTC) In-Reply-To: (Oleksandr Gavenko's message of "Sun, 14 May 2023 13:59:49 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261746 Archived-At: > After bisecting my long .emacs config I pinpointed the culprit: > > (which-func-mode 1) > > During the movement through a diff buffer this mode loads corresponding > files: > > if the cursor reaches a new hunk - the corresponding file is opened (( > > This is done one by one file while I scroll down with the cursor. > > Removing the line significantly improved performance during scromming in VC > diff buffer in Cygwin and no more new files opened! This is an interesting problem, I can reproduce it by 'M-x which-function-mode'. > I think which-function-mode is broken for diff-mode, the workaround for > those who wants this mode is to deal with: > > (defcustom which-func-modes t > ;; '(emacs-lisp-mode c-mode c++-mode objc-mode perl-mode cperl-mode python-mode > ;; makefile-mode sh-mode fortran-mode f90-mode ada-mode > ;; diff-mode) > "List of major modes for which Which Function mode should be used. > For other modes it is disabled. If this is equal to t, > then Which Function mode is enabled in any major mode that supports it." > > What are the next actions? Maybe 'diff-syntax-fontify' could have a similar list of minor modes that should be ignored. Then such a list should at least contain 'which-func-mode' by default.