Re: [O] Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2]

2019-01-08 Thread Kaushal Modi
On Fri, Jan 4, 2019 at 4:43 PM Kaushal Modi  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
.


Re: [O] Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2]

2019-01-04 Thread Kaushal Modi
On Fri, Jan 4, 2019 at 8:15 AM Nicolas Goaziou 
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


Re: [O] Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2]

2019-01-04 Thread Nicolas Goaziou
Hello,

Kaushal Modi  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



[O] Change in order of tag collation from #+filetags plus heading tags [Regression 9.1 -> 9.2]

2019-01-03 Thread Kaushal Modi
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