From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 8CjZJqJwrWSyvwAASxT56A (envelope-from ) for ; Tue, 11 Jul 2023 17:09:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wFPoJqJwrWQUqQAA9RJhRA (envelope-from ) for ; Tue, 11 Jul 2023 17:09:22 +0200 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 7CF783EE11 for ; Tue, 11 Jul 2023 17:09:21 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=lwJ89TCC; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1689088162; 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=zAvxDP+4IJj28/TkHpQ6PlWD7dvksArTs3Y2khAUHwE=; b=ABJb+xsT94056qJE/3TajVjzbHtfXzmtqSFjWGIlUXsUS3XVMvinI0ca9lUg10iP1tTode xgOmgUkQohfRYCqO4qARQ+f83dMZ7jTiKbj7NjJFhKOA9bkhyKCzmIaNxdvYhoGFjOq4xW GLBCHtYRo6xLpnbtJz5LhzWePLNdUIPstlVM60Vb/7rw33yPA7+BcJ7rPRiMd8L9JPHK2e 3bdw1AMkVunOPWDwHUYgfbc/6MN5/3ec+kjXduZntcatKZjXBzSUhem2fx7sUXkY9JCZTz jB2rUeT8LvGMxOC0ocLRUGn1YXZfgj1mVfcvpA9RX5TsJ3jB6bjLCgblj5LsJQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=lwJ89TCC; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1689088162; a=rsa-sha256; cv=none; b=ed5NtYFVtQ6OId8+JMMyVtROJOVBl5beoGkZfnZ8xUzyFsQ8JSPprmabA3r8Z3re8cq1Vs FX8V/UyGeVBgGPSPACItSRC3ip5gEeHQbs6EcxgA00T2AAKKoF9Wua5sB/vlC4bsQjIm/8 +wP54GfTUy/5ukBl7/hMZDE2wJb4KznsDBcsbI8ZCrhV5ueJuf+Njq0VKPBjgmpBx93PnX Ca1kRuq7kqOS/U2XLI7UQ2gFqj4h/4sRJMCZ6N1PeyjvwZuVpng44w2zJi9XzxHXp7ys4J Uuin46nHIVdCpAEkPIQTZwOr3LIfV8ZbSVZBL5gQ0dU9SOt7PmBUvZr6QlaLHg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJEyZ-0008JB-Vx; Tue, 11 Jul 2023 11:08:28 -0400 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 1qJEyW-0008HK-3O for emacs-orgmode@gnu.org; Tue, 11 Jul 2023 11:08:24 -0400 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 1qJEy0-0007r9-3I for emacs-orgmode@gnu.org; Tue, 11 Jul 2023 11:07:56 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 55F7D240105 for ; Tue, 11 Jul 2023 17:07:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1689088066; bh=WDi2mPRfG0yHOoS10+0Yg5AAqGfasNE1oafdkP8+wgQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=lwJ89TCCLm+LxCe05XQqVYrleIj6zO1zuI6odCdaOqUwYhQk7dZY1eqzlfgzHR9M+ qt3vhK2+qt9DAwdD1X/997GYx9dpiu9NTEOZczZa1HRQDpDuIRYIbwHZGLEdeqG9xK qPaCR+Asdf8NbCUNJ/LKklkIUjzqBCKfL1Um3qN1cNTv4ALEvAmNexP5vl4sXXd9cY Jo6jk3Pgpt3UiBcnmw4rV9IrJGbO6MKShQUPrBBSMrX3Etrr8d+GQSMi9ffNOXIQzs Pj6zDdfrNDIXyoetQ+PnXKueZc184pjzjFHHfQMGOtlzXtPp33YAI1Jz1sTopzsLS2 T7nCPFsQqT0kg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R0kkm3pcQz9rxN; Tue, 11 Jul 2023 17:07:44 +0200 (CEST) From: Ihor Radchenko To: Hammer Hu Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] Incorrect indentation when there are invisible/diplay properties on the line [9.6.7 ( @ /home/huzf/.cache/emacs_configs/default/elpa.28/org-9.6.7/)] In-Reply-To: References: <87mt027klw.fsf@localhost> <44rsvv2dwp2cnpbikqs7kysct5ylsxivm3scirj55efm7qvwat@flec34dbbdbb> <87fs5u7fcp.fsf@localhost> Date: Tue, 11 Jul 2023 15:07:52 +0000 Message-ID: <87cz0y7agn.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 7CF783EE11 X-Migadu-Spam-Score: -9.27 X-Migadu-Scanner: mx2.migadu.com X-Spam-Score: -9.27 X-TUID: c0exHVyeduwp Hammer Hu writes: > Please change bug.el to > > (add-hook 'org-mode-hook #'org-modern-mode) > (setq-default org-adapt-indentation t) > > Select the region and M-x indent-region multiple times. Thanks! A simpler reproducer: 1. /tmp/bug.org #+begin_quote foo #+end_quote 2. emacs -Q -L /path/to/compat/ -L /path/to/org-modern/ -l compat -l org-modern /tmp/bug.org 3. M-x org-modern-mode 4. Move to the beginning of #+begin_quote line 5. M-: (indent-line-to 3) 6. M-: (indent-line-to 3) 7. 8. M-x org-modern-mode 9. Observe overindentation The reason why this happens is the following: 1. indent-line-to tries hard to create indentation and move the beginning of visible text to column 3. 2. indent-line-to notices (at point (5)) that line is not indented at all. 3. It computes that it should insert " " to indent to column 3 and inserts these spaces. 4. org-modern-mode notices modification and re-hides spaces 5. indent-line-to is fires one more time at point (6) 6. indent-line-to notices that line is indented, but the leading whitespace is invisible. 7. It computes that it should yet insert extra " " to move the text to column 3 visually (because the existing spaces are hidden). 8. It inserts the extra spaces 9. org-modern-mode notices modification and re-hides added spaces. I believe that it is org-modern's fault. Indentation works are it supposed to and tried hard to align text visually to third column. org-modern fights against. Note that indenting visually is Emacs' convention that applies everywhere. Canceled. Not an Org mode bug. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at