emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: pinmacs@cas.cat
To: emacs-orgmode@gnu.org
Subject: BUG: after an org-capture to an inbox entry, statistics-cookies are not updated on certain circumstances
Date: Sun, 1 Sep 2024 22:55:10 +0200	[thread overview]
Message-ID: <cc5ea0fa-a49b-4376-b077-74aae46e58ad@cas.cat> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 600 bytes --]

Hi,

I am living with this bug since a long time, I thought I was asking 
maybe something very special.

But then I find on a org-capture that goes to an inbox entry:

1. if prepend is nil, does not work on the first time (?)
2. works when number of entries is greater than 1
3. never works when prepend is t

Find attached org-capture-cookies-bug.org which I think it makes it very 
easy to reproduce. Tested with ~emacs -Q~ with orgmode 9.7.10 and 
emacs-30 branch with commit 44c2614

Cheers,
pinmacs

[1] I mean, like running this function: (org-update-statistics-cookies nil)

[-- Attachment #1.1.2: org-capture-cookies-bug.org --]
[-- Type: text/org, Size: 1179 bytes --]

#+TODO: TODO | DONE

* inbox ~:prepend nil~ works except first element (?) [3/3] [100%]
:PROPERTIES:
:CUSTOM_ID: inbox_prepend_nil
:END:
** DONE Test title
** DONE Test title
** DONE Test title
* inbox ~:prepend t~ never works (?) [0/0] [0%]
:PROPERTIES:
:CUSTOM_ID: inbox_prepend_t
:END:
** DONE Test title
** DONE Test title
** DONE Test title
* run this

with ~:prepend nil~, cookies are updated, *except for some reason, the first item*

#+name: prepend_t
#+begin_src emacs-lisp :results none
(defun my/goto ()
  (org-link-open-from-string "[[#inbox_prepend_nil]]"))
(setq org-capture-templates
      '(
        ("t" "test" entry (function my/goto)  "** DONE Test title" :immediate-finish t :prepend nil)
        ))

;; run org-capture noninteractive
(org-capture nil "t")
#+end_src

with ~:prepend t~, cookies are *not* updated

#+name: prepend_nil
#+begin_src emacs-lisp :results none
(defun my/goto ()
  (org-link-open-from-string "[[#inbox_prepend_t]]"))
(setq org-capture-templates
      '(
        ("t" "test" entry (function my/goto)  "** DONE Test title" :immediate-finish t :prepend t)
        ))

;; run org-capture noninteractive
(org-capture nil "t")
#+end_src



[-- Attachment #1.1.3: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3323 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

             reply	other threads:[~2024-09-01 20:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-01 20:55 pinmacs [this message]
2024-09-08 18:10 ` BUG: after an org-capture to an inbox entry, statistics-cookies are not updated on certain circumstances Ihor Radchenko
2024-09-09 16:28   ` pinmacs
2024-09-15 10:12     ` Ihor Radchenko
2024-09-15 15:56       ` pinmacs
2024-09-16 19:18         ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc5ea0fa-a49b-4376-b077-74aae46e58ad@cas.cat \
    --to=pinmacs@cas.cat \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).