d12frosted / vulpea

A collection of functions for note taking based on `org` and `org-roam`.
GNU General Public License v3.0
236 stars 12 forks source link

Org-Agenda is failing because Vulpea is calling org-get-category for some reason #171

Closed DominikMendel closed 10 months ago

DominikMendel commented 10 months ago

I'll post my stack trace below.

This only occurs with my Org-Agenda "today" view, and no other views. The error from org is org-element-at-point: 'org-element-at-point' cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode)

I'm using Vulpea like to update my org-agenda-files list.

You can see my config at https://github.com/DominikMendel/Doom-Emacs It's a mess at the moment in some spots, and a little outdated from what I'll running. I'll make sure it's up to date tonight, but the Vulpea logic and Org-Agenda logic hasn't changed.

Stack trace

Debugger entered--Lisp error: (error "‘org-element-at-point’ cannot be used in non-Org b...")
  signal(error ("‘org-element-at-point’ cannot be used in non-Org b..."))
  error("`org-element-at-point' cannot be used in non-Org b..." #<buffer *Org Agenda*> org-agenda-mode)
  org-element-at-point(28)
  org-entry-get-with-inheritance("CATEGORY" nil 28)
  org-get-category()
  (let* ((file-name (if buffer-file-name (progn (file-name-sans-extension (file-name-nondirectory buffer-file-name))))) (title (vulpea-buffer-prop-get "title")) (category (org-get-category)) (result (or (if (and title (string-equal category file-name)) title category) ""))) (if (numberp len) (s-truncate len (s-pad-right len " " result)) result))
  vulpea-agenda-category(20)
  (org-eval (vulpea-agenda-category 20))
  (format "%s" (org-eval (vulpea-agenda-category 20)))
  (format " %s %s%s%s" (format "%s" (if (member category-icon '("" nil)) "" (concat category-icon "" (get-text-property 0 'extra-space category-icon)))) (format "%s" (org-eval (vulpea-agenda-category 20))) (if (member time '("" nil)) "" (format "%-20s" (concat time ""))) (format "%s" (if (member extra '("" nil)) "" (concat extra " " (get-text-property 0 'extra-space extra)))))
  eval((format " %s %s%s%s" (format "%s" (if (member category-icon '("" nil)) "" (concat category-icon "" (get-text-property 0 'extra-space category-icon)))) (format "%s" (org-eval (vulpea-agenda-category 20))) (if (member time '("" nil)) "" (format "%-20s" (concat time ""))) (format "%s" (if (member extra '("" nil)) "" (concat extra " " (get-text-property 0 'extra-space extra))))) t)
  org-agenda-format-item(nil "----------------" nil "" nil "08:00")
  org-agenda-add-time-grid-maybe((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) 1 t)
  org-agenda-list(nil)
  funcall-interactively(org-agenda-list nil)
  call-interactively(org-agenda-list)
  #f(compiled-function () #<bytecode 0x15aad97491556a04>)()
  funcall(#f(compiled-function () #<bytecode 0x15aad97491556a04>))
  (let ((org-agenda-overriding-header '"") (org-agenda-span 'day) (org-agenda-start-day 'nil) (org-agenda-start-on-weekday 'nil) (org-agenda-time-grid '((daily today) (800 1000 1200 1400 1600 1800 2000) "" "----------------")) (org-super-agenda-groups '((:name "Clocked today" :log t) (:name "Scheduled Today" :time-grid t :date today :order 1) (:name "Habbits" :habit t :date today :order 2) (:name "Overdue Deadline" :face error :deadline past :order 3) (:name "Approaching Deadline" :face warning :deadline future :order 4) (:discard (:not (:scheduled past))) (:order-multi (5 (:name "Reviews To-Do" :tag "review") (:name "Previously Scheduled To-Do" :face warning :and ...) (:name "Previously Scheduled Inprogress" :face warning :and ...) (:name "Previously Scheduled In-Review" :face warning :and ...))) (:auto-parent t :order 6) (:discard (:anything t))))) (funcall '#f(compiled-function () #<bytecode 0x15aad97491556a04>)))
  eval((let ((org-agenda-overriding-header '"") (org-agenda-span 'day) (org-agenda-start-day 'nil) (org-agenda-start-on-weekday 'nil) (org-agenda-time-grid '((daily today) (800 1000 1200 1400 1600 1800 2000) "" "----------------")) (org-super-agenda-groups '((:name "Clocked today" :log t) (:name "Scheduled Today" :time-grid t :date today :order 1) (:name "Habbits" :habit t :date today :order 2) (:name "Overdue Deadline" :face error :deadline past :order 3) (:name "Approaching Deadline" :face warning :deadline future :order 4) (:discard (:not ...)) (:order-multi (5 ... ... ... ...)) (:auto-parent t :order 6) (:discard (:anything t))))) (funcall '#f(compiled-function () #<bytecode 0x15aad97491556a04>))))
  org-agenda-run-series("Today view" (((agenda "" ((org-agenda-overriding-header "") (org-agenda-span 'day) (org-agenda-start-day nil) (org-agenda-start-on-weekday nil) (org-agenda-time-grid '(... ... "" "----------------")) (org-super-agenda-groups my-super-group-agenda-today))) (alltodo "" ((org-agenda-overriding-header "") (org-super-agenda-groups my-super-group-alltodo-today))))))
  #f(compiled-function (&optional arg keys restriction) "Dispatch agenda commands to collect entries to the agenda buffer.\nPrompts for a command to execute.  Any prefix arg will be passed\non to the selected command.  The default selections are:\n\na     Call `org-agenda-list' to display the agenda for current day or week.\nt     Call `org-todo-list' to display the global todo list.\nT     Call `org-todo-list' to display the global todo list, select only\n      entries with a specific TODO keyword (the user gets a prompt).\nm     Call `org-tags-view' to display headlines with tags matching\n      a condition  (the user is prompted for the condition).\nM     Like `m', but select only TODO entries, no ordinary headlines.\ne     Export views to associated files.\ns     Search entries for keywords.\nS     Search entries for keywords, only with TODO keywords.\n/     Multi occur across all agenda files and also files listed\n      in `org-agenda-text-search-extra-files'.\n<     Restrict agenda commands to buffer, subtree, or region.\n      Press several times to get the desired effect.\n>     Remove a previous restriction.\n#     List \"stuck\" projects.\n!     Configure what \"stuck\" means.\nC     Configure custom agenda commands.\n\nMore commands can be added by configuring the variable\n`org-agenda-custom-commands'.  In particular, specific tags and TODO keyword\nsearches can be pre-defined in this way.\n\nIf the current buffer is in Org mode and visiting a file, you can also\nfirst press `<' once to indicate that the agenda should be temporarily\n(until the next use of `\\[org-agenda]') restricted to the current file.\nPressing `<' twice means to restrict to the current subtree or region\n(if active)." (interactive "P") #<bytecode -0xfea313bed7e2dda>)(nil "t" nil)
  apply(#f(compiled-function (&optional arg keys restriction) "Dispatch agenda commands to collect entries to the agenda buffer.\nPrompts for a command to execute.  Any prefix arg will be passed\non to the selected command.  The default selections are:\n\na     Call `org-agenda-list' to display the agenda for current day or week.\nt     Call `org-todo-list' to display the global todo list.\nT     Call `org-todo-list' to display the global todo list, select only\n      entries with a specific TODO keyword (the user gets a prompt).\nm     Call `org-tags-view' to display headlines with tags matching\n      a condition  (the user is prompted for the condition).\nM     Like `m', but select only TODO entries, no ordinary headlines.\ne     Export views to associated files.\ns     Search entries for keywords.\nS     Search entries for keywords, only with TODO keywords.\n/     Multi occur across all agenda files and also files listed\n      in `org-agenda-text-search-extra-files'.\n<     Restrict agenda commands to buffer, subtree, or region.\n      Press several times to get the desired effect.\n>     Remove a previous restriction.\n#     List \"stuck\" projects.\n!     Configure what \"stuck\" means.\nC     Configure custom agenda commands.\n\nMore commands can be added by configuring the variable\n`org-agenda-custom-commands'.  In particular, specific tags and TODO keyword\nsearches can be pre-defined in this way.\n\nIf the current buffer is in Org mode and visiting a file, you can also\nfirst press `<' once to indicate that the agenda should be temporarily\n(until the next use of `\\[org-agenda]') restricted to the current file.\nPressing `<' twice means to restrict to the current subtree or region\n(if active)." (interactive "P") #<bytecode -0xfea313bed7e2dda>) (nil "t" nil))
  org-agenda(nil "t" nil)
  (call-interactively (org-agenda nil "t" nil))
  eval((call-interactively (org-agenda nil "t" nil)) t)
  eval-expression((call-interactively (org-agenda nil "t" nil)))
  eval((eval-expression (car (read-from-string #("(call-interactively (org-agenda nil \"t\" nil))" 0 39 (ws-butler-chg chg) 39 40 (ws-butler-chg delete) 40 45 (ws-butler-chg chg))))) t)
  evil-ex(nil)
  funcall-interactively(evil-ex nil)
  call-interactively(evil-ex nil nil)
  command-execute(evil-ex)
d12frosted commented 10 months ago

hey @DominikMendel

I have a very busy day so will not be able to look into this, but from a quick glance I can say that "for some reason" seems like your configuration.

The vulpea-agenda-category isn't a function available in the vulpea library 😄 You define it here. And by the way, this is where you configure your agenda to call this function. See the value of org-agenda-prefix-format. Now this actually looks like content of one of my blog posts 😅

"‘org-element-at-point’ cannot be used in non-Org b..."

Do you have non-org-mode files in your org-agenda?