emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-entry-delete vs org-entry-put
@ 2017-01-21 10:15 Michael Welle
  2017-01-22 13:31 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Welle @ 2017-01-21 10:15 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I'm hacking a function to deactivate and activate recurring tasks
without losing the time stamp associated with the scheduled property. I
observed two things so far:

1. Property names like DISABLED-SCHEDULED seem to be problematic. I
   guess the regexp matching the scheduled property is too greedy.

2. (org-entry-put pom "SCHEDULED" nil) removes the property, but
   (org-entry-delete pom "SCHEDULED")  doesn't. On the other hand,   
   (org-entry-put pom "foo" nil) doesn't remove the property, but
   (org-entry-delete pom "foo")  does. It's no real problem, but that
   seems a bit inconsistent to me. Is that intended behaviour?

Regards
hmw

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

* Re: org-entry-delete vs org-entry-put
  2017-01-21 10:15 org-entry-delete vs org-entry-put Michael Welle
@ 2017-01-22 13:31 ` Nicolas Goaziou
  2017-01-22 13:50   ` Michael Welle
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2017-01-22 13:31 UTC (permalink / raw)
  To: Michael Welle; +Cc: emacs-orgmode

Hello,

Michael Welle <mwe012008@gmx.net> writes:

> 1. Property names like DISABLED-SCHEDULED seem to be problematic. I
>    guess the regexp matching the scheduled property is too greedy.

What exactly is problematic? Could you expound a bit?

> 2. (org-entry-put pom "SCHEDULED" nil) removes the property, but
>    (org-entry-delete pom "SCHEDULED")  doesn't.

Fixed: `org-entry-delete' now deletes wrong "SCHEDULED" property. Thank
you.

>    On the other hand,   
>    (org-entry-put pom "foo" nil) doesn't remove the property, but
>    (org-entry-delete pom "foo")  does.

I don't see any problem here given the docstring of `org-entry-put'.

Regards,

-- 
Nicolas Goaziou

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

* Re: org-entry-delete vs org-entry-put
  2017-01-22 13:31 ` Nicolas Goaziou
@ 2017-01-22 13:50   ` Michael Welle
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Welle @ 2017-01-22 13:50 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Michael Welle <mwe012008@gmx.net> writes:
>
>> 1. Property names like DISABLED-SCHEDULED seem to be problematic. I
>>    guess the regexp matching the scheduled property is too greedy.
>
> What exactly is problematic? Could you expound a bit?
no, I can reproduce it today... My initial idea was to use something
like that: 

(org-entry-put pom "DISABLED-SCHEDULED" "bar")

But the created property was always named DISABLED-SCHED or DISABLED-SCHE
I can't remember exactly how the regexp matching part was meant. I tried
that a few times and every property with SCHEDULED in its name failed
that way. Sorry for the noise. 


>> 2. (org-entry-put pom "SCHEDULED" nil) removes the property, but
>>    (org-entry-delete pom "SCHEDULED")  doesn't.
>
> Fixed: `org-entry-delete' now deletes wrong "SCHEDULED" property. Thank
> you.
Thank you.


>
>>    On the other hand,   
>>    (org-entry-put pom "foo" nil) doesn't remove the property, but
>>    (org-entry-delete pom "foo")  does.
>
> I don't see any problem here given the docstring of `org-entry-put'.
No, there is no problem. I just wanted to point out, that o-e-p and
o-e-d behave different, if fed with a well known property like SCHEDULE
and a property like foo. I have no preference if (o-e-d pom "SCHEDULED")
deletes the property (like it is now) or if (o-e-p pom "foo" nil)
deletes the non well known properties. 

Regards
hmw

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

end of thread, other threads:[~2017-01-22 13:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-21 10:15 org-entry-delete vs org-entry-put Michael Welle
2017-01-22 13:31 ` Nicolas Goaziou
2017-01-22 13:50   ` Michael Welle

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