unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 44823@debbugs.gnu.org
Subject: bug#44823: 27.1.50; c-context-line-break misbehaves at end of comment
Date: Tue, 24 Nov 2020 16:22:46 +0000	[thread overview]
Message-ID: <20201124162246.GA15477@ACM> (raw)
In-Reply-To: <83zh38ugeo.fsf@gnu.org>

Hello, Eli.

On Mon, Nov 23, 2020 at 19:33:35 +0200, Eli Zaretskii wrote:
> To reproduce:

>   emacs -Q
>   C-x C-f src/xdisp.c
>   C-u 19 M-g g
>   C-e

> This should bring you to the end of this line in xdisp.c:

>   along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */

> It is the end of a comment.  Now do this:

>   M-: (local-set-key "\C-m" 'c-context-line-break) RET

> Then press RET.  I expect Emacs to open a new line, indent it
> according to the context, and put point after the indentation.
> Instead, the new line is inserted _before_ the point's line, and point
> stays at the end of the comment as it was before.

> This is a regression wrt Emacs 26.

> I had this customization of RET in CC mode since about forever, and it
> always worked like I expected.  Until Emacs 27.1.

> Can this be fixed for Emacs 27.2, please?

This is an off-by-one error, and was fixed in master with the following
commit:

commit 7574390099f0de11939a0e3626cf222b58863290
Author: Alan Mackenzie <acm@muc.de>
Date:   Thu Jun 25 17:07:16 2020 +0000

    CC Mode.  Fix an off by one error.  Fixes bug #41809

    * lisp/progmodes/cc-engine.el (c-full-pp-to-literal): Change > to >= (twice).

I can't remember why I didn't commit this to the emacs-27 branch.
Possibly it was too close to the release.

I'll cherry-pick it back to the emacs-27 branch.


> In GNU Emacs 27.1.50 (build 107, i686-pc-mingw32)
>  of 2020-11-23 built on HOME-C4E4A596F7
> Repository revision: 2b1cec559202d5985b7431ffce943bf4b019fb95
> Repository branch: emacs-27
> Windowing system distributor 'Microsoft Corp.', version 5.1.2600
> System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600)

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).





  parent reply	other threads:[~2020-11-24 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 17:33 bug#44823: 27.1.50; c-context-line-break misbehaves at end of comment Eli Zaretskii
2020-11-23 17:51 ` Eli Zaretskii
2020-11-24 16:22 ` Alan Mackenzie [this message]
2020-11-24 16:37   ` Eli Zaretskii
2020-11-24 16:39   ` Alan Mackenzie
2020-11-24 18:34     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201124162246.GA15477@ACM \
    --to=acm@muc.de \
    --cc=44823@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).