From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id CLBBOJU5c2Wl/wAAauVa8A:P1 (envelope-from ) for ; Fri, 08 Dec 2023 16:43:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CLBBOJU5c2Wl/wAAauVa8A (envelope-from ) for ; Fri, 08 Dec 2023 16:43:18 +0100 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 8ECD363742 for ; Fri, 8 Dec 2023 16:43:17 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=plC7fEs9; 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=1702050197; 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=C3ISXXn2FMTMqtY2LKvUjtTdkj8Fb3soY2d/t+nFtas=; b=jDXxGUOeKZ4BBpNvUPLvmKl6kDsUxZ4MCWyLO7gAXS3KNOiuNf+cifCsvsQyrqGA0+KOcC lgP3o1bOTqCtU8VXcrAzLfKpR/j7ZKQnHstK2gk6EVYWPIS4Y0n5qV6OR87NSr6fvIUkKm aXZjh3xIP1Jiov4TXDTgXijhJYNBhMMTiuGgVJxGfA61EM+5FKbWTRl9yiSV8frtpLjX1W ZlbsMv1QqrQJN/KuKaLuECmvz6G13eT0fQBtuPj7YBw8tYSDY5JNO3TyxG9w5Mpyju1iHy gLRp6GgcInXV7koGUO/eKiPrWfj3ApieXEZeZYpcmeDhQ3ZBrtW9xSCmgRP/Xg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=plC7fEs9; 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=1702050197; a=rsa-sha256; cv=none; b=nAdIG9zXEBRAQJh/xEnpH+BJTWwkW9QhO62NO8MWr4SjYG2Mk4MpFTmuAd4M4Ajno91MZ8 /ci7npv10et9nmaPYFyuk9WHZIZsYdppLNM66/55Q+g+9QmMCMxFu39/rAsQigv+5eSurZ l2MeEwy2IouB+HsL5+aqOzbKtRMZwRZVCMlHZhiXe+vCbYqYGoqJ63nQRfVcpB8l37gkPb 4+yIN01+K8cXlUnIYMVg/JF7XXvaxDwvl5P++U/0noWuA0HyBFsU3QQxfr9Lv+W9TecOEG rvM+tpEM4xI3/PleITShqEFzsaJ3Rm2Ia3oMhHE9rKz5XWVLIbphWkUYuYSTRQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBczf-0003g6-MN; Fri, 08 Dec 2023 10:42:23 -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 1rBczY-0003dy-Tf for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 10:42:17 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBczU-0006mg-Qh for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 10:42:16 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BFCB4240027 for ; Fri, 8 Dec 2023 16:42:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702050128; bh=X+KxJCZ7cMCNCRPiAJgmxVM5hxFvKDtNuiRUYeixqwA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=plC7fEs97orJ51YeEPpFZ+4+DHEo1af5m80nWH6neiCCjDZrA+LIutgZqQKRyreaQ FV3pLgBFmExMHA+l0GcXBmqbfYSrCvji1Y+0qZWiUoA4sg7pwE9Ev/5A9Iq7CPjKQw oVJ6fjd1m7vWbyRt5BSKEQpVoOu5uTyOc1upLKmYzXiUwEjd+Fhw5ntA2OEerhH0j3 FUvJO2ePT68D2J5iXjRm2ap1mXOXYm987+4N/F7MYlf6izFsWf4FYrLeUqI5pJQeF2 2qplx1RfGaPDudCi98R3ZLd9BQkJDWNWVPPyDx2in7ZaCakHO1dQ3pQ0aiDS4CmE9B oYhbgMIjqLPqg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SmwPC72yxz9rxH; Fri, 8 Dec 2023 16:42:07 +0100 (CET) From: Ihor Radchenko To: "Nicolas P. Rougier (inria)" Cc: emacs-orgmode@gnu.org Subject: Re: Tags right alignment with font-lock In-Reply-To: References: Date: Fri, 08 Dec 2023 15:45:09 +0000 Message-ID: <87msukr94q.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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: 8ECD363742 X-Spam-Score: -9.36 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.36 X-TUID: a8ZaGhcaUvYs "Nicolas P. Rougier (inria)" writes: > I'm using font lock to have tags right aligned with the following > code: > > ;; Right alignment (char wise) > (add-to-list 'font-lock-extra-managed-props 'display) > (font-lock-add-keywords 'org-mode > `(("^\\*+.*?\\( \\)\\(:[[:alnum:]_@#%:]+:\\)$" > (1 `(face nil > display (space :align-to (- right 3 > ,(org-string-width > (match-string 2))))) > prepend))) t) > ... > I've not tested it thoroughly but it seems to be working > reasonably well on my machine. It is pretty similar to the code > posted by Ihor Radchenko (thread on "variable-pitch-mode misaligns > org-mode heading tags") and I wonder if there are any drawback > with such techniques (too slow? does not work on all situations?) The above code has problems when you try editing the heading near the end of the title (before the :align-to space). Especially when the window is narrow. Also, when `org-auto-align-tags' is nil. Not that they cannot be solved, but it is not just as trivial as the above code. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at