emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-clone-subtree-with-time-shift throws error [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
@ 2020-11-15 16:00 skaphle
  0 siblings, 0 replies; 5+ messages in thread
From: skaphle @ 2020-11-15 16:00 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org


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

Summary: using org-clone-subtree-with-time-shift on an entry with the ID property and a timestamp causes an error or does not create different IDs, which worked before 27.1.

Long Description:

I have a calendar file with a lot of entries, but I slimmed it down to a MWE:

=== begin MWE ===
* my appointment with id
  :PROPERTIES:
  :ID:       048c5a49-1aed-45d4-b7a9-34caf4f13266
  :END:
  <2020-11-15 Sun 15:30>
  example text
=== end MWE ===

I create such an entry routinely via a capture template with a timestamp and I add the text, and the ID is created with (add-hook 'org-capture-prepare-finalize-hook 'org-id-get-create). For repeating tasks, 10 weeks ago and before (i.e. before I updated to 27.1), I used to use `M-x org-clone-subtree-with-time-shift <RET> 10 <RET> +1w <RET>` and I got 10 repetitions, each with a separate unique ID.

I tried this now and I get an error "wrong-type-argument stringp nil", with the backtrace described below. If I change the order of the timestamp and the properties drawer in the MWE, I get the date-shifted clones but each with the same ID. In my calendar file with lots of entries, I still get the same error if I change the order, so I suspect that the function is context sensitive.

Anyway to reproduce the error,
1. save the above MWE in an org file
2. open the file with emacs -Q
3. activate debugger with `M-x toggle-debug-on-error <RET>`
4. run `M-x org-clone-subtree-with-time-shift <RET> 10 <RET> +1w <RET>`

The following backtrace is then produced:

=== begin backtrace ===
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^/tmp_mnt/" nil)
  abbreviate-file-name(nil)
  org-id-add-location("9f1a8e57-e9be-42aa-a113-f8f478cc2a1b" nil)
  org-id-get(1 create)
  org-id-get-create(t)
  org-clone-subtree-with-time-shift(10)
  funcall-interactively(org-clone-subtree-with-time-shift 10)
  call-interactively(org-clone-subtree-with-time-shift record nil)
  command-execute(org-clone-subtree-with-time-shift record)
  execute-extended-command(nil "org-clone-subtree-with-time-shift" "org-clone")
  funcall-interactively(execute-extended-command nil "org-clone-subtree-with-time-shift" "org-clone")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)
=== end backtrace ===

Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3)
 of 2020-08-28
Package: Org mode version 9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)

[-- Attachment #1.2: publickey - skaphle@pm.me - 0x0422F3DC.asc --]
[-- Type: application/pgp-keys, Size: 1770 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Bug: org-clone-subtree-with-time-shift throws error [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
@ 2020-11-16  8:59 skaphle
  2020-11-20  6:06 ` Kyle Meyer
  0 siblings, 1 reply; 5+ messages in thread
From: skaphle @ 2020-11-16  8:59 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org


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

Summary: using org-clone-subtree-with-time-shift on an entry with the ID property and a timestamp causes an error or does not create different IDs, which worked before 27.1.

Long Description:

I have a calendar file with a lot of entries, but I slimmed it down to a MWE:

=== begin MWE ===
* my appointment with id
  :PROPERTIES:
  :ID:       048c5a49-1aed-45d4-b7a9-34caf4f13266
  :END:
  <2020-11-15 Sun 15:30>
  example text
=== end MWE ===

I create such an entry routinely via a capture template with a timestamp and I add the text, and the ID is created with (add-hook 'org-capture-prepare-finalize-hook 'org-id-get-create). For repeating tasks, 10 weeks ago and before (i.e. before I updated to 27.1), I used to use `M-x org-clone-subtree-with-time-shift <RET> 10 <RET> +1w <RET>` and I got 10 repetitions, each with a separate unique ID.

I tried this now and I get an error "wrong-type-argument stringp nil", with the backtrace described below. If I change the order of the timestamp and the properties drawer in the MWE, I get the date-shifted clones but each with the same ID. In my calendar file with lots of entries, I still get the same error if I change the order, so I suspect that the function is context sensitive.

Anyway to reproduce the error,
1. save the above MWE in an org file
2. open the file with emacs -Q
3. activate debugger with `M-x toggle-debug-on-error <RET>`
4. run `M-x org-clone-subtree-with-time-shift <RET> 10 <RET> +1w <RET>`

The following backtrace is then produced:

=== begin backtrace ===
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^/tmp_mnt/" nil)
  abbreviate-file-name(nil)
  org-id-add-location("9f1a8e57-e9be-42aa-a113-f8f478cc2a1b" nil)
  org-id-get(1 create)
  org-id-get-create(t)
  org-clone-subtree-with-time-shift(10)
  funcall-interactively(org-clone-subtree-with-time-shift 10)
  call-interactively(org-clone-subtree-with-time-shift record nil)
  command-execute(org-clone-subtree-with-time-shift record)
  execute-extended-command(nil "org-clone-subtree-with-time-shift" "org-clone")
  funcall-interactively(execute-extended-command nil "org-clone-subtree-with-time-shift" "org-clone")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)
=== end backtrace ===

Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3)
 of 2020-08-28
Package: Org mode version 9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)

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

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

end of thread, other threads:[~2020-11-23 22:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15 16:00 Bug: org-clone-subtree-with-time-shift throws error [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)] skaphle
  -- strict thread matches above, loose matches on Subject: below --
2020-11-16  8:59 skaphle
2020-11-20  6:06 ` Kyle Meyer
2020-11-23 12:54   ` skaphle
2020-11-23 22:58     ` Kyle Meyer

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