Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org-gcal-delete-at-point removed original event information in org file #169

Open
wrn opened this issue Oct 19, 2021 · 3 comments
Open

org-gcal-delete-at-point removed original event information in org file #169

wrn opened this issue Oct 19, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@wrn
Copy link

wrn commented Oct 19, 2021

After I invoke org-gcal-delete-at-point , the headline state is marked as "CANCELED" just as I configured and expected (good!), but the original scheduling information in ":org-gcal:" drawer is removed (actually, the whole drawer is gone). I think most likely the reason people want to keep the headline (and marked it as "CANCELED") after it is deleted from the Google calendar is because they still want to preserve the event information. So can we change this behavior and keep the :org-gcal: drawer? Thanks.

@telotortium
Copy link
Collaborator

telotortium commented Oct 19, 2021 via email

@wrn
Copy link
Author

wrn commented Nov 4, 2021

Thanks for endorsing the idea. I am not sure my elisp skill is up to the task, but I may give it a try later. Just do not count on it. :-)

@wrn
Copy link
Author

wrn commented Dec 12, 2022

I came back to this again. What I did in my own local version of org-gcal is when deleting an event, change the "org-gcal" drawer name to "org-gcal-relic". I dare not just keep it as it is because the code comments says this drawer was deleted so it won't confuse other part of the code, so I choose to just to use another drawer name.

A snippet of my code in function "org-gcal-delete-at-point"

                ;; Delete :org-gcal: drawer after deleting event. This will preserve
                ;; the ID for links, but will ensure functions in this module don’t
                ;; identify the entry as a Calendar event.
                (org-with-point-at marker
                  (when (re-search-forward
                         (format
                          "^[ \t]*:\\(%s\\):[^z-a]*?\n[ \t]*:END:[ \t]*\n?" ;; Changed !!!
                          (regexp-quote org-gcal-drawer-name))
                         (save-excursion (outline-next-heading) (point))
                         'noerror)                   
                    (replace-match (format "%s-relic" org-gcal-drawer-name) 'fixedcase t nil 1))  ;; !!! Changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants