kidd / org-gcal.el

Org sync with Google Calendar. (active maintained project as of 2019-11-06)
435 stars 47 forks source link

`org-gcal-fetch` opens org files #168

Closed DaviRaubach closed 2 years ago

DaviRaubach commented 2 years ago

Hi folks. I can't describe how to reproduce the problem. When I call org-gcal-fetch it opens all my org files.

I suspect that it needs to open and find scheduled events and then kill the buffers. Maybe my installation is failing when killing the buffers. How can I solve this.

Thank you!

The backtrace:

Debugger entered--Lisp error: (void-variable view-highlight-face)
  default-toplevel-value(view-highlight-face)
  custom-initialize-reset(view-highlight-face 'highlight)
  custom-declare-variable(view-highlight-face 'highlight "The face used for highlighting the match found by ..." :type face :group view)
  byte-code("\300\301\302\303\304\305\304\306\307\310&\11\210\311\312\313\314\315\316\307\301&\7\210\311\317\302\320\315\321\307\301&\7\210\311\322\302\323\315\321\307\301&\7\210\311\324\325\326..." [custom-declare-group view nil "Peruse file or buffer without editing." :link (function-link view-mode) (custom-manual "(emacs)Misc File Ops") :group text custom-declare-variable view-highlight-face 'highlight "The face used for highlighting the match found by ..." :type face view-scroll-auto-exit "Non-nil means scrolling past the end of buffer exi..." boolean view-try-extend-at-buffer-end "Non-nil means try to load more of file when reachi..." view-remove-frame-by-deleting t "Determine how View mode removes a frame no longer ..." :version "23.1" view-exits-all-viewing-windows "Non-nil means restore all windows used to view buf..." view-inhibit-help-message "Non-nil inhibits the help message shown upon enter..." "22.1"] 10)
  view-mode()
  log4e-mode()
  log4e--logging(" *log4e-alert*" nil "%t [%l] %m" "%H:%M:%S" normal nil t info "Events fetched into\n~/org/roam/gcal.org")
  apply(log4e--logging " *log4e-alert*" nil "%t [%l] %m" "%H:%M:%S" normal nil t info "Events fetched into\n~/org/roam/gcal.org" nil)
  alert--log-info("Events fetched into\n~/org/roam/gcal.org")
  apply(alert--log-info "Events fetched into\n~/org/roam/gcal.org")
  alert-log-notify((:message "Events fetched into\n~/org/roam/gcal.org" :title "Completed event fetching ." :icon nil :severity normal :category nil :buffer #<buffer *scratch*> :mode org-mode :id nil :data nil))
  alert("Events fetched into\n~/org/roam/gcal.org" :title "Completed event fetching .")
  org-gcal--notify("Completed event fetching ." "Events fetched into\n~/org/roam/gcal.org" nil)
  #f(compiled-function (_) #<bytecode 0x1fefa35489b1>)(nil)
  deferred:call-lambda(#f(compiled-function (_) #<bytecode 0x1fefa35489b1>) nil)
  deferred:exec-task(#s(deferred :callback #f(compiled-function (_) #<bytecode 0x1fefa35489b1>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next nil :status nil :value nil) ok nil)
  deferred:set-next(#s(deferred :callback deferred:default-callback :errorback deferred:default-errorback :cancel deferred:default-cancel :next #s(deferred :callback #f(compiled-function (_) #<bytecode 0x1fefa35489b1>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next nil :status nil :value nil) :status nil :value nil) #s(deferred :callback #f(compiled-function (_) #<bytecode 0x1fefa35489b1>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next nil :status nil :value nil))
  deferred:nextc(#s(deferred :callback deferred:default-callback :errorback deferred:default-errorback :cancel deferred:default-cancel :next #s(deferred :callback #f(compiled-function (_) #<bytecode 0x1fefa35489b1>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next nil :status nil :value nil) :status nil :value nil) #f(compiled-function (_) #<bytecode 0x1fefa35489b1>))
  #f(compiled-function (calendar-id-file) #<bytecode 0x1fefa431c1a5>)(("myemail" . "~/org/roam/gcal.org"))
  deferred:call-lambda(#f(compiled-function (calendar-id-file) #<bytecode 0x1fefa431c1a5>) ("myemail" . "~/org/roam/gcal.org"))
  #f(compiled-function (x) #<bytecode 0x1fefa431c205>)(nil)
  deferred:call-lambda(#f(compiled-function (x) #<bytecode 0x1fefa431c205>) nil)
  deferred:exec-task(#s(deferred :callback #f(compiled-function (x) #<bytecode 0x1fefa431c205>) :errorback deferred:default-errorback :cancel #f(compiled-function (x) #<bytecode 0x1fefa431c22d>) :next #s(deferred :callback #f(compiled-function (_) #<bytecode 0x1fefa431c261>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next #s(deferred :callback #f(compiled-function (x) #<bytecode 0x1fefa431c285>) :errorback #f(compiled-function (e) #<bytecode 0x1fefa431c29d>) :cancel deferred:default-cancel :next nil :status nil :value nil) :status nil :value nil) :status nil :value nil) ok nil)
  deferred:worker()
  apply(deferred:worker nil)
  timer-event-handler([t 24939 24580 346157 nil deferred:worker nil nil 0])

GNU Emacs 27.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2021-03-27 I use org-roam, org-ref and other org-things.

telotortium commented 2 years ago

This is expected behavior. org-gcal searches your agenda files (given by org-agenda-files) for existing org-gcal calendar events, as well as some extra files that you can specify. See org-generic-id-update-id-locations for the exact behavior.

If you wanted to disable searching for agenda files, you could try modifying org-generic-id-update-id-locations. I might consider a defcustom to control that as a feature request.

DaviRaubach commented 2 years ago

Thank you @telotortium! But, I don't believe that the expected behavior is to keep all org files opened after running org-gcal-fetch. Maybe I was not clear about what I think is a problem. I don't wanna have a lot of buffers opened after using org-gcal. Shouldn't it close the buffers after fetching the events?

DaviRaubach commented 2 years ago

Ok, maybe it is really the expected behavior.

I just found that org-agenda-exit closes everything to me. So I think it is the solution to this fake problem.