emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2]
@ 2019-01-03 23:40 Kaushal Modi
  2019-01-04 13:15 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Kaushal Modi @ 2019-01-03 23:40 UTC (permalink / raw)
  To: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 728 bytes --]

Hello,

I have noticed a minor regression in the order in which Org collects the
"ALLTAGS" tags at point.

Here is a simple Org file to reproduce that issue:

=====
#+filetags: a

* Level 1
:b:
** Level 2
:c:
*** Level 3
:d:

=====

With point anywhere under ~* Level 3~ heading, evaluate:

M-: (org-entry-get (point) "ALLTAGS")


In Org 9.1.x, the order of tags returned was ":a:b:c:d:".
But in Org 9.2, the order becomes ":b:c:a:d:".

So, earlier (Org 9.1.x) the order was:
1. tags from filetags
2. tags from parent headings in order
3. current heading tags

In Org 9.2, the order is:
1. *tags from parent headings in order*
2. *tags from filetags*
3. current heading tags

Is this switch of order expected?


--
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 1663 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2]
  2019-01-03 23:40 Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2] Kaushal Modi
@ 2019-01-04 13:15 ` Nicolas Goaziou
  2019-01-04 21:43   ` Kaushal Modi
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2019-01-04 13:15 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: emacs-org list

Hello,

Kaushal Modi <kaushal.modi@gmail.com> writes:

> I have noticed a minor regression in the order in which Org collects the
> "ALLTAGS" tags at point.
>
> Here is a simple Org file to reproduce that issue:
>
> =====
>
> #+filetags: a
>
> * Level 1
> :b:
> ** Level 2
> :c:
> *** Level 3
> :d:
>
> =====
>
> With point anywhere under ~* Level 3~ heading, evaluate:
>
> M-: (org-entry-get (point) "ALLTAGS")
>
>
> In Org 9.1.x, the order of tags returned was ":a:b:c:d:".
> But in Org 9.2, the order becomes ":b:c:a:d:".
>
> So, earlier (Org 9.1.x) the order was:
> 1. tags from filetags
> 2. tags from parent headings in order
> 3. current heading tags
>
> In Org 9.2, the order is:
> 1. *tags from parent headings in order*
> 2. *tags from filetags*
> 3. current heading tags
>
> Is this switch of order expected?

The order of tags is unspecified, either in the docstring, in the
manual, or in the syntax. So it doesn't really matter.

Feel free to provide a patch if it bothers you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2]
  2019-01-04 13:15 ` Nicolas Goaziou
@ 2019-01-04 21:43   ` Kaushal Modi
  2019-01-08 16:41     ` Kaushal Modi
  0 siblings, 1 reply; 4+ messages in thread
From: Kaushal Modi @ 2019-01-04 21:43 UTC (permalink / raw)
  To: emacs-org list, Matt Lundin; +Cc: Nicolas Goaziou

[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]

On Fri, Jan 4, 2019 at 8:15 AM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

>
> The order of tags is unspecified, either in the docstring, in the
> manual, or in the syntax. So it doesn't really matter.
>

This regression was caught by one of the ox-hugo tests. I'd to like to fix
it to the former tag order because I think it makes sense to have the
#+filetags tags in the very beginning instead of embedding it between the
parent heading tags and local tags.


> Feel free to provide a patch if it bothers you.
>

Here is the proposed rough patch; locally I also have a test ready that
tests this regression.

=====
diff --git a/lisp/org.el b/lisp/org.el
index 2273a6997..15744704a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14607,11 +14607,11 @@ Inherited tags have the `inherited' text
property."
         (org-back-to-heading t)
         (let ((ltags (org--get-local-tags)) itags)
           (if (or local (not org-use-tag-inheritance)) ltags
-        (setq itags org-file-tags)
             (while (org-up-heading-safe)
               (setq itags (append (mapcar #'org-add-prop-inherited
                                           (org--get-local-tags))
                                   itags)))
+            (setq itags (append org-file-tags itags))
             (delete-dups
              (append (org-remove-uninherited-tags itags) ltags))))))))
=====

I am also copying Matt Lundin as I believe that this commit[1] caused this
regression.

If above looks good, I will go ahead the commit this patch with test,
proper commit log, etc.

Thanks for reviewing.

[1]:
https://code.orgmode.org/bzg/org-mode/commit/5e27b2fd326810e4ed876b094df852338909c1f8

[-- Attachment #2: Type: text/html, Size: 2670 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2]
  2019-01-04 21:43   ` Kaushal Modi
@ 2019-01-08 16:41     ` Kaushal Modi
  0 siblings, 0 replies; 4+ messages in thread
From: Kaushal Modi @ 2019-01-08 16:41 UTC (permalink / raw)
  To: emacs-org list, Matt Lundin; +Cc: Nicolas Goaziou

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

On Fri, Jan 4, 2019 at 4:43 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:

> I am also copying Matt Lundin as I believe that this commit[1] caused this
> regression.
>
> If above looks good, I will go ahead the commit this patch with test,
> proper commit log, etc.
>

I went ahead and committed this fix to maint (and merged to master) as it
did not fail any existing test:
https://code.orgmode.org/bzg/org-mode/commit/34e5dcfb06800802a5e06f13340d646b6d829f04
.

[-- Attachment #2: Type: text/html, Size: 992 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-08 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03 23:40 Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2] Kaushal Modi
2019-01-04 13:15 ` Nicolas Goaziou
2019-01-04 21:43   ` Kaushal Modi
2019-01-08 16:41     ` Kaushal Modi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).