From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" 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 13:49:59 +0100 Message-ID: <87tvdyecy0.fsf@tcd.ie> References: <87ftqms9db.fsf@secretsauce.net> <871s15k7ll.fsf@gmail.com> <20190511120524.GA15991@ACM> <87sgtlhyq5.fsf@gmail.com> <20190511161903.GB15991@ACM> <87lfzcwzs4.fsf@tcd.ie> <20190512161441.GD20053@ACM> <877eav5ouy.fsf@tcd.ie> <20190513101448.GA5525@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="219390"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35254@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 13 15:08: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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQAgs-000uqv-Iz for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2019 15:08:26 +0200 Original-Received: from localhost ([127.0.0.1]:57046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQAgr-0008GF-En for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2019 09:08:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQAbV-0003DN-JD for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 09:02:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQAQ4-0002Eb-4M for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:51:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59123) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQAQ3-0002ED-GZ; Mon, 13 May 2019 08:51:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQAQ2-0000Um-0F; Mon, 13 May 2019 08:51:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 13 May 2019 12:51: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.15577518111839 (code B ref 35254); Mon, 13 May 2019 12:51:01 +0000 Original-Received: (at 35254) by debbugs.gnu.org; 13 May 2019 12:50:11 +0000 Original-Received: from localhost ([127.0.0.1]:44434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQAPC-0000Ta-Ov for submit@debbugs.gnu.org; Mon, 13 May 2019 08:50:11 -0400 Original-Received: from mail-ed1-f50.google.com ([209.85.208.50]:36084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQAP9-0000T7-D7 for 35254@debbugs.gnu.org; Mon, 13 May 2019 08:50:09 -0400 Original-Received: by mail-ed1-f50.google.com with SMTP id a8so17418338edx.3 for <35254@debbugs.gnu.org>; Mon, 13 May 2019 05:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=E/ld7UvG3+3MeUQnnt3r8FHSANSZXif9lfA5sOsau0A=; b=H/xZYI0QC00nwKMrYZqpUQy1jB0PNeXYcdqv8XB9yxIRWqV6RTKaKHzRm9cqLQrbOR +WtgZFfwAd6XO60m/dwjsCnCBFRL9ytUdpMGhkJ6TK1Aje/Q5kPLUJzrunm34stMxXUf SYZ9YYyGoyYT6GE5muh+zVVP2g2MWETnV+u5cbjY2QmhcNs+c+qh5xWdMFlIOII2W8Ye e5e9+cwXP6+JSSEYVYQckBIWxOO9c+cX4B7iLFXgHUqpVGu2CeZsrm/Pq7qjV6+4yfbX X9vnvYtFaKEc+L1ZKcWldeLunN1sevqt6v5iBL4OTinnTPvmxSYb5QRyv4ZJOihTVLkP R+qQ== 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; bh=E/ld7UvG3+3MeUQnnt3r8FHSANSZXif9lfA5sOsau0A=; b=kFm6NFQ49L3H7f/7GXPnmDzxaJQVkYWCmeAkWq0r048U+Fd47Jv2v5u+cfi1wV6L8Y eKGVA2SmhdkxQUzeu+RjxsH+QxwrOXQB7M8KK4LRzxi15a0M9X3Iwz+4u3ury03cc3nw qa1VYBsqs+2GGg1fhF9j/lsmcxZ7ZQ2lg9SlfLtrU6WmX/jtjrtBJAyVvrRX4XA+Evus 3r3EctruFrjMg9reUw0jWIjrxPh907FDWy8R91m8YE1h/dQVYo05FsUVjbiHptqX7bu1 vP3B8gry+p1rBMdMEj3ncBpmNHzzaHq2LTPGEKWPqI1NOubiAYnh+ou0CXvHI1bn97/4 XIVg== X-Gm-Message-State: APjAAAU6f/7giCl2fWSj7xsGpmcp25eKPFLonpNRO4SkAULel3HneAws EGDMjIN4ACu1VxqoMzpfkuCrlg== X-Google-Smtp-Source: APXvYqzqRpjONwzz8lPwzI3wTXAz1Jy+1xljfh7CvH4Xe9WyVupZhLbjISbEX96Xu4pGlcanBVPaKA== X-Received: by 2002:a17:906:2542:: with SMTP id j2mr22014251ejb.217.1557751801441; Mon, 13 May 2019 05:50:01 -0700 (PDT) Original-Received: from localhost ([134.226.214.254]) by smtp.gmail.com with ESMTPSA id r14sm1626654eda.65.2019.05.13.05.50.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 13 May 2019 05:50:00 -0700 (PDT) In-Reply-To: <20190513101448.GA5525@ACM> (Alan Mackenzie's message of "Mon, 13 May 2019 10:14:48 +0000") 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:159175 Archived-At: Alan Mackenzie writes: > On Sun, May 12, 2019 at 22:45:09 +0100, Basil L. Contovounesios wrote: >> Alan Mackenzie writes: > >> > On Sat, May 11, 2019 at 20:34:51 +0100, Basil L. Contovounesios wrote: > >> >> Sorry if my question is completely naive or irrelevant (I haven't read >> >> the discussion very carefully), but how does the command >> >> c-context-line-break, which is described under "Making the key >> >> indent the new line" in (info "(ccmode) Getting Started") relate to this >> >> issue, if at all? > >> > c-context-line-break doesn't really have much to say in the matter. The >> > function is mainly about how to indent the _new_ line, and inserting >> > various continuation markers. > >> > This bug is about trailing space in the _old_ line not getting removed >> > on typing , about which c-context-line-break has nothing to say. > >> AFAICS c-context-line-break removes trailing space on the old line: > >> 0. emacs -Q >> 1. C-x h C-w >> 2. M-x c-mode RET >> 3. int main() { >> 4. RET RET > >> Line 2 now contains two trailing spaces. > >> 5. M-x c-context-line-break RET > >> Line 3 is now empty (has no trailing space). > >> Have I misunderstood something? > > Er, no. You're right, c-context-line-break does indeed remove the > trailing WS, at least on normal code lines. Sorry about the mistake. > > But I don't think I've really understood how this observation fits in > with the bug scenario. The bug is about the current master's default > binding of (namely newline) not removing the trailing whitespace > from the line it's typed in. > > I think you might be suggesting binding c-context-line-break to in > CC Mode as a workaround for the problem; or possibly using its ideas to > code up a CC Mode version of newline. (Or pointing users in its direction should they wish to configure this behaviour themselves.) > I still think the bug should be fixed in the Emacs core, so that other > modes which want the old line to have trailing spaces removed, yet don't > use electric-indent-mode, will just work. Indeed, that would be nice. Thanks, -- Basil