From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#47879: [PATCH] Ignore mode hooks when analysing diffs Date: Sun, 18 Apr 2021 22:25:11 +0300 Message-ID: <837dkztmy0.fsf@gnu.org> References: <878s5fpg1a.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3262"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47879@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 18 21:26:26 2021 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 1lYD3p-0000lk-Lq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Apr 2021 21:26:25 +0200 Original-Received: from localhost ([::1]:34318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYD3o-0003BB-NP for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Apr 2021 15:26:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYD3V-0003Au-Rq for bug-gnu-emacs@gnu.org; Sun, 18 Apr 2021 15:26:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36321) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYD3S-0001Jy-0U for bug-gnu-emacs@gnu.org; Sun, 18 Apr 2021 15:26:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lYD3R-0001M5-Tg for bug-gnu-emacs@gnu.org; Sun, 18 Apr 2021 15:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Apr 2021 19:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47879 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 47879-submit@debbugs.gnu.org id=B47879.16187739375177 (code B ref 47879); Sun, 18 Apr 2021 19:26:01 +0000 Original-Received: (at 47879) by debbugs.gnu.org; 18 Apr 2021 19:25:37 +0000 Original-Received: from localhost ([127.0.0.1]:47867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYD32-0001LR-KJ for submit@debbugs.gnu.org; Sun, 18 Apr 2021 15:25:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYD31-0001LE-6b for 47879@debbugs.gnu.org; Sun, 18 Apr 2021 15:25:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54416) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYD2v-00013W-Nk; Sun, 18 Apr 2021 15:25:29 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4664 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lYD2v-0000TE-2Y; Sun, 18 Apr 2021 15:25:29 -0400 In-Reply-To: <878s5fpg1a.fsf@posteo.net> (message from Philip Kaludercic on Sun, 18 Apr 2021 19:08:01 +0000) 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" Xref: news.gmane.io gmane.emacs.bugs:204402 Archived-At: > From: Philip Kaludercic > Date: Sun, 18 Apr 2021 19:08:01 +0000 > > This fixes a bug related to log-edit-generate-changelog-from-diff. > > When I tried to invoke this command in a commit buffer, the error > > signal: Unmatched bracket or quote > > was raised. The reason was that I added paredit-mode to > emacs-lisp-mode-hook, that when invoked calls check-parens. This raises > an error when the diff contains a partial s-expression, which is almost > always the case. > > The least invasive approach I could come up with was to defer the mode > hooks. I rather think that the bug is either in the hook you added or in paredit-mode, and should be solved there. Otherwise, we'd need to defer hooks every time we turn on a mode. And who known what deferring all the hooks could do to other hooks, which are entirely legitimate and don't cause any problems. IOW, I think what you suggest is too blunt a weapon, and could do more harm than help. Let's try to find a cleaner way of fixing the problem, preferably where it happens, i.e. in the code that is run by the hook. Thanks.