emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* add automatically a counter to a header/TODO???
@ 2021-11-01 17:58 Uwe Brauer
  2021-11-01 19:53 ` Uwe Brauer
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2021-11-01 17:58 UTC (permalink / raw)
  To: emacs-orgmode


Hi

I am using a poor man's issue system
the org file in question has header of the form.




** WAIT \eqref{eq:section5-blowup:1} is referred as an item not an equation!
   :PROPERTIES:
   :ID:       Issues
   :Date:     <2021-11-01 lun>
   :STATUS:   [ ]
   :Is:       11
   :END:

I was wondering whether 

    - I could automatically insert in the HEADER a counter like 
    ** WAIT 1: \eqref{eq:section5-blowup:1} is referred as an item not 
    an equation
   - or in the drawer like this 

** WAIT \eqref{eq:section5-blowup:1} is referred as an item not an equation!
   :PROPERTIES:
   :ID:       Issues
   :Date:     <2021-11-01 lun>
   :STATUS:   [ ]
   :Is:       automatically inserted
   :END:

Regards

Uwe Brauer 



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

* Re: add automatically a counter to a header/TODO???
  2021-11-01 17:58 add automatically a counter to a header/TODO??? Uwe Brauer
@ 2021-11-01 19:53 ` Uwe Brauer
  2021-11-02 11:23   ` Eric S Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2021-11-01 19:53 UTC (permalink / raw)
  To: emacs-orgmode

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

>>> "UB" == Uwe Brauer <oub@mat.ucm.es> writes:

> Hi

> I am using a poor man's issue system
> the org file in question has header of the form.




> ** WAIT \eqref{eq:section5-blowup:1} is referred as an item not an equation!
>    :PROPERTIES:
>    :ID:       Issues
>    :Date:     <2021-11-01 lun>
>    :STATUS:   [ ]
>    :Is:       11
>    :END:

> I was wondering whether 

>     - I could automatically insert in the HEADER a counter like 
>     ** WAIT 1: \eqref{eq:section5-blowup:1} is referred as an item not 
>     an equation
>    - or in the drawer like this 

> ** WAIT \eqref{eq:section5-blowup:1} is referred as an item not an equation!
>    :PROPERTIES:
>    :ID:       Issues
>    :Date:     <2021-11-01 lun>
>    :STATUS:   [ ]
>    :Is:       automatically inserted
>    :END:

I found an answer in
https://stackoverflow.com/questions/27937446/how-to-vote-for-a-heading-in-org-mode

Which works nicely although 

(add-to-list 'org-speed-commands-user '("+" . (plusone)))

Is no longer valid, so I bound that function just to another key.

One question remains: is there any way to take the counter down?

(defun plusone ()
  "Increase the VOTES property in an org-heading by one. Create
the property if needed."
  (interactive)
  (org-entry-put
   (point)
   "VOTES"
   (format "%s" (+ 1 (string-to-number
              (or
               (org-entry-get (point) "VOTES")
               "0"))))))


The genius in me, though 

   (format "%s" (- 1 (string-to-number

Would do that but it does not, strange, 

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

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

* Re: add automatically a counter to a header/TODO???
  2021-11-01 19:53 ` Uwe Brauer
@ 2021-11-02 11:23   ` Eric S Fraga
  2021-11-03  8:06     ` Uwe Brauer
  0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2021-11-02 11:23 UTC (permalink / raw)
  To: emacs-orgmode

On Monday,  1 Nov 2021 at 20:53, Uwe Brauer wrote:
>    (format "%s" (- 1 (string-to-number

Shouldn't this be the other way around, i.e.
(- (string-to-number ...) 1)
?

-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-186-gb135b8
: Latest paper written in org: https://arxiv.org/abs/2106.05096


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

* Re: add automatically a counter to a header/TODO???
  2021-11-02 11:23   ` Eric S Fraga
@ 2021-11-03  8:06     ` Uwe Brauer
  2021-11-03 20:20       ` Samuel Wales
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2021-11-03  8:06 UTC (permalink / raw)
  To: emacs-orgmode

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

>>> "ESF" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Monday,  1 Nov 2021 at 20:53, Uwe Brauer wrote:
>> (format "%s" (- 1 (string-to-number

> Shouldn't this be the other way around, i.e.
> (- (string-to-number ...) 1)
> ?

Oops you are right, thanks

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

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

* Re: add automatically a counter to a header/TODO???
  2021-11-03  8:06     ` Uwe Brauer
@ 2021-11-03 20:20       ` Samuel Wales
  0 siblings, 0 replies; 5+ messages in thread
From: Samuel Wales @ 2021-11-03 20:20 UTC (permalink / raw)
  To: emacs-orgmode

idk if this is useful, but i was thinking of doing something similar,
except, automatically for the purpose of recording progress.

as in, the number of times i did something to the task.  in tags not
properties, thus on the header.  like :n_2:

i tried keywords for progress instead, but that is coarse [cannot
"reward" tiny progress] and requires decision making -- is this
started or progressed?  that can be too much cognitive overhead for
me.  should i really be deciding if it has progressed?

also design decisions --- should i sort up or down by progress kw?
up makes more progressed more visible, but usually one puts more
progressed downward [e.g. doneish is toward bottom].  and
too ugly if they are unsorted, with mixed keywords.

so i thought, what if i could just have, say, started, and then, to
increment the counter, i change the keyword to itself, started.

i don't have the capacity to implement this, and i'm not sure it's
what i want, but maybe the change to itself idea is useful.


On 11/3/21, Uwe Brauer <oub@mat.ucm.es> wrote:
>>>> "ESF" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> On Monday,  1 Nov 2021 at 20:53, Uwe Brauer wrote:
>>> (format "%s" (- 1 (string-to-number
>
>> Shouldn't this be the other way around, i.e.
>> (- (string-to-number ...) 1)
>> ?
>
> Oops you are right, thanks
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


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

end of thread, other threads:[~2021-11-03 20:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 17:58 add automatically a counter to a header/TODO??? Uwe Brauer
2021-11-01 19:53 ` Uwe Brauer
2021-11-02 11:23   ` Eric S Fraga
2021-11-03  8:06     ` Uwe Brauer
2021-11-03 20:20       ` Samuel Wales

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