From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id QFcMNN2MnmVEKQAAkFu2QA (envelope-from ) for ; Wed, 10 Jan 2024 13:26:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id WF+fMN2MnmVPhwAAqHPOHw (envelope-from ) for ; Wed, 10 Jan 2024 13:26:05 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DT+sOsT4; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704889565; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tLLzQVMlS+8bv9kJGwr4jgG4DFOQaIkxijrcpOMA62s=; b=mYyXfH68cWPBRX1/jhFW9aJISu95HmnEhK4VOs8kDIABylBZTuvwYPPb3ErxF+mfNFiZfh E332tiXFQ4TZ8lCbusYx391I3AX2qYLpB/yUqjn8QrxHGyZD8FIBl7YnrxpjpsDcaoUWUc bPLy6FPBtgFob5Pc12GpYwbn49QI4+ekiBrKAg+Q+fZBW2wW6v+9oLJSWeIrkYrMk3pIiO 7ogHDwJ8ZpLBCPRBVhpoAnottSky4a7ppReSiTiTbbwKKP2hKNfTNFSxw6oq8MssjTsgl4 gbiuOBWr/fECZf6TpSY0nnPiknywMF22Y8g8uZOXnD4d2ySs5We1f0fzFZptpw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DT+sOsT4; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704889565; a=rsa-sha256; cv=none; b=A424j60btYZrnAS1HOD9h3MTPaS2ylsvEtuYLM81l/VU9zrb8kS3ctt1ZhzmL9iOcEHmBQ iAEik+y9zS5yCkxhuC4fw9Kv4aKyJLvbU7VDKYRSdRygtGW7WSmLVnQunW+Oq52XDKqiXL MW/8RqI+X6xrC1XacmcI+ygyZCZE3vv1cIx/bQxJ6Jzv1paEB66GwtMdVpglgD8Q934EXJ JKNKxypRmL8NCSgk+FwLVY5Nocsxt6QhjNXuRqs2BNduCGGlOAugulKPXAUf4mtwDT21// QYo3CIxIchL2qlK85DZq76ZgxlCmSQa/uObmsnn1ev9H4j658ZSYmowEYStO1w== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 50C85647C3 for ; Wed, 10 Jan 2024 13:26:05 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNXdp-0003pQ-53; Wed, 10 Jan 2024 07:25:06 -0500 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 1rNXdn-0003pD-BU for emacs-orgmode@gnu.org; Wed, 10 Jan 2024 07:25:03 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNXdk-0007Uq-5d for emacs-orgmode@gnu.org; Wed, 10 Jan 2024 07:25:02 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 88E69240103 for ; Wed, 10 Jan 2024 13:24:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704889497; bh=uepY1r5tVFDoZakSRt32E4bjRwb32KerO2rQ5op/cYg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=DT+sOsT4JK2MUht52tQv6nLuMG2FohwOQr8QR/Sab8g+v55fzsOPJfS8lHL91by9U 8T+9kf5RILKTcISe3vbMx/WLDqd4pdhXVEuoe4avPZzYgC7fNTobfpXUFO4xQG/9lw aQuPKqvIX+gmJvGbrd2DIsvVf8KicW1yNxZbvFaP95FXZIhmpR53TuDsKCx6ctqHus 7U82kf5/Ra8EmsFoQu+sz08d9b6P7720t7BO7GmZiUWQX6vx4nDTrW2Q9m6k49VjsJ Hn2jhoSt6J5ucLXTIKkxGOKk0/hNa27kK/8f83MVaoANXJoF7JyopEkzXUj7YP22n3 jVN9y5dPUxdLg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T96SS3xhWz6tvc; Wed, 10 Jan 2024 13:24:55 +0100 (CET) From: Ihor Radchenko To: Psionic K Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Unindentation fixup for code blocks In-Reply-To: References: Date: Wed, 10 Jan 2024 12:28:07 +0000 Message-ID: <877ckhqso8.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -7.11 X-Spam-Score: -7.11 X-Migadu-Queue-Id: 50C85647C3 X-TUID: Zw33cGFXFG+z Psionic K writes: > When cleaning up hard indentation, I found my source blocks remaining indented. > > The way that org-do-remove-indentation is sensitive to invisible text. > This occurs for source blocks whenever using org-modern-mode, where it > makes the source blocks align left. Thanks for the patch! Would you also be able to create a reproducer, so that we can replicate the problem and write a test? > By swapping out the arithmetic and expressions that relied on > current-column, the behavior is fixed. > > There are several behaviors I only just found, so I don't expect a lot > of precision in my fix, but the patch I came up with follows: > > From 858077f0d2a7f4cd8699948229c2965f0c6bb0a1 Mon Sep 17 00:00:00 2001 > From: Psionik K <73710933+psionic-k@users.noreply.github.com> > Date: Wed, 10 Jan 2024 18:05:53 +0900 > Subject: [PATCH] when removing indentation, take into account invisible text It looks like you did not send the patch with git send-email (this email patch does not apply with git). It might be easier if you simply attach the patch to email. > One behavioral difference is that the point is no longer moved > forward. Therefore, arithmetic is used instead of (current-column) > based math. (current-column) is inaccurate when moving the point > through invisible text. If you can, please add changelog entries to the commit message. See https://orgmode.org/worg/org-contribute.html#org77afce2 > - (progn (move-to-column n t) > - (point))))) > + (+ (line-beginning-position) n)))) This math is not accurate when tabs are present. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at