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: Sun, 12 May 2019 22:45:09 +0100 Message-ID: <877eav5ouy.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="241676"; 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 Sun May 12 23:46:12 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 1hPwIN-0010fb-St for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 May 2019 23:46:12 +0200 Original-Received: from localhost ([127.0.0.1]:47637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPwIM-0000Ub-TL for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 May 2019 17:46:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPwIG-0000U9-E0 for bug-gnu-emacs@gnu.org; Sun, 12 May 2019 17:46:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPwIF-0006fC-EM for bug-gnu-emacs@gnu.org; Sun, 12 May 2019 17:46:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPwIE-0006ca-U4; Sun, 12 May 2019 17:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hPwIE-0007FZ-Ju; Sun, 12 May 2019 17:46:02 -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: Sun, 12 May 2019 21:46:02 +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.155769751927807 (code B ref 35254); Sun, 12 May 2019 21:46:02 +0000 Original-Received: (at 35254) by debbugs.gnu.org; 12 May 2019 21:45:19 +0000 Original-Received: from localhost ([127.0.0.1]:43545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPwHX-0007ER-87 for submit@debbugs.gnu.org; Sun, 12 May 2019 17:45:19 -0400 Original-Received: from mail-ed1-f68.google.com ([209.85.208.68]:36242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPwHV-0007EB-9v for 35254@debbugs.gnu.org; Sun, 12 May 2019 17:45:18 -0400 Original-Received: by mail-ed1-f68.google.com with SMTP id a8so14447292edx.3 for <35254@debbugs.gnu.org>; Sun, 12 May 2019 14:45:17 -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=0LBDSWc5w20p2moOqLqukJSP/N1H0RNUUfnlpditAW4=; b=J5hTYeXXYctkg7x/J3v8QCL18J+3haqcm4OPg0PyXB4UetyMkJSElTAeKA5Sln28kb vP6Y7nP8fk+9eqSk0jSEnxZuf/ugTfVQLVIVDIWIBRZmWKjN8qTF9icMbM+dXijvF9jB dfvxERFbmcdxeDKIy94ZTg5IgtqQFIwWLMPlwaCLfq9RF5YBbdQyFL3Ra5drDaDyySVF XAd/cMiKPN50lq616UkuAUiqA9uKMn/97JohHZbv7Hy0oxEcfXANA71sVjuNHO7PmnSQ OqcilqJqrbKgketDRTAQpLOikcLc7k8qSI6pVBk2Qr6rwYLj0SwQilORVbr8kycXWjBT S3/Q== 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=0LBDSWc5w20p2moOqLqukJSP/N1H0RNUUfnlpditAW4=; b=lj4PaLed8v9zn6JRQhFVPePqo7iLKYNpusg/sktLQo6NXis8DH14/KHfHwE36f22YE l0mILN+6ldbEZ29kE2oyS+0L85ZJLKLVg34cNLGj3Z09W/EydOcz3GIkpCbJqcuh/IGK BddVFVaGHj44mhV2jycSUilnBFr9RxXaPH2n2ZYI+8kukYEWbCARi/jKdPmqxvmiDq3c eHVXRRRgOIIo0vTcUyRisKVvemBtrsidpsBKprVlp3wFMYwrZxacAJbu7vO08wbsIcgd O4wT9lFjnhYmaLnnKmzInDYrrLz3D3XDeiWhN9PPL7KXPPDwQ61muptGv1gOIa1j66rc n+aA== X-Gm-Message-State: APjAAAWYc/uNHGjpo9j1aSRLZcSqlVZfwB7f/Knb8oqTC2LIGkE9+cZv Ez+ao1vcYlFfn5Zmuirq7yJuGw== X-Google-Smtp-Source: APXvYqyVuBklsdmKx4F+I/BDol1hI5HStyk2ViBTY/nAaUyaDmcJVwoKt1AjM4KjuZAxHTW4R6wHwA== X-Received: by 2002:a17:906:371b:: with SMTP id d27mr2348085ejc.80.1557697511483; Sun, 12 May 2019 14:45:11 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:8cad:ae29:555d:852d]) by smtp.gmail.com with ESMTPSA id g18sm3284303edh.13.2019.05.12.14.45.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 12 May 2019 14:45:10 -0700 (PDT) In-Reply-To: <20190512161441.GD20053@ACM> (Alan Mackenzie's message of "Sun, 12 May 2019 16:14:41 +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:159159 Archived-At: Alan Mackenzie writes: > On Sat, May 11, 2019 at 20:34:51 +0100, Basil L. Contovounesios wrote: >> Alan Mackenzie writes: > >> > On Sat, May 11, 2019 at 10:06:42 -0400, Noam Postavsky wrote: >> >> Alan Mackenzie writes: > >> >> Of course c-mode could rebind it in its mode map (I considered making >> >> `electric-newline-and-maybe-indent' consult `electric-indent-functions' >> >> as well but that won't work because that hook is supposed to run after >> >> the character is inserted). > >> > I think we've got enough foggy complexity in the area as it is. I >> > suppose CC Mode could bind to `newline-and-indent', but there's now >> > no longer a clean function which does what `newline' used to do, to bind >> > onto C-j. > >> 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? Thanks, -- Basil