From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#20846: 24.4; Electric-indent-mode does not call indent-line-function after hitting RET inside a comment Date: Sat, 29 May 2021 09:24:01 -0400 Message-ID: References: <871r9t6pgd.fsf@gnus.org> <838s40acf9.fsf@gnu.org> <87sg273fqo.fsf@gnus.org> <83fsy78l2p.fsf@gnu.org> <49c82e08-f15e-e564-1740-86271fc94f3b@yandex.ru> <8335u780u6.fsf@gnu.org> <874kemwa0a.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1372"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: robin.neatherway@gmail.com, Eli Zaretskii , Dmitry Gutov , 20846@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 29 15:25:11 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 1lmyxj-0000Ab-Ak for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 May 2021 15:25:11 +0200 Original-Received: from localhost ([::1]:35508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmyxi-0000gW-DX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 May 2021 09:25:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmyxZ-0000gH-WD for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 09:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmyxZ-0004Bt-Md for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 09:25:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lmyxZ-00048Q-I1 for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 09:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 May 2021 13:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20846 X-GNU-PR-Package: emacs Original-Received: via spool by 20846-submit@debbugs.gnu.org id=B20846.162229465215828 (code B ref 20846); Sat, 29 May 2021 13:25:01 +0000 Original-Received: (at 20846) by debbugs.gnu.org; 29 May 2021 13:24:12 +0000 Original-Received: from localhost ([127.0.0.1]:56292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmywm-00047E-E7 for submit@debbugs.gnu.org; Sat, 29 May 2021 09:24:12 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmywi-000470-V4 for 20846@debbugs.gnu.org; Sat, 29 May 2021 09:24:10 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A11FA100216; Sat, 29 May 2021 09:24:03 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3550F1001FB; Sat, 29 May 2021 09:24:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622294642; bh=W3jG8fAblrkWuTPoFlKwd3odxmse0gFuivi4tcyDV/k=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dvFL2CcuJxCd8bbk+htnTceANqjl0FkELTJuBLNCpAsTya0nY3lSVp7VnfgmXT0i4 P8gXfY3NQPkDYZ+2zIqpenyLccNBVZymTN3zIgqFjOhbU6Wx+TWwUQ3C1ColuaHqlO EgiMagrnmP133zhVyZJYWwrwFM9FEkcpZaifPIOnx3CruCFQejtIaP/I03OAwbHyj+ m+dMq6GhLj3OKMHe+nwXu5m0JTrbFPVrktdMPmTQ587OeBqCjgu4AAlLPTddwcsi3v BtdnXISjhxehHEL6b9SFyipxa7bBdnS6WsRAQ9S4PZz4cQjrbBmPho33id/yEgNpb1 JaaOJRb1S2rmA== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E87B812017B; Sat, 29 May 2021 09:24:01 -0400 (EDT) In-Reply-To: <874kemwa0a.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 29 May 2021 04:26:29 +0200") 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:207532 Archived-At: Lars Ingebrigtsen [2021-05-29 04:26:29] wrote: > Stefan Monnier writes: >> The (nth 8 (syntax-ppss)) test has been in `electric-indent-mode` from >> the very beginning, but I must say I can't remember why I put it in, >> I think it was a mistake and we should remove it. > > This bit? > > (when (and > [...] > (not > (or (memq act '(nil no-indent)) > ;; In a string or comment. > (unless (eq act 'do-indent) (nth 8 (syntax-ppss)))))))) > > > Uhm... I stared at that logic for a couple of minutes, but I'm still > not able to convince myself that I understand it, The logic here is that the functions on the hook can return either nil to mean "indent, of course" or `no-indent` or `do-indent` where this last one overrides the default "don't indent inside a string or comment" (and it also overrides potential other functions on that hook which might have said `no-indent`). > so could you do the necessary here? :-) Done. Can we close this bug? Stefan