Re: Fwd: [BUG] Sparse tree does not work on properties with dashes

2024-03-19 Thread Protesilaos Stavrou
> From: Ihor Radchenko 
> Date: Tue, 19 Mar 2024 14:03:23 +
>
> Ihor Radchenko  writes:
>
>> `org-make-tags-matcher' is now supposed to handle \-escaped dashes in
>> properties. However, it does not seem to work:
>>
>> (org-make-tags-matcher "TEST\-HELLO=\"one\"" t) yields
>
> ... which was as expected - I forgot to quote \ inside "...".
>
> The problem was different - sparse tree should escape "-" in property
> names by itself when building the matcher.
>
> Fixed, on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=63b10621a

Thank you!

-- 
Protesilaos Stavrou
https://protesilaos.com



Re: Fwd: [BUG] Sparse tree does not work on properties with dashes

2024-03-19 Thread Ihor Radchenko
Ihor Radchenko  writes:

> `org-make-tags-matcher' is now supposed to handle \-escaped dashes in
> properties. However, it does not seem to work:
>
> (org-make-tags-matcher "TEST\-HELLO=\"one\"" t) yields

... which was as expected - I forgot to quote \ inside "...".

The problem was different - sparse tree should escape "-" in property
names by itself when building the matcher.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=63b10621a

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Fwd: [BUG] Sparse tree does not work on properties with dashes

2024-01-18 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> Expected behaviour: produce a sparse tree.
>>
>> Actual result: no sparse tree.
>
> Thanks for reporting!
> Confirmed.
>
> This is because `org-sparse-tree' will produce the following matcher:
>
>  TEST-HELLO="one"
>
> Which is interpreted as: Has tag "TEST" and does not have property
> "HELLO" set to "one".

`org-make-tags-matcher' is now supposed to handle \-escaped dashes in
properties. However, it does not seem to work:

(org-make-tags-matcher "TEST\-HELLO=\"one\"" t) yields

(progn
   (setq org-cached-props nil)
   (or
(and
 (not (string= (or (org-cached-entry-get nil \"HELLO\") \"\") \"one\"))
 (member \"TEST\" tags-list

Jens, do you have any ideas?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Fwd: [BUG] Sparse tree does not work on properties with dashes

2023-07-11 Thread Ihor Radchenko
Fabian Kurmann  writes:

> I can reproduce it with the sample in the annex, following the steps
> below:
>
> - Start Emacs with 'emacs -Q'
> - Open a new Org file
> - Add the contents of the Annex
> - Type 'C-c /' and then 'p' for property.
> - Select "TEST-HELLO"
> - Select any of the two values
>
> Expected behaviour: produce a sparse tree.
>
> Actual result: no sparse tree.

Thanks for reporting!
Confirmed.

This is because `org-sparse-tree' will produce the following matcher:

 TEST-HELLO="one"

Which is interpreted as: Has tag "TEST" and does not have property
"HELLO" set to "one".

AFAIK, there is currently no mechanism to escape "-" in matcher string.
`org-make-tags-matcher' assumes that property name can only contain
alphanumeric charters and underscore.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Fwd: [BUG] Sparse tree does not work on properties with dashes

2023-07-11 Thread Fabian Kurmann



Dear maintainers,

EXPLANATION HERE

I can reproduce it with the sample in the annex, following the steps
below:

- Start Emacs with 'emacs -Q'
- Open a new Org file
- Add the contents of the Annex
- Type 'C-c /' and then 'p' for property.
- Select "TEST-HELLO"
- Select any of the two values

Expected behaviour: produce a sparse tree.

Actual result: no sparse tree.

Best, Fabian


ANNEX

* Test with "one"
:PROPERTIES:
:TEST-HELLO: one
:END:

** Test with "two"
:PROPERTIES:
:TEST-HELLO: two
:END:

* Test with "two"
:PROPERTIES:
:TEST-HELLO: two
:END:

** Test with "one"
:PROPERTIES:
:TEST-HELLO: one
:END:

Emacs  : GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.33, cairo version 1.16.0)

 of 2022-05-31
Package: Org mode version 9.6.1 ( @ /home/fabian/.emacs.d/elpa/org-9.6.1/)