GNU bug report logs - #62749
28.2; add-log-current-defun doesn't clean up its temporary buffers

Previous Next

Package: emacs;

Reported by: Oleksandr Gavenko <gavenkoa <at> gmail.com>

Date: Mon, 10 Apr 2023 12:12:01 UTC

Severity: normal

Found in version 28.2

Full log


Message #26 received at 62749 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Juri Linkov <juri <at> linkov.net>, Dmitry Gutov <dmitry <at> gutov.dev>, Stefan
 Kangas <stefankangas <at> gmail.com>
Cc: control <at> debbugs.gnu.org, 62749 <at> debbugs.gnu.org
Subject: Re: bug#62749: 28.2; Disabling minor modes in diff-mode hunk
 temporary buffers
Date: Tue, 11 Mar 2025 19:53:26 +0800
retitle 62749 28.2; Disabling minor modes in diff-mode hunk temporary buffers
thanks

On Tue 16 May 2023 at 07:44pm +03, Juri Linkov wrote:

> The problem is that 'which-func-mode' is enabled in diff-mode.
> 'which-function' calls 'add-log-current-defun' that calls
> 'add-log-current-defun-function' that is 'diff-current-defun'
> in diff-mode.  Finally, 'diff-find-source-location' visits
> the source files without killing them afterwards.

In commit 53977213522 Stefan K. fixed a similar sort of problem for
Paredit users.  Specifically, when trying to use C-c C-w in a Log Edit
buffer, diff-add-log-current-defuns tries to enable Paredit in its
*diff-other-text* temporary buffers.

Paredit calls check-parens, which fails because it's just a small
portion of the file and so the parens aren't balanced.
This signalled a user-error which interrupts the whole operation.

What is similar in these two cases is that diff-mode code is setting up
temporary buffers for hunks in which only the major mode matters, but
there are various possible minor modes that could get in the way because
they expect to be enabled in buffers visiting whole files.

So I think this your problem here, Juri, might be fixable in a similar
way to 53977213522, by using delay-mode-hooks ?

> I guess this is related to another annoying bug: after every commit need
> to spend much time killing all buffers created by the commit command.

I'm not sure what you're referring to here, could you expand?

-- 
Sean Whitton




This bug report was last modified 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.