emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Cloning a task also clones the unique id [6.36trans]
@ 2010-05-14 16:13 Bernt Hansen
  2010-05-14 19:29 ` David Maus
  0 siblings, 1 reply; 9+ messages in thread
From: Bernt Hansen @ 2010-05-14 16:13 UTC (permalink / raw)
  To: emacs-orgmode


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

I use unique ids for my tasks (enabling org-id in org-modules)

If you clone a task with a unique id by using C-c C-x c the clone has a
copy of the property drawer with the same ID.

This causes org-id-update-id-locations to complain about duplicate ids.

Cloning a task should probably remove the :ID: property in the clone.

I haven't had time to look at a fix for this but figured I should report
it early anyway.

,----[ task to clone with C-c C-x C-c ]
| ** test task
|    :PROPERTIES:
|    :ID:       491b47b5-3ee0-4f33-b0ee-991d4ca546f5
|    :END:
`----

after cloning I get two identical copies - the second one shouldn't have
an ID (or should have a new unique id)

Regards,
Bernt


Emacs  : GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2008-11-09 on raven, modified by Debian
Package: Org-mode version 6.36trans

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

* Re: Bug: Cloning a task also clones the unique id [6.36trans]
  2010-05-14 16:13 Bug: Cloning a task also clones the unique id [6.36trans] Bernt Hansen
@ 2010-05-14 19:29 ` David Maus
  2010-05-14 19:44   ` Bernt Hansen
  0 siblings, 1 reply; 9+ messages in thread
From: David Maus @ 2010-05-14 19:29 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode


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

Bernt Hansen wrote:

>I use unique ids for my tasks (enabling org-id in org-modules)

>If you clone a task with a unique id by using C-c C-x c the clone has a
>copy of the property drawer with the same ID.

Commit b18a4f8a2b093f951fdd143b1331a135eab4e515 in
git://github.com/dmj/dmj-org-mode.git quickfix fixes this glitch by
removing the ID property of the clones of the original subtree.

It makes sense to not clone the ID properties if we think of it
representing the identity of a subtree.

HTH
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Bug: Cloning a task also clones the unique id [6.36trans]
  2010-05-14 19:29 ` David Maus
@ 2010-05-14 19:44   ` Bernt Hansen
  2010-05-14 20:04     ` David Maus
  0 siblings, 1 reply; 9+ messages in thread
From: Bernt Hansen @ 2010-05-14 19:44 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode

David Maus <dmaus@ictsoc.de> writes:

> Bernt Hansen wrote:
>
>>I use unique ids for my tasks (enabling org-id in org-modules)
>
>>If you clone a task with a unique id by using C-c C-x c the clone has a
>>copy of the property drawer with the same ID.
>
> Commit b18a4f8a2b093f951fdd143b1331a135eab4e515 in
> git://github.com/dmj/dmj-org-mode.git quickfix fixes this glitch by
> removing the ID property of the clones of the original subtree.
>
> It makes sense to not clone the ID properties if we think of it
> representing the identity of a subtree.

Hi David,

Thanks for this.  There's a problem with it if you don't do a time shift
when you clone -- in this case you don't remove the entry.

C-c C-x c 1 RET RET

produces a straight copy of the task including the id.

Regards,
Bernt

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

* Re: Bug: Cloning a task also clones the unique id [6.36trans]
  2010-05-14 19:44   ` Bernt Hansen
@ 2010-05-14 20:04     ` David Maus
  2010-05-14 20:25       ` Bernt Hansen
  0 siblings, 1 reply; 9+ messages in thread
From: David Maus @ 2010-05-14 20:04 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1318 bytes --]

Bernt Hansen wrote:
>David Maus <dmaus@ictsoc.de> writes:

>> Bernt Hansen wrote:
>>
>>>I use unique ids for my tasks (enabling org-id in org-modules)
>>
>>>If you clone a task with a unique id by using C-c C-x c the clone has a
>>>copy of the property drawer with the same ID.
>>
>> Commit b18a4f8a2b093f951fdd143b1331a135eab4e515 in
>> git://github.com/dmj/dmj-org-mode.git quickfix fixes this glitch by
>> removing the ID property of the clones of the original subtree.
>>
>> It makes sense to not clone the ID properties if we think of it
>> representing the identity of a subtree.

>Hi David,

>Thanks for this.  There's a problem with it if you don't do a time shift
>when you clone -- in this case you don't remove the entry.

>C-c C-x c 1 RET RET

>produces a straight copy of the task including the id.

Ah, yes, thanks.  Deleting the property occurred on the wrong place.  Fixed in
51a37ca09529e2597a863e7b7390da4409c750dc in
git://github.com/dmj/dmj-org-mode.git quickfix.

I'm not sure if we should delete an empty property drawer after
cloning, too.  E.g.  If the ID property was the only property of the
original subtree the clone have an empty property drawer.  Though, it
is just a cosmetic issue.

HTH
 -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Bug: Cloning a task also clones the unique id [6.36trans]
  2010-05-14 20:04     ` David Maus
@ 2010-05-14 20:25       ` Bernt Hansen
  2010-05-14 21:01         ` David Maus
  0 siblings, 1 reply; 9+ messages in thread
From: Bernt Hansen @ 2010-05-14 20:25 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode

David Maus <dmaus@ictsoc.de> writes:

> Ah, yes, thanks.  Deleting the property occurred on the wrong place.  Fixed in
> 51a37ca09529e2597a863e7b7390da4409c750dc in
> git://github.com/dmj/dmj-org-mode.git quickfix.
>
> I'm not sure if we should delete an empty property drawer after
> cloning, too.  E.g.  If the ID property was the only property of the
> original subtree the clone have an empty property drawer.  Though, it
> is just a cosmetic issue.

Personally I would prefer to delete the empty drawer.  I still have
weird behaviour with cloning a subtree.  I start with this:

,----
| * test task
|   :PROPERTIES:
|   :ID:       c3601a9c-d1f6-4e76-b7fc-707895112011
|   :END:
`----

and on the heading repeatedly clone it with C-c C-x c 1 RET RET

and I get this:

,----
| * test task
|   :PROPERTIES:
|   :ID:       c3601a9c-d1f6-4e76-b7fc-707895112011
|   :END:
| * test task
|   :PROPERTIES:
|   :END:
`----

then this

,----
| * test task
|   :PROPERTIES:
|   :ID:       c3601a9c-d1f6-4e76-b7fc-707895112011
|   :END:
| * test task
|   :PROPERTIES:
|   :ID:       c3601a9c-d1f6-4e76-b7fc-707895112011
|   :END:
| * test task
|   :PROPERTIES:
|   :END:
`----

then this

,----
| * test task
|   :PROPERTIES:
|   :ID:       c3601a9c-d1f6-4e76-b7fc-707895112011
|   :END:
| * test task
|   :PROPERTIES:
|   :ID:       c3601a9c-d1f6-4e76-b7fc-707895112011
|   :END:
| * test task
|   :PROPERTIES:
|   :END:
| * test task
|   :PROPERTIES:
|   :END:
`----

and as far as I can tell it behaves normally after the 3rd clone.  I
don't understand why the second clone keeps the ID.  All clones I've
tried after that produce the expected result with the empty property
drawer.

Org-mode version 6.36trans

GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) of 2008-11-09
on raven, modified by Debian

Regards,
Bernt

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

* Re: Bug: Cloning a task also clones the unique id [6.36trans]
  2010-05-14 20:25       ` Bernt Hansen
@ 2010-05-14 21:01         ` David Maus
  2010-05-14 23:05           ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: David Maus @ 2010-05-14 21:01 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1227 bytes --]

Bernt Hansen wrote:
>David Maus <dmaus@ictsoc.de> writes:

>> Ah, yes, thanks.  Deleting the property occurred on the wrong place.  Fixed in
>> 51a37ca09529e2597a863e7b7390da4409c750dc in
>> git://github.com/dmj/dmj-org-mode.git quickfix.
>>
>> I'm not sure if we should delete an empty property drawer after
>> cloning, too.  E.g.  If the ID property was the only property of the
>> original subtree the clone have an empty property drawer.  Though, it
>> is just a cosmetic issue.

>Personally I would prefer to delete the empty drawer.  I still have
>weird behaviour with cloning a subtree.  I start with this: [...]

Again, sorry, yes.  The problem was that I told Org to remove the ID
property at headline at point after inserting the clone.  Merely the
headline at point after insert is not necessarily the clone but a
sibling of the clone.

Now it is definetly fixed in git://github.com/dmj/dmj-org-mode.git
quickfix -- Org removes the ID property in the copy of the original
subtree before it is inserted anywhere.

Dang, you should always be sure where (point) is when depending
(point) to be somewhere specific.

HTH
 -- David

--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Bug: Cloning a task also clones the unique id [6.36trans]
  2010-05-14 21:01         ` David Maus
@ 2010-05-14 23:05           ` Carsten Dominik
  2010-05-17 13:00             ` Giovanni Ridolfi
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2010-05-14 23:05 UTC (permalink / raw)
  To: David Maus; +Cc: Bernt Hansen, emacs-orgmode

Applied, thanks.

- Carsten

On May 14, 2010, at 11:01 PM, David Maus wrote:

> Bernt Hansen wrote:
>> David Maus <dmaus@ictsoc.de> writes:
>
>>> Ah, yes, thanks.  Deleting the property occurred on the wrong  
>>> place.  Fixed in
>>> 51a37ca09529e2597a863e7b7390da4409c750dc in
>>> git://github.com/dmj/dmj-org-mode.git quickfix.
>>>
>>> I'm not sure if we should delete an empty property drawer after
>>> cloning, too.  E.g.  If the ID property was the only property of the
>>> original subtree the clone have an empty property drawer.  Though,  
>>> it
>>> is just a cosmetic issue.
>
>> Personally I would prefer to delete the empty drawer.  I still have
>> weird behaviour with cloning a subtree.  I start with this: [...]
>
> Again, sorry, yes.  The problem was that I told Org to remove the ID
> property at headline at point after inserting the clone.  Merely the
> headline at point after insert is not necessarily the clone but a
> sibling of the clone.
>
> Now it is definetly fixed in git://github.com/dmj/dmj-org-mode.git
> quickfix -- Org removes the ID property in the copy of the original
> subtree before it is inserted anywhere.
>
> Dang, you should always be sure where (point) is when depending
> (point) to be somewhere specific.
>
> HTH
> -- David
>
> --
> OpenPGP... 0x99ADB83B5A4478E6
> Jabber.... dmjena@jabber.org
> Email..... dmaus@ictsoc.de
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: Re: Bug: Cloning a task also clones the unique id [6.36trans]
  2010-05-14 23:05           ` Carsten Dominik
@ 2010-05-17 13:00             ` Giovanni Ridolfi
  2010-05-17 13:26               ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Giovanni Ridolfi @ 2010-05-17 13:00 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, Bernt Hansen

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On May 14, 2010, at 11:01 PM, David Maus wrote:
>> [...] Org removes the ID property in the copy of the original
>>  subtree before it is inserted anywhere.
>>
> Applied, thanks.
>
Arrrgh /me is too late, sorry! 

Feature request:

Would it be possible that org-mode changes the :ID: while cloning
and not delete it?

- we can have a variable 
  + org-clone-change-id 
    + nil : not change, delete it
    + t   : yes get a new :id:
- org-mode can ask every time 
  'do you want to change[C c] the :ID: or to delete [D d] it?'

   But isn't that boring?

cheers,
Giovanni

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

* Re: Re: Bug: Cloning a task also clones the unique id [6.36trans]
  2010-05-17 13:00             ` Giovanni Ridolfi
@ 2010-05-17 13:26               ` Carsten Dominik
  0 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2010-05-17 13:26 UTC (permalink / raw)
  To: Giovanni Ridolfi; +Cc: emacs-orgmode, Bernt Hansen

Hi Giovannui, this is good as well.  why don't you try to implement  
it... ?

- Carsten

On May 17, 2010, at 3:00 PM, Giovanni Ridolfi wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> On May 14, 2010, at 11:01 PM, David Maus wrote:
>>> [...] Org removes the ID property in the copy of the original
>>> subtree before it is inserted anywhere.
>>>
>> Applied, thanks.
>>
> Arrrgh /me is too late, sorry!
>
> Feature request:
>
> Would it be possible that org-mode changes the :ID: while cloning
> and not delete it?
>
> - we can have a variable
>  + org-clone-change-id
>    + nil : not change, delete it
>    + t   : yes get a new :id:
> - org-mode can ask every time
>  'do you want to change[C c] the :ID: or to delete [D d] it?'
>
>   But isn't that boring?
>
> cheers,
> Giovanni

- Carsten

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

end of thread, other threads:[~2010-05-17 13:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-14 16:13 Bug: Cloning a task also clones the unique id [6.36trans] Bernt Hansen
2010-05-14 19:29 ` David Maus
2010-05-14 19:44   ` Bernt Hansen
2010-05-14 20:04     ` David Maus
2010-05-14 20:25       ` Bernt Hansen
2010-05-14 21:01         ` David Maus
2010-05-14 23:05           ` Carsten Dominik
2010-05-17 13:00             ` Giovanni Ridolfi
2010-05-17 13:26               ` Carsten Dominik

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