From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Date: Sat, 07 Dec 2019 10:21:40 +0200 Message-ID: <83h82cfsvf.fsf@gnu.org> References: <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> <83eexhho8o.fsf@gnu.org> <20191206182842.GA3999@ACM> <83y2vpffyd.fsf@gnu.org> <20191206222459.GB3999@ACM> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="51904"; mail-complaints-to="usenet@blaine.gmane.org" Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 08 06:09:27 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1idoox-000DOB-9b for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Dec 2019 06:09:27 +0100 Original-Received: from localhost ([::1]:55800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idoow-0005yR-5i for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Dec 2019 00:09:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35776) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idooa-0005yH-TY for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2019 00:09:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idooY-0003rX-Vb for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2019 00:09:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1idooX-0003qh-Nd for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2019 00:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1idooX-0007Nh-JE for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2019 00:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Dec 2019 05:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38406 X-GNU-PR-Package: emacs Original-Received: via spool by 38406-submit@debbugs.gnu.org id=B38406.157578171828345 (code B ref 38406); Sun, 08 Dec 2019 05:09:01 +0000 Original-Received: (at 38406) by debbugs.gnu.org; 8 Dec 2019 05:08:38 +0000 Original-Received: from localhost ([127.0.0.1]:50325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idooA-0007N7-F0 for submit@debbugs.gnu.org; Sun, 08 Dec 2019 00:08:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idoo8-0007Ms-Rw for 38406@debbugs.gnu.org; Sun, 08 Dec 2019 00:08:37 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1idVLd-0002WS-Of; Sat, 07 Dec 2019 03:21:53 -0500 Original-Received: from [176.228.60.248] (port=3151 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1idVLb-0005Je-D2; Sat, 07 Dec 2019 03:21:53 -0500 In-reply-to: <20191206222459.GB3999@ACM> (message from Alan Mackenzie on Fri, 6 Dec 2019 22:24:59 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:173029 Archived-At: > Date: Fri, 6 Dec 2019 22:24:59 +0000 > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > From: Alan Mackenzie > > > If you already call that particular function explicitly, then calling > > it one more time is indeed redundant. > > No, it's not redundant. It's positively harmful. Agreed. > smie-blink-matching-open is inapplicable to CC Mode and just takes up > processor cycles. > > electric-pair-post-self-insert-function we've already discussed. > > blink-paren-post-self-insert-function would do nothing anyhow, since > blink-paren-function has been bound to nil - this is so that the actual > blinking doesn't occur until the newly inserted brace is at its final > position. > > electric-indent-post-self-insert-function is redundant and possibly > harmful. > > electric-layout-post-self-insert-function is undocumented, thus likely > to be harmful. Its name suggests it is redundant. > > electric-quote-post-self-insert-function is undocumented, uncommented > and obscure. It is safer not to risk running it. > > Given that the mechanism for filtering post-self-insert-hook is there, > why is there the resistance to filtering out redundant and effect-free > functions? Alan, I'm trying to do TRT here, but I cannot do everything by myself, because that would mean I need to invest an inordinate amount of time in each decision, and will never be able to catch up. Please help me with this particular task by providing more detailed information about your reasons for filtering out each of the functions you want to filter out. You have evidently studied them, so you should know more about them then shown above, and certainly more than I do. In general, I'd like to leave any function that is not harmful in the list unfiltered, even if calling it in this context is silly, or has no effect, or is otherwise redundant. Can you please humor me by looking at the above list through these eyes, and trying to avoid your apparent dislike for the whole idea while at that? I really need your help. Specifically, I'd like the following questions answered, at the very least: . why is smie-blink-matching-open inapplicable? . where and why is blink-paren-function bound to nil? Your patch calls blink-paren-function explicitly -- does that mean calling blink-paren-post-self-insert-function will be redundant? . why do you think electric-indent-post-self-insert-function could be harmful? If it's merely redundant, could we please call it here? . electric-layout-post-self-insert-function inserts newlines, and its documentation is in electric-layout-rules; the latter is nil by default and only used in js.el and octave.el -- why would it be harmful here? . electric-quote-post-self-insert-function replaces quote characters (see the doc string of electric-quote-mode); do you have specific reasons why calling it here could be harmful or risky? > And how come functions without meaningful doc strings are allowed onto > Emacs hooks? Please, let's not try fix all of Emacs while working on this single issue. I agree that undocumented functions is not a good thing, but, as shown above, documentation for what these functions do _is_ available nearby. Thanks.