From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UMwBCjpG92JXcgAAbAwnHQ (envelope-from ) for ; Sat, 13 Aug 2022 08:35:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KJAaCjpG92Kj/AAA9RJhRA (envelope-from ) for ; Sat, 13 Aug 2022 08:35:38 +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 3BEDB12C1B for ; Sat, 13 Aug 2022 08:35:37 +0200 (CEST) Received: from localhost ([::1]:60544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMkkC-0004yA-Ek for larch@yhetil.org; Sat, 13 Aug 2022 02:35:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMkhn-0004xJ-4K for emacs-orgmode@gnu.org; Sat, 13 Aug 2022 02:33:07 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:36691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMkhl-0003OY-AJ for emacs-orgmode@gnu.org; Sat, 13 Aug 2022 02:33:06 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 15-20020a17090a098f00b001f305b453feso10118093pjo.1 for ; Fri, 12 Aug 2022 23:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc; bh=dFksWaXH9DkVHlIcCYm4JT4PFdYhzn9OEUaaQYd3mV0=; b=PSBIP3aBZShlI0jRg5jMqRnnVSB3pVYJeLszrfwLvkW3AURE0Fy7LV7YucPzuYjH11 LthL6pV/Z3k9lSM9hJ1MzDhKgHwd+S0434RjfCBJ2mswA0Y5QFKrAq1Ti4LXYwnkPrb/ MJizON3H8YxuC4goPQX9h4Yt60zr1NQ4KAd3K39eVuYrXsjc5Hv2PKruzb6VJvv2ZVfk zSgcIbRTHduvKyjMiBEeW8oSF1I/HkFUBJ2fW+CrTBi/mnhFjlVTljsU1TyC/jF/yT/I ntoGRPOmzHTbjUj0qJAQqYcWB2tDBXKMsFTxtMveqoh6h4Kq/EtrNRHF8FtuWqikJP83 kIHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=dFksWaXH9DkVHlIcCYm4JT4PFdYhzn9OEUaaQYd3mV0=; b=Rwqdl+9kQiYjYVEIESTtLTw5CNxwvLmrxzlVqKuiWNz7TaV19TcWvIeGLbIdFWmUYe qsxveRveOGi9gDM1/DiQesnEeN/GFd3lJWpqRgfNIlLKo1/ZIUg6MvdMpTSTkdABdgSw uXdlXLuKoo7ZVjyHfz7gR/8AeN+gbD0Ahr3MLpqJbifjt7q7B5KoVbZITzHfk3PlVkSa ZeYGyyEDpngDsUWoB47/4DV4t/gMXDPjgnBYkptMFPAF20mZFgRebtHiTdmf8RDuSSRP LOP4vXZvt3o9O4BZevC025gW3dfy6izD9Tng8cDyzIfigABVaHbweqy5KLnM0Sor9v7c cwBg== X-Gm-Message-State: ACgBeo2JCfRVwdrQv9tbyrlqxl0Dt+fWQLnyKHc+Nckg39rR/hJoqS7K eHfCARWqnNrmZIXtVVzeZc5RIhGAfUM= X-Google-Smtp-Source: AA6agR6HJ4pF/Mkp7wweLxTEc8EK/HzcfyYicWMClelcKQiYJB8njsFC9fo9d3gnQuSZUaVPSTSK9Q== X-Received: by 2002:a17:903:4094:b0:170:ced1:5fb0 with SMTP id z20-20020a170903409400b00170ced15fb0mr7547837plc.138.1660372373228; Fri, 12 Aug 2022 23:32:53 -0700 (PDT) Received: from localhost ([2409:8a70:2bf:80b0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id h12-20020a170902b94c00b0016ef87334aesm2839482pls.162.2022.08.12.23.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 23:32:52 -0700 (PDT) From: Ihor Radchenko To: Alain.Cochard@unistra.fr Cc: Org Mode List Subject: Re: Suspected bug: '#+STARTUP: indent' messes up inlinetasks' tag alignment In-Reply-To: <25334.19025.107017.390781@gargle.gargle.HOWL> References: <25334.19025.107017.390781@gargle.gargle.HOWL> Date: Sat, 13 Aug 2022 14:33:54 +0800 Message-ID: <87tu6g7iul.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660372537; 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=dFksWaXH9DkVHlIcCYm4JT4PFdYhzn9OEUaaQYd3mV0=; b=DIspe35HqNNtR3bgvm6idIjf0K8KhXxvywwK8zs/3MdpVlTosznJrWuuxZzEVK8snLxKWP n6Dwqh/qxOY5MXFNwqsp9KAMb4LvBsxejzESbisFj8ywzIrxU7gVf7XGo/J/0Kg7cDfFem f76FMwMbIP664TqjJtKHf7ajMfvQ8HaYjbXIQ4dUrfET03wmUy8Fldj/iBN5VGOiXcoitC vbflX71SWQQPpyWhOmXme4jWwexo1sqby6vY3V3RXQNcLg7gKq1V3CHt6a/JZbjrERpLLN /qPVG3eixI+04krpyIjzCAJeywc7X12YYZO3irXb4ALwXUjtQVdy7TErhCSjuA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660372537; a=rsa-sha256; cv=none; b=XeKa06qKJ8IwQqrF/FVQ9JkuUtwsnwerGI+BvRME0UhhG1wfRoQqmmFnHHXOkJvHfSf/9D aDwPSeLrD/3WqT0DT4cOdoy+yP3wH+79gzzfD3YICqA7Id13rNGuvDBosVKgfhZn5Lt+af skNyD6o28eT/ecaxtdJhKQqF0u6EHNKtd4IaAqiwp+6KAlke4W/ZIIHrIIZyuIgZstE6al p4z2eRnnFy+MM6OKA1m4t4zGhZcu8hZB3Hb5cCpq0u5zNXO8oCB7sAWDLLLRHMBgBeWWlb QtUBKEsPaHjC3aWjp6gcoFRhHT5Flshji6c9jJdNVPPfT5/ejgArwmc7ShwL0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PSBIP3aB; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Spam-Score: -1.86 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PSBIP3aB; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Queue-Id: 3BEDB12C1B X-Spam-Score: -1.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: 9g1SzjPNwZfS --=-=-= Content-Type: text/plain Alain.Cochard@unistra.fr writes: > Then, to observe the problem, I can for example compare > > (1) visiting the file pb.org containing: > > #+STARTUP: noindent > * headline 1 :htag: > *************** inelinetask :itag: > *************** END > * headline 2 :htag: > > and doing C-u C-c C-q, to > > (2) the same, but with 'indent' instead of 'noindent'. > > For me, all 3 tags end up perfectly aligned in the case (1), while > ':itag:' is shifted to the right in case (2). Thanks for reporting! Can you try the attached patch? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-align-tags-Fix-tag-alignment-in-inlinetasks.patch >From 66260f723b64e20598766f14982f13c98fe40ee8 Mon Sep 17 00:00:00 2001 Message-Id: <66260f723b64e20598766f14982f13c98fe40ee8.1660372414.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sat, 13 Aug 2022 14:28:55 +0800 Subject: [PATCH] org-align-tags: Fix tag alignment in inlinetasks * lisp/org.el (org-align-tags): Re-use 'line-prefix text property when `org-indent-mode' is enabled. The old version partially copy-pasted the org-indent code and missed the new changes in inlinetask alignment. The new approach should be robust against future org-indent changes. Fixes https://orgmode.org/list/25334.19025.107017.390781@gargle.gargle.HOWL --- lisp/org.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 4eef56f45..2f528aaa4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11519,8 +11519,12 @@ (defun org-align-tags (&optional all) (let ((get-indent-column (lambda () (let ((offset (if (bound-and-true-p org-indent-mode) - (* (1- org-indent-indentation-per-level) - (1- (org-current-level))) + (save-excursion + (org-back-to-heading-or-point-min) + (length + (get-text-property + (line-end-position) + 'line-prefix))) 0))) (+ org-tags-column (if (> org-tags-column 0) (- offset) offset)))))) -- 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92 --=-=-=--