emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] - Statistics cookie is part of the org heading title
@ 2022-05-03  9:27 Fabian
  2022-05-04  4:09 ` Daniel Fleischer
  2022-05-04 20:52 ` Nick Dokos
  0 siblings, 2 replies; 13+ messages in thread
From: Fabian @ 2022-05-03  9:27 UTC (permalink / raw)
  To: emacs-orgmode

Hi everybody,

I would like to report his behaviour as a bug: 
----
Example:

* Some Heading Title [0/1]              ;; cursor in this line when executing
** TODO Some Todo Item

-> result is "Some Heading Title [0/1]"

-> desired result would be "Some Heading Title"
----

I don't see any reason why the statistics cookie should be part of the title: it should be a separate component.

The Topic has beend posted on Stack here: https://emacs.stackexchange.com/questions/71592/extract-org-heading-title-without-task-count-e-g-0-0?noredirect=1#comment115659_71592

Best Regards, 

Fabian


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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-03  9:27 [BUG] - Statistics cookie is part of the org heading title Fabian
@ 2022-05-04  4:09 ` Daniel Fleischer
  2022-05-04  4:42   ` Samuel Wales
  2022-05-04 20:52 ` Nick Dokos
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel Fleischer @ 2022-05-04  4:09 UTC (permalink / raw)
  To: Fabian; +Cc: emacs-orgmode

Fabian <learning@hailmail.net> writes:

> I don't see any reason why the statistics cookie should be part of the title: it should be a separate component.

According to the spec, the statistics cookie can appear anywhere, it's a
text element. It can appear in a headline where it has more meaning and
also appear anywhere in the headline, not necessarily at the end. The
function you failed to mention but is mentioned in the link is
`org-heading-components` which does a simple split around syntax parts:
stars, TODO word, text, tags. If you don't want to see the cookie you
can remove it easily from text using regex.

-- 

Daniel Fleischer


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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-04  4:09 ` Daniel Fleischer
@ 2022-05-04  4:42   ` Samuel Wales
  2022-05-04  5:32     ` Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: Samuel Wales @ 2022-05-04  4:42 UTC (permalink / raw)
  To: Daniel Fleischer; +Cc: Fabian, emacs-orgmode

some code removes it.  for example creating a link to a headline using capture.

On 5/3/22, Daniel Fleischer <danflscr@gmail.com> wrote:
> Fabian <learning@hailmail.net> writes:
>
>> I don't see any reason why the statistics cookie should be part of the
>> title: it should be a separate component.
>
> According to the spec, the statistics cookie can appear anywhere, it's a
> text element. It can appear in a headline where it has more meaning and
> also appear anywhere in the headline, not necessarily at the end. The
> function you failed to mention but is mentioned in the link is
> `org-heading-components` which does a simple split around syntax parts:
> stars, TODO word, text, tags. If you don't want to see the cookie you
> can remove it easily from text using regex.
>
> --
>
> Daniel Fleischer
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com


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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-04  4:42   ` Samuel Wales
@ 2022-05-04  5:32     ` Ihor Radchenko
  2022-05-04  6:31       ` Ignacio Casso
  0 siblings, 1 reply; 13+ messages in thread
From: Ihor Radchenko @ 2022-05-04  5:32 UTC (permalink / raw)
  To: Samuel Wales; +Cc: Daniel Fleischer, Fabian, emacs-orgmode

Samuel Wales <samologist@gmail.com> writes:

> some code removes it.  for example creating a link to a headline using capture.

Yeah. org-link--normalize-string. But it is internal function, so I would
not rely on it.

Also, rather than relying on regexps, I would use
org-element-headline-parser, extract parsed :title property, and filter
out statistics-cookie objects.

Best,
Ihor


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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-04  5:32     ` Ihor Radchenko
@ 2022-05-04  6:31       ` Ignacio Casso
  2022-05-04 11:56         ` Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: Ignacio Casso @ 2022-05-04  6:31 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Samuel Wales, Daniel Fleischer, Fabian, emacs-orgmode


Ihor Radchenko <yantar92@gmail.com> writes:

> Samuel Wales <samologist@gmail.com> writes:
>
>> some code removes it.  for example creating a link to a headline using capture.
>
> Yeah. org-link--normalize-string. But it is internal function, so I would
> not rely on it.
>
> Also, rather than relying on regexps, I would use
> org-element-headline-parser, extract parsed :title property, and filter
> out statistics-cookie objects.
>
> Best,
> Ihor

I replied to this bug report yesterday via the "reply via email to"
button in
https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00058.html,
assuming it would send it to the org-mode list, but now I see that it
was only sent to Fabian. I copy my answer at the end of this email,
although when I wrote it I did not know that statistics cookies can
appear anywhere in the headline and not just at the end before tags, nor
about `org-element-headline-parser', so as a reply it may be no longer
relevant or correct.

Still, I think it might be interesting to compare this topic with the
one I linked in my reply,
https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html,
which it's basically the same bug report but about COMMENT keywords. In
that regard, I have tested that org-capture targets do work regardless
of statistcs cookies. Could not something equivalent be done so that
they also work regardless of COMMENT keywords? Feel free to reply in
that other thread if you feel this is off-topic here.

Regards,

--Ignacio

Original reply:

Hi Fabian,

> I would like to report his behaviour as a bug: 
> ----
> Example:
> 
> * Some Heading Title [0/1]              ;; cursor in this line when executing
> ** TODO Some Todo Item
> 
> -> result is "Some Heading Title [0/1]"
> 
> -> desired result would be "Some Heading Title"
> ----

You forgot to say that you use (nth 4 (org-heading-components)) when you
copied the example from emacs.stackexchange.com.


> I don't see any reason why the statistics cookie should be part of the title: 
> it should be a separate component.

I agree.

This bug is related with the issue I reported in
https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html. The
problem is that `org-heading-components' uses
`org-complex-heading-regexp', which does not consider statistics
cookies, and neither COMMENT keywords as I reported. I think it should be
updated to consider both.

In the meantime, I was going to suggest that you use the org parser,
with

  (org-element-property :title (org-element-context))

which solves the problem in the case of the COMMENT keywords. But I have
tested it and it does not solve it in the case of statistics cookies, so
I guess the problem should be fixed in org-element.el too.

Regards,

-- Ignacio


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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-04  6:31       ` Ignacio Casso
@ 2022-05-04 11:56         ` Ihor Radchenko
  2022-05-04 12:38           ` Alexander Adolf
                             ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ihor Radchenko @ 2022-05-04 11:56 UTC (permalink / raw)
  To: Ignacio Casso; +Cc: Samuel Wales, Daniel Fleischer, Fabian, emacs-orgmode

Ignacio Casso <ignaciocasso@hotmail.com> writes:

> I replied to this bug report yesterday via the "reply via email to"
> button in
> https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00058.html,
> assuming it would send it to the org-mode list, but now I see that it
> was only sent to Fabian.

It is not directly related to Org, though indeed annoying. I reported
this unexpected behaviour to mailman@gnu.org

> Still, I think it might be interesting to compare this topic with the
> one I linked in my reply,
> https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html,
> which it's basically the same bug report but about COMMENT keywords. In
> that regard, I have tested that org-capture targets do work regardless
> of statistcs cookies. Could not something equivalent be done so that
> they also work regardless of COMMENT keywords? Feel free to reply in
> that other thread if you feel this is off-topic here.

> This bug is related with the issue I reported in
> https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html. The
> problem is that `org-heading-components' uses
> `org-complex-heading-regexp', which does not consider statistics
> cookies, and neither COMMENT keywords as I reported. I think it should be
> updated to consider both.

Note that org-complex-heading-regexp-format does consider statistics
cookies, but only at the beginning/end of the headline title.
Unfortunately, it is impossible to provide generic printf format to
match a headline title with arbitrary statistics cookies inserted in the
middle of it.

As for your other report, it is a hard one - org-complex-heading-regexp
is hard to modify because we guarantee certain match groups and its hard
to fit COMMENT in there without breaking backward-compatibility.

I generally dislike the idea of the available plethora of analytic
regexps with numbered match groups. I am currently working on
generalised Org element matcher that provides named groups for arbitrary
Org syntax elements, including headlines.

Best,
Ihor


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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-04 11:56         ` Ihor Radchenko
@ 2022-05-04 12:38           ` Alexander Adolf
  2022-05-04 12:58             ` Ihor Radchenko
  2022-05-04 15:12           ` Reply to list from lists.gnu.org archives Max Nikulin
  2022-05-05 11:02           ` [BUG] - Statistics cookie is part of the org heading title Ignacio Casso
  2 siblings, 1 reply; 13+ messages in thread
From: Alexander Adolf @ 2022-05-04 12:38 UTC (permalink / raw)
  To: Ihor Radchenko
  Cc: Ignacio Casso, Samuel Wales, Daniel Fleischer, Fabian,
	emacs-orgmode

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

Would “fixing” this also remove the statistics cookie from agenda views? That would be a pity as I find it very useful there for my ways of using Org. 

Cheers,

  --alex

-- 
www.condition-alpha.com / @c_alpha
Sent from my iPhone; apologies for brevity and autocorrect weirdness. 

> On 4. May 2022, at 14:24, Ihor Radchenko <yantar92@gmail.com> wrote:
> 
> Ignacio Casso <ignaciocasso@hotmail.com> writes:
> 
>> I replied to this bug report yesterday via the "reply via email to"
>> button in
>> https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00058.html,
>> assuming it would send it to the org-mode list, but now I see that it
>> was only sent to Fabian.
> 
> It is not directly related to Org, though indeed annoying. I reported
> this unexpected behaviour to mailman@gnu.org
> 
>> Still, I think it might be interesting to compare this topic with the
>> one I linked in my reply,
>> https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html,
>> which it's basically the same bug report but about COMMENT keywords. In
>> that regard, I have tested that org-capture targets do work regardless
>> of statistcs cookies. Could not something equivalent be done so that
>> they also work regardless of COMMENT keywords? Feel free to reply in
>> that other thread if you feel this is off-topic here.
> 
>> This bug is related with the issue I reported in
>> https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html. The
>> problem is that `org-heading-components' uses
>> `org-complex-heading-regexp', which does not consider statistics
>> cookies, and neither COMMENT keywords as I reported. I think it should be
>> updated to consider both.
> 
> Note that org-complex-heading-regexp-format does consider statistics
> cookies, but only at the beginning/end of the headline title.
> Unfortunately, it is impossible to provide generic printf format to
> match a headline title with arbitrary statistics cookies inserted in the
> middle of it.
> 
> As for your other report, it is a hard one - org-complex-heading-regexp
> is hard to modify because we guarantee certain match groups and its hard
> to fit COMMENT in there without breaking backward-compatibility.
> 
> I generally dislike the idea of the available plethora of analytic
> regexps with numbered match groups. I am currently working on
> generalised Org element matcher that provides named groups for arbitrary
> Org syntax elements, including headlines.
> 
> Best,
> Ihor
> 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 1944 bytes --]

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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-04 12:38           ` Alexander Adolf
@ 2022-05-04 12:58             ` Ihor Radchenko
  2022-05-04 13:36               ` Alexander Adolf
  0 siblings, 1 reply; 13+ messages in thread
From: Ihor Radchenko @ 2022-05-04 12:58 UTC (permalink / raw)
  To: Alexander Adolf
  Cc: Ignacio Casso, Samuel Wales, Daniel Fleischer, Fabian,
	emacs-orgmode

Alexander Adolf <alexander.adolf@condition-alpha.com> writes:

> Would “fixing” this also remove the statistics cookie from agenda views? That would be a pity as I find it very useful there for my ways of using Org. 

No


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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-04 12:58             ` Ihor Radchenko
@ 2022-05-04 13:36               ` Alexander Adolf
  0 siblings, 0 replies; 13+ messages in thread
From: Alexander Adolf @ 2022-05-04 13:36 UTC (permalink / raw)
  To: Ihor Radchenko
  Cc: Ignacio Casso, Samuel Wales, Daniel Fleischer, Fabian,
	emacs-orgmode

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

Cool! Thanks for the swift confirmation. 

  --alex

-- 
www.condition-alpha.com / @c_alpha
Sent from my iPhone; apologies for brevity and autocorrect weirdness. 

> On 4. May 2022, at 15:00, Ihor Radchenko <yantar92@gmail.com> wrote:
> 
> Alexander Adolf <alexander.adolf@condition-alpha.com> writes:
> 
>> Would “fixing” this also remove the statistics cookie from agenda views? That would be a pity as I find it very useful there for my ways of using Org. 
> 
> No
> 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 1944 bytes --]

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

* Reply to list from lists.gnu.org archives
  2022-05-04 11:56         ` Ihor Radchenko
  2022-05-04 12:38           ` Alexander Adolf
@ 2022-05-04 15:12           ` Max Nikulin
  2022-05-04 15:29             ` Ihor Radchenko
  2022-05-05 11:02           ` [BUG] - Statistics cookie is part of the org heading title Ignacio Casso
  2 siblings, 1 reply; 13+ messages in thread
From: Max Nikulin @ 2022-05-04 15:12 UTC (permalink / raw)
  To: emacs-orgmode

On 04/05/2022 18:56, Ihor Radchenko wrote:
> Ignacio Casso writes:
> 
>> I replied to this bug report yesterday via the "reply via email to"
>> button in
>> https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00058.html,
>> assuming it would send it to the org-mode list, but now I see that it
>> was only sent to Fabian.
> 
> It is not directly related to Org, though indeed annoying. I reported
> this unexpected behaviour to mailman@gnu.org

There is an old request:

https://savannah.nongnu.org/support/?109873
sr #109873: Consider adding "Reply to All/List" buttons to GNU mailing 
list archives
Fri 09 Aug 2019 06:30:18 AM UTC

It seems only someone from Debian listmasters managed to configure 
MHonArc to add reply to list option. I am not familiar with the archive 
generator, so I am unsure if e.g. LIST resource is available out of the 
box or it is Debian customization. At least it is not mentioned in the 
docs. Unfortunately there is no e.g. a public repository with 
configuration of lists.debian.org.

In the case of lists.gnu.org it is necessary to update a python script 
that assembles mailto link from fragments (some anti-spam stuff).



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

* Re: Reply to list from lists.gnu.org archives
  2022-05-04 15:12           ` Reply to list from lists.gnu.org archives Max Nikulin
@ 2022-05-04 15:29             ` Ihor Radchenko
  0 siblings, 0 replies; 13+ messages in thread
From: Ihor Radchenko @ 2022-05-04 15:29 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

>>> I replied to this bug report yesterday via the "reply via email to"
>>> button in
>>> https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00058.html,
>>> assuming it would send it to the org-mode list, but now I see that it
>>> was only sent to Fabian.
>> 
>> It is not directly related to Org, though indeed annoying. I reported
>> this unexpected behaviour to mailman@gnu.org
>
> There is an old request:
>
> https://savannah.nongnu.org/support/?109873
> sr #109873: Consider adding "Reply to All/List" buttons to GNU mailing 
> list archives
> Fri 09 Aug 2019 06:30:18 AM UTC

FYI. I just got the following reply:

> Ihor Radchenko <yantar92@gmail.com> writes:
> 
> > Hi,
> > We just got a confused user who tried to reply to a thread in
> [ 5 more citation lines. Click/Enter to hide. ]
> > https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00075.html
> > via web "Reply" button. The button provides a mailto:? link, but it only
> > sets the To: field to the current message author. The list is not CCed.
> >
> > Expected behaviour would mimic Reply All functionality of mail clients.
> >
> > Best,
> > Ihor
> 
> Thanks for mentioning this. We got a patch sent in recently to fix this
> and I just haven't had time to work on it. I expect to have time this week.
> 
> [ 4-line signature. Click/Enter to hide. ]
> -- 
> Ian Kelling | Senior Systems Administrator, Free Software Foundation
> GPG Key: B125 F60B 7B28 7FF6 A2B7  DF8F 170A F0E2 9542 95DF
> https://fsf.org | https://gnu.org

Best,
Ihor


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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-03  9:27 [BUG] - Statistics cookie is part of the org heading title Fabian
  2022-05-04  4:09 ` Daniel Fleischer
@ 2022-05-04 20:52 ` Nick Dokos
  1 sibling, 0 replies; 13+ messages in thread
From: Nick Dokos @ 2022-05-04 20:52 UTC (permalink / raw)
  To: emacs-orgmode

Fabian <learning@hailmail.net> writes:

> Hi everybody,
>
> I would like to report his behaviour as a bug:

A crucial piece of information is missing here: this concerns the
behavior of the function `org-heading-components'.

> ----
> Example:
>
> * Some Heading Title [0/1]              ;; cursor in this line when executing
> ** TODO Some Todo Item
>
> -> result is "Some Heading Title [0/1]"
>
> -> desired result would be "Some Heading Title"
> ----
>
> I don't see any reason why the statistics cookie should be part of
> the title: it should be a separate component.
>
> The Topic has beend posted on Stack here:
> https://emacs.stackexchange.com/questions/71592/extract-org-heading-title-without-task-count-e-g-0-0?noredirect=1#comment115659_71592
>
> Best Regards, 
>
> Fabian
>
>

-- 
Nick

"There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors." -Martin Fowler



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

* Re: [BUG] - Statistics cookie is part of the org heading title
  2022-05-04 11:56         ` Ihor Radchenko
  2022-05-04 12:38           ` Alexander Adolf
  2022-05-04 15:12           ` Reply to list from lists.gnu.org archives Max Nikulin
@ 2022-05-05 11:02           ` Ignacio Casso
  2 siblings, 0 replies; 13+ messages in thread
From: Ignacio Casso @ 2022-05-05 11:02 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Samuel Wales, Daniel Fleischer, Fabian, emacs-orgmode


I've replied to this email in the original thread about the COMMENT
keyword to continue the discussion there, since it may be a little
off-topic here. --Ignacio


>> Still, I think it might be interesting to compare this topic with the
>> one I linked in my reply,
>> https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html,
>> which it's basically the same bug report but about COMMENT keywords. In
>> that regard, I have tested that org-capture targets do work regardless
>> of statistcs cookies. Could not something equivalent be done so that
>> they also work regardless of COMMENT keywords? Feel free to reply in
>> that other thread if you feel this is off-topic here.
>
>> This bug is related with the issue I reported in
>> https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html. The
>> problem is that `org-heading-components' uses
>> `org-complex-heading-regexp', which does not consider statistics
>> cookies, and neither COMMENT keywords as I reported. I think it should be
>> updated to consider both.
>
> Note that org-complex-heading-regexp-format does consider statistics
> cookies, but only at the beginning/end of the headline title.
> Unfortunately, it is impossible to provide generic printf format to
> match a headline title with arbitrary statistics cookies inserted in the
> middle of it.
>
> As for your other report, it is a hard one - org-complex-heading-regexp
> is hard to modify because we guarantee certain match groups and its hard
> to fit COMMENT in there without breaking backward-compatibility.
>
> I generally dislike the idea of the available plethora of analytic
> regexps with numbered match groups. I am currently working on
> generalised Org element matcher that provides named groups for arbitrary
> Org syntax elements, including headlines.
>
> Best,
> Ihor



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

end of thread, other threads:[~2022-05-05 11:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03  9:27 [BUG] - Statistics cookie is part of the org heading title Fabian
2022-05-04  4:09 ` Daniel Fleischer
2022-05-04  4:42   ` Samuel Wales
2022-05-04  5:32     ` Ihor Radchenko
2022-05-04  6:31       ` Ignacio Casso
2022-05-04 11:56         ` Ihor Radchenko
2022-05-04 12:38           ` Alexander Adolf
2022-05-04 12:58             ` Ihor Radchenko
2022-05-04 13:36               ` Alexander Adolf
2022-05-04 15:12           ` Reply to list from lists.gnu.org archives Max Nikulin
2022-05-04 15:29             ` Ihor Radchenko
2022-05-05 11:02           ` [BUG] - Statistics cookie is part of the org heading title Ignacio Casso
2022-05-04 20:52 ` Nick Dokos

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).