From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#35254: 27.0.50; cc-mode/electric-pair-mode/electric-layout-mode: bad trailing whitespace behavior in cc-mode Date: Mon, 13 May 2019 19:45:49 -0400 Message-ID: <877eathqaa.fsf@gmail.com> References: <87ftqms9db.fsf@secretsauce.net> <871s15k7ll.fsf@gmail.com> <20190513195323.GB5525@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="164599"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: Alan Mackenzie , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 35254@debbugs.gnu.org, Dima Kogan To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 14 09:10:56 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQRaP-000gdM-OG for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 May 2019 09:10:53 +0200 Original-Received: from localhost ([127.0.0.1]:40886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQRaO-0001Zj-Oy for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 May 2019 03:10:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQRZz-0001Oi-OD for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 03:10:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQKed-0002ym-7Y for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 19:47:24 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33084) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQKdt-00023u-Vz; Mon, 13 May 2019 19:46:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQKdt-0004lm-PJ; Mon, 13 May 2019 19:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 13 May 2019 23:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35254 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 35254-submit@debbugs.gnu.org id=B35254.155779115918326 (code B ref 35254); Mon, 13 May 2019 23:46:01 +0000 Original-Received: (at 35254) by debbugs.gnu.org; 13 May 2019 23:45:59 +0000 Original-Received: from localhost ([127.0.0.1]:46628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQKdr-0004lW-6w for submit@debbugs.gnu.org; Mon, 13 May 2019 19:45:59 -0400 Original-Received: from mail-it1-f169.google.com ([209.85.166.169]:36317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQKdo-0004lI-Jw for 35254@debbugs.gnu.org; Mon, 13 May 2019 19:45:57 -0400 Original-Received: by mail-it1-f169.google.com with SMTP id e184so1916953ite.1 for <35254@debbugs.gnu.org>; Mon, 13 May 2019 16:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=rUX4+CwBJDxX3QVwwXcWZPpF8CRfKwJFYhckHsjvd9c=; b=K7lYNjDAC/15lLTSKgY+cl9ZYzh2kW0cxc+Uy0opwkWAzlmRau/W52PzIovMQkoCI7 PQo/PuNXc+GinWYOVDS+RWO1BAexESbPdBQycFxNxq2WjrdSYDl4L1xeJz7QTeiwj8ir NbTEs1Lwrs9DzJLyZbgP6Oq9JFCwnEf5238znMVtD2X1ivzfNgs2K6aYdFqgr7cUg+/L 6LEFAXvYtflakbwwBIRce43fbVSNxEPdNeEftW+kCvmY9yg/z68K3SlVvBeMD11/NtaT YiavbYHMDoA7khTufKXbBpr8nuH6lH9HW/FqU7E/FEAwvzgsbDEYhQwQ+NhNPYlVDijT dnhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=rUX4+CwBJDxX3QVwwXcWZPpF8CRfKwJFYhckHsjvd9c=; b=C5OPZchSSqOlmtNGK39tzJHBZRScF5ws4lTVpwEpxtdJjsqivnNutR90XsGDO+EH9x LvDp91BVusqHyyXzF1tB3w6H1b5ah2T5qQq+yw7eWLAalWp1dnmyNPLkWN5jyyEwjzJU D6bOxthC69ZjVQDggkN8BeqkGjUcjvFWOBo052WdhnLMvYjT2FdNF76L8xCQyp38+OYA D4P2AeL1Red1xoSN0pXbPNCGel1/IuBcz9gXNS0e9BDrMvOFYfNcLQizChAwqdeO2Aqw aUN37r4jzOXOR3Dm41LMMg6M9g2yrFM3mw8mTfrl34hTAppSLVN+TFDw7zpahB2kQ3xX dl9g== X-Gm-Message-State: APjAAAW08niyeBw+dIeyfYRgq0fpTJmjHS/G/RC4YuqSEpT7qSof/Sbu c53I6FNJ3AbI3DIvqVWlZ2s= X-Google-Smtp-Source: APXvYqxLfRVhqClw30qflQGnqTIdX6Cmf8st5r+ha8iWlKOXBB8ClZmUZMq0hX5XJaSZp7yY4m0yNg== X-Received: by 2002:a02:a1d6:: with SMTP id o22mr20563881jah.102.1557791150871; Mon, 13 May 2019 16:45:50 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id w194sm538096itb.33.2019.05.13.16.45.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 16:45:50 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 13 May 2019 19:32:49 -0400") 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:159254 Archived-At: Stefan Monnier writes: >>> Electric indent mode's post-self-insert hook entry has 3 effects: >> >>> 1. Indent the previous line. >>> 2. Remove trailing whitespace from the previous line. >>> 3. Indent the current line (when at beginning of line). > > Note that `newline` itself already does some subset of 2 (before running > electric-indent's post-self-insert hook). Do you mean `newline-and-indent`? Or are you talking about the margin stuff? (which doesn't apply to progmodes usually, as far as I can tell). > I don't understand why you distinguish > > electric-indent-inhibit > > from > > (memq indent-line-function > electric-indent-functions-without-reindent) > > When I introduced these, electric-indent-functions-without-reindent was > only meant to paper over those pre-existing cases that don't set > electric-indent-inhibit. > > So, I'd suggest an even simpler patch which just closes the `unless` > earlier. Would that work? It has the same effect as Alan's patch: effectively reverses a bit of Jo=C3=A3o's "electric-layout-mode kicks in before electric-pair-mode" chang= e, and breaks the same 3 tests I mentioned in https://debbugs.gnu.org/35254#50.