0

Whenever I create org-mode entries using org-capture they automatically get an ID property. Is it possible to disable that? I'm using org mode version 9.0.5.

  • 1
    It is difficult to believe that org-mode 9.0.5 would force users to create ID when launching a new org-capture. I'd bet my lunch money that you have changed the default settings which inadvertently createed this issue. – lawlist Feb 20 '17 at 8:47
  • Have a look at the doc-string org-id-link-to-org-use-id and see if you are doing something as described ... – lawlist Feb 20 '17 at 8:59
  • The ID is not created when launching org-capture, it is created after storing the capture (so I can't see the ID property in the capture buffer). I think its a good thing to use ID properties usually, but in this case I did not want them. My org-id-link-to-org-use-id is nil. I haven't anything related to IDs in my init-file. Perhaps one of my other org-mode related installed packages do something: worf, ox-reveal, interleave, org-ref, deft. – Erik Sjöstrand Feb 20 '17 at 9:04
  • But yes, using emacs -Q org-mode doesn't seem to create IDs by default. Then its org-mode version 8.2.10 though. – Erik Sjöstrand Feb 20 '17 at 9:10
  • Please post the relevant capture template if you can. And read more about templates here: orgmode.org/manual/Capture-templates.html – biocyberman Apr 21 '17 at 14:44
0

So I think I've found a way, but its not very elegant:

(defun org-remove-id-from-last-capture ()
  "Remove ID property from last `org-capture' entry, save capture buffer."
  (let* ((properties (org-entry-properties org-capture-last-stored-marker))
         (file (cdr (assoc "FILE" properties)))) 
    (when (org-entry-delete org-capture-last-stored-marker "ID")
      (with-current-buffer (get-file-buffer file)
        (save-buffer)))))

(add-hook 'org-capture-after-finalize-hook #'org-remove-id-from-last-capture)
0

Sorry this answer may be better go to comment but I don't have enough reputation.

Short Version: It there any possibility that you used any package related with bookmarks or global-jump to org heading? If so, then trying to disable them may be helpful.

Long Version: I happened to have the same problem that an ID will be attached and stop the clock-in timer if there is any.

Following steps are done for a capture to finalize: (would be incomplete):

  1. Insert the capture content to target location
  2. Save a bookmark called "org-capture-last-stored" to your Bookmarks
  3. Save the target file

And in my case, I found no function related to org-id in step 1 and 3 but in step 2, there is one package called "org-bookmark-heading" which is used to jump to a heading from bookmark. It will take over when creating a bookmark and generate the ID.

In all, I would suggest to check any packages related to bookmarks, head creation and save-hook.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.