From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#72561: 31.0.50; Scan error in ert--pp-with-indentation-and-newline Date: Thu, 22 Aug 2024 09:43:14 -0400 Message-ID: References: <87v808o5es.fsf@neverwas.me> <87zfp54czm.fsf@neverwas.me> <87o75l4ak8.fsf@neverwas.me> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33605"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 72561@debbugs.gnu.org To: "J.P." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 22 15:44:29 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sh872-0008bR-CC for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Aug 2024 15:44:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh86t-0003Rd-Qi; Thu, 22 Aug 2024 09:44:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sh86q-0003QC-Mj for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 09:44:16 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh86q-00018p-Ar for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 09:44:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Mk4QI87BREClaRAGLJPjcTSw381KYolhwAhnU6Dc+H8=; b=HAcaJReANaTZMh9TqMxDU2lGHnN0FGlbpgupqcFI2M1xbNzpJaKvaJYyLBkRlRxRmSSZ03qHChzGMTGuy6hPVt4N2HshKVxlkkHf9XnN9TdCJ4J7P/oVedY88+VfBngS2w4l6thRw32fY/4zjHrZfWzwN8fBMl6w1HKIdyoHVYhJep0lsHiVcuIysFAtFN4VfTEoqIMehbqG+FtvHxybsiy51Y8qyXzi4PTtr+JdUPgRmLQbYbW3PFi3cUWLwnHPOtrTqFUTK7tqMHYyKoM8L3PERoCu2Yn0+CMmep/Gb6CKv6r3Wa7uz/uYGNr/T5zLFZifBrOKlNC3bDUevbCOjg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sh87a-0002jg-4I for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 09:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Aug 2024 13:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72561 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72561-submit@debbugs.gnu.org id=B72561.172433424910424 (code B ref 72561); Thu, 22 Aug 2024 13:45:02 +0000 Original-Received: (at 72561) by debbugs.gnu.org; 22 Aug 2024 13:44:09 +0000 Original-Received: from localhost ([127.0.0.1]:37071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh86j-0002i4-3W for submit@debbugs.gnu.org; Thu, 22 Aug 2024 09:44:09 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:46011) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh86h-0002hk-DZ for 72561@debbugs.gnu.org; Thu, 22 Aug 2024 09:44:08 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3AC9110017F; Thu, 22 Aug 2024 09:43:16 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1724334195; bh=m7BkKoxkvBbCiyKyWeexKiVOwfjO/U6BkNZaXw8Y4I0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LML2H/MggVLRysmIbHr6SpVpzdROa8ecMVVskobZ1Ke3DNELJMZtx1J4j3NEXDV38 RMoamdC8x4lbiQse5DTmEmmDQ8ARdBr0NsNinniuj5EuC+QQWwDTQPI1e4h95/1bVu c/RjvWTb+dtnN5DzEabtPANxhQFnWIg0/T+uze/sTUTz44nZXLoltnhULfucHK7Wkw Lvj7Bx4+lNiR5BGCalp8HRlLYl+HP57lINTixuGrOP5jiTKcNQpP6MOoXDV1ZzcTEf I6Xw3TcSZFTgqrEGR4f083gS/vlOKZSQhonZFxgbV+zeWtelX9R5f/DDzaMoawLLTR mGa/j5cN65tUw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F0C4A100044; Thu, 22 Aug 2024 09:43:14 -0400 (EDT) Original-Received: from asado (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D5CF8120480; Thu, 22 Aug 2024 09:43:14 -0400 (EDT) In-Reply-To: <87o75l4ak8.fsf@neverwas.me> (J. P.'s message of "Wed, 21 Aug 2024 18:21:11 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290538 Archived-At: > 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) > (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. Stefan