GNU bug report logs - #72561
31.0.50; Scan error in ert--pp-with-indentation-and-newline

Previous Next

Package: emacs;

Reported by: "J.P." <jp <at> neverwas.me>

Date: Sat, 10 Aug 2024 13:55:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: "J.P." <jp <at> neverwas.me>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 72561 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 72561 <at> debbugs.gnu.org
Subject: Re: bug#72561: 31.0.50; Scan error in
 ert--pp-with-indentation-and-newline
Date: Thu, 22 Aug 2024 18:02:20 -0700
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Actually, that can probably be simplified a bit.
>
> BTW, it could be argued that the `indent-rigidly` should take place in
> `pp` (i.e. consider it as a bug in `pp`).
>
> The patch looks good to me, tho I have the following nitpicks:
>
>>    (let ((begin (point))
>> +        (cols (- (point) (line-beginning-position)))
>                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>                  (current-column)

Oh, TABs and stuff, right.

>
>>          (pp-escape-newlines t)
>>          (print-escape-control-characters t))
>>      (pp object (current-buffer))
>>      (unless (bolp) (insert "\n"))
>> -    (save-excursion
>> -      (goto-char begin)
>> -      (indent-sexp))))
>> +    (indent-rigidly begin (point-max) cols)))
>>                            ^^^^^^^^^^^
>                              (point)
>
> We arguably know that (point) is the same as (point-max) here, so it's
> not really important, but (point) is shorter and conceptually more
> correct since we wouldn't want to shift text that was there before.

Makes sense. Might as well have the function be more generally useful.
Thanks.

And since the issue is new on the release branch, I'm guessing that's
where a patch should go (Cc. Eli)?

[0001-Indent-ERT-failure-explanations-rigidly.patch (text/x-patch, attachment)]

This bug report was last modified 344 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.