From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id WPoAIL2iH2agzwAAqHPOHw:P1 (envelope-from ) for ; Wed, 17 Apr 2024 12:21:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id WPoAIL2iH2agzwAAqHPOHw (envelope-from ) for ; Wed, 17 Apr 2024 12:21:49 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=f1hXHgf9; 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=1713349309; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=isB+tI+oJHFunp4NhkRex7fYTbTAbbH6ct1Raq3RJ98=; b=Z962xofRLR+zXmuM0p1gJqvo6uIuE3OPGhZzHoTuhjoCGeLSBW9IvkXoRov00DOSL/NjVY r/1SHdnhzMudz4/+OfLRM4D7mBOPbD6h0E4dut6g6Onf+skPNFf5cAB+n2/IIvMKT7JFIC wR2XPlx40l1lTvoMkX2+QFvomCNWOhb7+2cvqJjvOb3zLVmHYCtoP+awLV4xfyjncgrFRQ A+/XeIuyd210JYjJ/no2ssHDLLh4ZZMaeo3T6X8EQxlMGXCyYziJExf+tLYTCOw+Be/gLG eCQ7LTtrI6d9Gx9Taf7fLoTfup2W6hLZ//ncaRZFjAzBr5V8KJwA/ASy6V/bcw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713349309; a=rsa-sha256; cv=none; b=RKossEMtUdiZJinki5rYsRgbQ8gfkakIiOXEbPdzM2RNk5Ec288J5HZd2Ji+obBnaDUryx c9C77pegs07k0L8ITqYReFf4B/QlExqyAjO7udO/dQtnIQk9iRfs9C6Qid9tE7XQAcRBjM J9EbOhEWBWva7WkSm9nXfIbg1xxB/32SGktWTtmYCPggvGfu8IvQeolw8JtdhMKbxnyJJC XcC5fOlw2VCVs4I1pCPtn4cPNG5un+fXNttioInbA7+8c8PJ8ZUwF4WRw/kqhrl2Pw/Si9 Y+AnQmUjbbH3oYU5jb8qYE2cpWq/ZX+85r9VCMKcnSlnvP9H6ymiSh/zUiN3iw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=f1hXHgf9; 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 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 AF6361FA71 for ; Wed, 17 Apr 2024 12:21:47 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rx2PZ-0000l4-3f; Wed, 17 Apr 2024 06:21:05 -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 1rx2PL-0000c8-Te for emacs-orgmode@gnu.org; Wed, 17 Apr 2024 06:20:52 -0400 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 1rx2PI-0002lu-B5 for emacs-orgmode@gnu.org; Wed, 17 Apr 2024 06:20:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id ED52C240029 for ; Wed, 17 Apr 2024 12:20:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1713349240; bh=yt/6W2voQ2WpP6iIhcKAAbptBwzz+jV7v5gR1T35lIE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=f1hXHgf9hmZlSXSxWZBBLxSSKiNsw/MrXwdY5J0ZxA54srvj7e+7zmOuYqYEn6mS2 sEyde0szTJ9hj3h8dJ2BCX1T3h0xZC6FO67PrOGCf4K5pQ1DwbY7OmFy/vetRvnX9g r0kyOnTzSG6aW/wrWTi1GnGWPDlnsYilXZowHZStTwbrsfSdsAkJdtkpfN7xZ75bv4 XbLYRN5x5ptfrGQjAHRUwX7tVLJ0kpgCBJU+j7JN/iQ4CsnXU3Nx6pojcrrW97eA4A EDluZM9xIDmiZkD02rBjwBlR4tBrrotRMDRTP5x2s9I2yb0PxcrbiW4lpn+/c5jG6Z zdkBUsd51vFhA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VKH3p64VZz9rxT; Wed, 17 Apr 2024 12:20:38 +0200 (CEST) From: Ihor Radchenko To: emacs-orgmode@gnu.org Cc: Max Nikulin Subject: [POLL] Should we enable or disable automatic tag alignment by default everywhere Date: Wed, 17 Apr 2024 10:21:18 +0000 Message-ID: <87bk68nvc1.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-Spam-Score: -9.59 X-Spam-Score: -9.59 X-Migadu-Queue-Id: AF6361FA71 X-Migadu-Scanner: mx12.migadu.com X-TUID: hldSxwSOy2c8 --=-=-= Content-Type: text/plain Dear all, We have ~org-auto-align-tags~ option that controls whether editing commands re-align the tags. However, this option is only respected by some editing commands, like changing the headline level. Many other editing commands re-align tags unconditionally. For example, when * typing right here or deleting inside a heading with :tag1:tag2: the :tag1:tag2: automatically remains aligned, regardless of the value of ~org-auto-align-tags~. In the attached patch, I am changing all the commands in Org mode, including "self-insert" and "delete-backwards" to respect this option. However, because ~org-auto-align-tags~ is disabled by default, this will cause breaking change - there are many more commands in Org mode that re-align tags unconditionally compared to the commands that do take it into account. I'd like to ask you, Org mode users, whether we should flip the default value of ~org-auto-align-tags~ to t or leave it as nil - flipping the default value will preserve the behavior described above, but change the default behavior of ~org-promote~, ~org-demote~, ~org-todo~, ~org-delete-indentation~, and ~org-return~. Keeping the value nil, will change the default behavior when typing/deleting inside headline, in ~org-mobile-edit~, ~org-insert-heading~, ~org-edit-headline~, ~org-priority~, ~org-entry-put~, ~org-kill-line~. Or maybe should we keep the status quo with ~org-auto-align-tags~ sometimes respected and sometimes not? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Respect-org-auto-align-tags-in-all-the-editing-comma.patch >From 6f16612796076077c95176be0929677ffe8e0d3d Mon Sep 17 00:00:00 2001 Message-ID: <6f16612796076077c95176be0929677ffe8e0d3d.1713348551.git.yantar92@posteo.net> From: Ihor Radchenko Date: Wed, 17 Apr 2024 13:04:52 +0300 Subject: [PATCH] Respect `org-auto-align-tags' in all the editing commands * lisp/org-mobile.el (org-mobile-edit): * lisp/org.el (org-insert-heading): (org-edit-headline): (org-priority): (org-set-tags): (org-entry-put): (org-self-insert-command): (org-delete-backward-char): (org-delete-char): (org-kill-line): Only re-align tags when `org-auto-align-tags' is set to non-nil. * etc/ORG-NEWS (~org-auto-align-tags~ is not respected universally): Announce the breaking change. Link: https://orgmode.org/list/87msxoc3qp.fsf@localhost --- etc/ORG-NEWS | 10 ++++++++++ lisp/org-mobile.el | 2 +- lisp/org.el | 20 ++++++++++---------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index e61bd6988..e6dc35f87 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -13,6 +13,16 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org. * Version 9.7 (not released yet) ** Important announcements and breaking changes +*** ~org-auto-align-tags~ is not respected universally + +Previously, only a subset of Org editing commands respected +~org-auto-align-tags~ option. Now, it is no longer the case. All the +editing commands, including typing (~org-self-insert-command~) and +deletion respect the option. + +~org-auto-align-tags~ is still disabled by default. Now, none of the +Org editing commands re-align tags to ~org-tags-column~ by default. + *** Underline syntax now takes priority over subscript when both are applicable Previously, Org mode interpreted =(_text_)= as subscript. diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 83e0316fd..b34623686 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -1057,7 +1057,7 @@ (defun org-mobile-edit (what old new) (goto-char (match-beginning 4)) (insert new) (delete-region (point) (+ (point) (length current))) - (org-align-tags)) + (when org-auto-align-tags (org-align-tags))) (t (error "Heading changed in the mobile device and on the computer"))))))) diff --git a/lisp/org.el b/lisp/org.el index a53f36d33..c4475cd62 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6565,7 +6565,7 @@ (defun org-insert-heading (&optional arg invisible-ok level) ;; Preserve tags. (let ((split (delete-and-extract-region (point) (match-end 4)))) (if (looking-at "[ \t]*$") (replace-match "") - (org-align-tags)) + (when org-auto-align-tags (org-align-tags))) (end-of-line) (when blank? (insert "\n")) (insert "\n" stars " ") @@ -6677,7 +6677,7 @@ (defun org-edit-headline (&optional heading) (if old (replace-match new t t nil 4) (goto-char (or (match-end 3) (match-end 2) (match-end 1))) (insert " " new)) - (org-align-tags) + (when org-auto-align-tags (org-align-tags)) (when (looking-at "[ \t]*$") (replace-match "")))))))) (defun org-insert-heading-after-current () @@ -11215,7 +11215,7 @@ (defun org-priority (&optional action show) (insert " [#" news "]")) (goto-char (match-beginning 3)) (insert "[#" news "] ")))) - (org-align-tags)) + (when org-auto-align-tags (org-align-tags))) (if remove (message "Priority removed") (message "Priority of current item set to %s" news))))) @@ -12021,7 +12021,7 @@ (defun org-set-tags (tags) (unless (org-invisible-p (line-beginning-position)) (org-fold-region (point) (line-end-position) nil 'outline)))) ;; Align tags, if any. - (when tags (org-align-tags)) + (when (and tags org-auto-align-tags) (org-align-tags)) (when tags-change? (run-hooks 'org-after-tags-change-hook)))))) (defun org-change-tag-in-region (beg end tag off) @@ -13261,10 +13261,10 @@ (defun org-entry-put (epom property value) ((not (member value org-todo-keywords-1)) (user-error "\"%s\" is not a valid TODO state" value))) (org-todo value) - (org-align-tags)) + (when org-auto-align-tags (org-align-tags))) ((equal property "PRIORITY") (org-priority (if (org-string-nw-p value) (string-to-char value) ?\s)) - (org-align-tags)) + (when org-auto-align-tags (org-align-tags))) ((equal property "SCHEDULED") (forward-line) (if (and (looking-at-p org-planning-line-re) @@ -17088,7 +17088,7 @@ (defun org-self-insert-command (N) ;; Interactively, point should never be inside invisible regions (org-fold-core-suppress-folding-fix (self-insert-command N) - (org-fix-tags-on-the-fly)) + (when org-auto-align-tags (org-fix-tags-on-the-fly))) (when org-self-insert-cluster-for-undo (if (not (eq last-command 'org-self-insert-command)) (setq org-self-insert-command-undo-counter 1) @@ -17118,7 +17118,7 @@ (defun org-delete-backward-char (N) (org-at-table-p)) (progn (forward-char -1) (org-delete-char 1)) (funcall-interactively #'backward-delete-char N) - (org-fix-tags-on-the-fly)))) + (when org-auto-align-tags (org-fix-tags-on-the-fly))))) (defun org-delete-char (N) "Like `delete-char', but insert whitespace at field end in tables. @@ -17134,7 +17134,7 @@ (defun org-delete-char (N) (save-excursion (skip-chars-backward " \t") (bolp)) (not (org-at-table-p))) (delete-char N) - (org-fix-tags-on-the-fly)) + (when org-auto-align-tags (org-fix-tags-on-the-fly))) ((looking-at ".\\(.*?\\)|") (let* ((update? org-table-may-need-update) (noalign (looking-at-p ".*? |"))) @@ -21175,7 +21175,7 @@ (defun org-kill-line (&optional _arg) (kill-region (point) (line-end-position)) (kill-region (point) end))) ;; Only align tags when we are still on a heading: - (if (org-at-heading-p) (org-align-tags))) + (if (and (org-at-heading-p) org-auto-align-tags) (org-align-tags))) (t (kill-region (point) (line-end-position))))) (defun org-yank (&optional arg) -- 2.44.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--