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

Nano agenda not showing any org file appointments #9

Open
plattyfish opened this issue Sep 13, 2022 · 19 comments
Open

Nano agenda not showing any org file appointments #9

plattyfish opened this issue Sep 13, 2022 · 19 comments

Comments

@plattyfish
Copy link

I got this output when I installed nano agenda from emacs 27.1

options > manage emacs packages
And none of my agenda items shows up. I added a few new ones to test it but they don't show up.

Compiling file /home/james/.emacs.d/elpa/nano-agenda-0.2.1/nano-agenda.el at Mon Sep 12 19:51:20 2022
Entering directory ‘/home/james/.emacs.d/elpa/nano-agenda-0.2.1/’
nano-agenda.el:73:1:Warning: defcustom for ‘nano-agenda-today-symbol’ fails to
specify type
nano-agenda.el:73:1:Warning: defcustom for ‘nano-agenda-today-symbol’ fails to
specify type
nano-agenda.el:323:1:Warning: Unused lexical variable ‘duration’
nano-agenda.el:323:1:Warning: Unused lexical variable ‘minutes’
nano-agenda.el:323:1:Warning: Unused lexical variable ‘time’
nano-agenda.el:439:1:Warning: Unused lexical variable ‘today’

In nano-agenda--populate-agenda:
nano-agenda.el:466:39:Error: ‘add-to-list’ can’t use lexical var ‘entries’;
use ‘push’ or ‘cl-pushnew’
nano-agenda.el:485:1:Warning: Unused lexical variable ‘day’
nano-agenda.el:485:1:Warning: Unused lexical variable ‘today’

Not sure what the errors mean and how to fix them?

@rougier
Copy link
Owner

rougier commented Sep 22, 2022

Can you try to evaluate (let* ((entries '())) (add-to-list 'entries "test")) and
(let* ((entries '())) (push "test" entries))?

@TristanCacqueray
Copy link

I also get a similar issue with the latest version from elpa, the error is:

min: Symbol’s value as variable is void: nano-agenda-busy-foregrounds

Using the master branch seems to work. @rougier does nano-agenda needs a new release?
The version in nano-emacs also appears broken, shouldn't it be removed in favor of this repository?

@rougier
Copy link
Owner

rougier commented Jan 9, 2024

@TristanCacqueray Can you test the rewrite branch (not yet merged)?

@TristanCacqueray
Copy link

@rougier sure, it failed with face-attribute: Invalid face: hl-line.

I made a little nix package for nano-agenda, and here is the branch that test rewrite: podenv/nano-agenda.nix@a327f08 .

@rougier
Copy link
Owner

rougier commented Jan 9, 2024

I need to load hl-line... In the meantime, you can load hl-line manually and restest.

@TristanCacqueray
Copy link

Ok, but I'm back to the issue where the todo list is empty. I guess this happens because I'm running in terminal: svg-lib--image: svg-lib.el requires Emacs to be compiled with svg support.

@TristanCacqueray
Copy link

Using the GUI, I get:

image

@TristanCacqueray
Copy link

After switching the task to DONE, same error, here is the backtrace:

Debugger entered--Lisp error: (wrong-type-argument listp "Mark entry as done")
  svg-lib-button("TODO" (lambda nil (interactive) (with-current-buffer #<buffer projects.org> (save-excursion (goto-char 94) (org-todo 'done)))) "Mark entry as done" (default :foreground "#B0BEC5" :background "#FFFFFF" :font-family "Iosevka") (default :foreground "#FFFFFF" :background "#B0BEC5" :font-weight bold :font-family "Iosevka") (default :foreground "#FFFFFF" :background "#37474F" :font-weight bold :font-family "Iosevka"))
  (let* ((marker (get-text-property 0 'org-marker entry)) (buffer (marker-buffer marker)) (pos (marker-position marker)) (face (or face 'default)) (font-family (plist-get svg-lib-style-default ':font-family)) (active (list 'default ':foreground (face-foreground face nil 'default) ':background (face-background face nil 'default) ':font-family font-family)) (hover (list 'default ':foreground (face-background face nil 'default) ':background (face-foreground face nil 'default) ':font-weight 'bold ':font-family font-family)) (press (list 'default ':foreground (face-background 'default) ':background (face-foreground 'default) ':font-weight 'bold ':font-family font-family))) (svg-lib-button "TODO" (list 'lambda nil '(interactive) (list 'with-current-buffer buffer (cons 'save-excursion (cons (list 'goto-char pos) '(...))))) "Mark entry as done" active hover press))
  nano-agenda--entry-todo(#("DONE Test rewrite branch of nano-agenda" 0 39 (todo-state #("DONE" 0 4 (face (org-done org-level-2) org-todo-head "TODO" fontified t)) org-habit-p nil priority 1099 warntime nil ts-date 738894 date (1 9 2024) type "scheduled" org-hd-marker #<marker (moves after insertion) at 9 in projects.org> org-marker #<marker (moves after insertion) at 94 in projects.org> undone-face org-scheduled-today help-echo "mouse-2 or RET jump to Org file ~/org/projects.org" mouse-face highlight done-face org-agenda-done org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?..." org-todo-regexp "\\(DONE\\|TODO\\)" org-not-done-regexp "\\(TODO\\)" dotime time format nil extra "Scheduled: " time "" level "  " txt #("DONE Test rewrite branch of nano-agenda" 0 4 (org-heading t effort-minutes nil effort nil face (org-done org-level-2) org-todo-head "TODO" fontified t) 4 5 (org-heading t effort-minutes nil effort nil face org-level-2 org-todo-head "TODO" fontified t) 5 39 (org-heading t effort-minutes nil effort nil face (org-headline-done org-level-2) org-todo-head "TODO" fontified t)) breadcrumbs nil duration nil time-of-day nil ...)) font-lock-comment-face)
  (cons (nano-agenda--entry-todo entry 'font-lock-comment-face) nil)
  (cond (daterange (cons (nano-agenda--svg-progress-bar (car daterange) (cdr daterange) time-face) nil)) (is-deadline (cons (nano-agenda--entry-todo entry 'error) nil)) (is-todo (cons (nano-agenda--entry-todo entry 'font-lock-comment-face) nil)) (time (cons (propertize (format-time-string "%H:%M" (car time)) 'face time-face) (propertize (format-time-string "%H:%M" (cdr time)) 'face time-face))) (t (cons (propertize "—————" 'face time-face) nil)))
  (let* ((time (nano-agenda--entry-time entry)) (is-now (and (car time) (cdr time) (time-less-p (car time) (current-time)) (time-less-p (current-time) (cdr time)))) (is-todo (nano-agenda--entry-is-todo entry)) (is-conflict (nano-agenda--entry-is-conflict entry)) (is-deadline (nano-agenda--entry-is-deadline entry)) (tags (nano-agenda--entry-tags entry)) (daterange (nano-agenda--entry-daterange entry)) (header (nano-agenda--entry-header entry)) (header-face 'default) (time-face (if is-conflict 'error 'nano-faded)) (deadline-face 'error-i) (todo-face 'default-i) (tag-align (if (and tags nano-agenda-tags-align) (propertize " " 'display (list 'space ':align-to (list '- 'right 1 (length tags)))) " ")) (header (concat (propertize header 'face header-face))) (prefix (cond (daterange (cons (nano-agenda--svg-progress-bar (car daterange) (cdr daterange) time-face) nil)) (is-deadline (cons (nano-agenda--entry-todo entry 'error) nil)) (is-todo (cons (nano-agenda--entry-todo entry 'font-lock-comment-face) nil)) (time (cons (propertize (format-time-string "%H:%M" ...) 'face time-face) (propertize (format-time-string "%H:%M" ...) 'face time-face))) (t (cons (propertize "—————" 'face time-face) nil))))) (setq nano-agenda--entry-is-now (or nano-agenda--entry-is-now is-now)) (concat " " (car prefix) (propertize " │ " 'face 'nano-subtle-i) header tag-align tags))
  nano-agenda--entry-format(#("DONE Test rewrite branch of nano-agenda" 0 39 (todo-state #("DONE" 0 4 (face (org-done org-level-2) org-todo-head "TODO" fontified t)) org-habit-p nil priority 1099 warntime nil ts-date 738894 date (1 9 2024) type "scheduled" org-hd-marker #<marker (moves after insertion) at 9 in projects.org> org-marker #<marker (moves after insertion) at 94 in projects.org> undone-face org-scheduled-today help-echo "mouse-2 or RET jump to Org file ~/org/projects.org" mouse-face highlight done-face org-agenda-done org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?..." org-todo-regexp "\\(DONE\\|TODO\\)" org-not-done-regexp "\\(TODO\\)" dotime time format nil extra "Scheduled: " time "" level "  " txt #("DONE Test rewrite branch of nano-agenda" 0 4 (org-heading t effort-minutes nil effort nil face (org-done org-level-2) org-todo-head "TODO" fontified t) 4 5 (org-heading t effort-minutes nil effort nil face org-level-2 org-todo-head "TODO" fontified t) 5 39 (org-heading t effort-minutes nil effort nil face (org-headline-done org-level-2) org-todo-head "TODO" fontified t)) breadcrumbs nil duration nil time-of-day nil ...)))
  (insert (nano-agenda--entry-format entry))
  (let ((entry (nth i entries)) (point nil) (highlight (and (nano-agenda-date-equal nano-agenda-date date) (eq i nano-agenda--entry-index)))) (nano-agenda-forward-line 1) (goto-char (line-end-position)) (setq point (point)) (insert padding) (if highlight (progn (insert entry-marker) (setq nano-agenda--entry-marker (get-text-property 0 'org-marker entry))) (insert separation)) (insert (nano-agenda--entry-format entry)) (if highlight (progn (move-overlay nano-agenda--entry-overlay point (line-end-position)))))
  (let ((i (car tail))) (let ((entry (nth i entries)) (point nil) (highlight (and (nano-agenda-date-equal nano-agenda-date date) (eq i nano-agenda--entry-index)))) (nano-agenda-forward-line 1) (goto-char (line-end-position)) (setq point (point)) (insert padding) (if highlight (progn (insert entry-marker) (setq nano-agenda--entry-marker (get-text-property 0 'org-marker entry))) (insert separation)) (insert (nano-agenda--entry-format entry)) (if highlight (progn (move-overlay nano-agenda--entry-overlay point (line-end-position))))) (setq tail (cdr tail)))
  (while tail (let ((i (car tail))) (let ((entry (nth i entries)) (point nil) (highlight (and (nano-agenda-date-equal nano-agenda-date date) (eq i nano-agenda--entry-index)))) (nano-agenda-forward-line 1) (goto-char (line-end-position)) (setq point (point)) (insert padding) (if highlight (progn (insert entry-marker) (setq nano-agenda--entry-marker (get-text-property 0 'org-marker entry))) (insert separation)) (insert (nano-agenda--entry-format entry)) (if highlight (progn (move-overlay nano-agenda--entry-overlay point (line-end-position))))) (setq tail (cdr tail))))
  (let ((tail (number-sequence 0 (1- (length entries))))) (while tail (let ((i (car tail))) (let ((entry (nth i entries)) (point nil) (highlight (and (nano-agenda-date-equal nano-agenda-date date) (eq i nano-agenda--entry-index)))) (nano-agenda-forward-line 1) (goto-char (line-end-position)) (setq point (point)) (insert padding) (if highlight (progn (insert entry-marker) (setq nano-agenda--entry-marker (get-text-property 0 ... entry))) (insert separation)) (insert (nano-agenda--entry-format entry)) (if highlight (progn (move-overlay nano-agenda--entry-overlay point (line-end-position))))) (setq tail (cdr tail)))))
  (let* ((day (nth 3 (decode-time date))) (month (nth 4 (decode-time date))) (year (nth 5 (decode-time date))) (org-date (list month day year)) (holidays (nano-agenda-holidays org-date)) (anniversaries (nano-agenda-anniversaries org-date)) (width (- (window-width) 24 3 9)) (subtitle (or anniversaries holidays)) (subtitle (if subtitle (progn (truncate-string-to-width subtitle width nil nil "…")))) (entries (nano-agenda-entries org-date)) (separation "  ") (entry-marker " ") (padding (propertize " " 'display '(space :align-to (+ left 22)))) (title (format-time-string "%A %d %B %Y" date)) (week (format-time-string " (Week %W)" date))) (goto-char (line-end-position)) (insert padding) (insert separation) (insert (propertize title 'face 'nano-agenda-header-title)) (insert (propertize week 'face 'nano-agenda-header-subtitle)) (nano-agenda-forward-line 1) (goto-char (line-end-position)) (insert padding) (insert separation) (if subtitle (progn (insert (propertize subtitle 'face 'nano-agenda-header-subtitle)))) (if (nano-agenda-date-equal nano-agenda-date date) (progn (setq nano-agenda--entry-index (if (> (length entries) 0) (mod nano-agenda--entry-index (length entries)) -1)) (setq nano-agenda--entry-marker nil))) (if (overlayp nano-agenda--entry-overlay) nil (setq nano-agenda--entry-overlay (make-overlay (point-min) (point-min))) (overlay-put nano-agenda--entry-overlay 'face 'hl-line)) (let ((tail (number-sequence 0 (1- (length entries))))) (while tail (let ((i (car tail))) (let ((entry (nth i entries)) (point nil) (highlight (and ... ...))) (nano-agenda-forward-line 1) (goto-char (line-end-position)) (setq point (point)) (insert padding) (if highlight (progn (insert entry-marker) (setq nano-agenda--entry-marker ...)) (insert separation)) (insert (nano-agenda--entry-format entry)) (if highlight (progn (move-overlay nano-agenda--entry-overlay point ...)))) (setq tail (cdr tail))))))
  nano-agenda--insert-agenda(nil)
  (if (eq nano-agenda-view-mode 'week) (let ((upper-bound 7) (counter 0)) (while (< counter upper-bound) (let ((inc counter)) (nano-agenda--insert-agenda (nano-agenda--date first-day-of-week inc 0 0)) (nano-agenda-forward-line 2)) (setq counter (1+ counter)))) (nano-agenda--insert-agenda nano-agenda-date))
  (let* ((date (decode-time nano-agenda-date)) (day (nth 3 date)) (month (nth 4 date)) (year (nth 5 date)) (day-of-week (mod (1- (calendar-day-of-week (list month day year))) 7)) (first-day-of-week (encode-time (list 0 0 0 (- day day-of-week) month year)))) (if (eq nano-agenda-view-mode 'week) (let ((upper-bound 7) (counter 0)) (while (< counter upper-bound) (let ((inc counter)) (nano-agenda--insert-agenda (nano-agenda--date first-day-of-week inc 0 0)) (nano-agenda-forward-line 2)) (setq counter (1+ counter)))) (nano-agenda--insert-agenda nano-agenda-date)))
  (let ((inhibit-read-only t)) (erase-buffer) (setq nano-agenda--entry-is-now nil) (let* ((date (decode-time nano-agenda-date)) (day (nth 3 date)) (month (nth 4 date)) (year (nth 5 date)) (prev-month (encode-time (list 0 0 0 1 (1- month) year))) (curr-month (encode-time (list 0 0 0 1 month year))) (next-month (encode-time (list 0 0 0 1 (1+ month) year)))) (if (eq nano-agenda-view-mode 'week) (progn (nano-agenda--insert-calendar prev-month) (insert "\n"))) (nano-agenda--insert-calendar curr-month) (if (eq nano-agenda-view-mode 'week) (progn (insert "\n") (nano-agenda--insert-calendar next-month)))) (goto-char (point-min)) (let* ((date (decode-time nano-agenda-date)) (day (nth 3 date)) (month (nth 4 date)) (year (nth 5 date)) (day-of-week (mod (1- (calendar-day-of-week (list month day year))) 7)) (first-day-of-week (encode-time (list 0 0 0 (- day day-of-week) month year)))) (if (eq nano-agenda-view-mode 'week) (let ((upper-bound 7) (counter 0)) (while (< counter upper-bound) (let ((inc counter)) (nano-agenda--insert-agenda (nano-agenda--date first-day-of-week inc 0 0)) (nano-agenda-forward-line 2)) (setq counter (1+ counter)))) (nano-agenda--insert-agenda nano-agenda-date))) (if (stringp nano-agenda-clock-format) (progn (goto-char (point-min)) (nano-agenda--insert-clock))) (goto-char (point-min)) (insert nano-agenda-header) (run-hooks nano-agenda-update-hook))
  (save-current-buffer (set-buffer (get-buffer-create nano-agenda-buffer-name)) (let ((inhibit-read-only t)) (erase-buffer) (setq nano-agenda--entry-is-now nil) (let* ((date (decode-time nano-agenda-date)) (day (nth 3 date)) (month (nth 4 date)) (year (nth 5 date)) (prev-month (encode-time (list 0 0 0 1 (1- month) year))) (curr-month (encode-time (list 0 0 0 1 month year))) (next-month (encode-time (list 0 0 0 1 (1+ month) year)))) (if (eq nano-agenda-view-mode 'week) (progn (nano-agenda--insert-calendar prev-month) (insert "\n"))) (nano-agenda--insert-calendar curr-month) (if (eq nano-agenda-view-mode 'week) (progn (insert "\n") (nano-agenda--insert-calendar next-month)))) (goto-char (point-min)) (let* ((date (decode-time nano-agenda-date)) (day (nth 3 date)) (month (nth 4 date)) (year (nth 5 date)) (day-of-week (mod (1- (calendar-day-of-week ...)) 7)) (first-day-of-week (encode-time (list 0 0 0 (- day day-of-week) month year)))) (if (eq nano-agenda-view-mode 'week) (let ((upper-bound 7) (counter 0)) (while (< counter upper-bound) (let (...) (nano-agenda--insert-agenda ...) (nano-agenda-forward-line 2)) (setq counter (1+ counter)))) (nano-agenda--insert-agenda nano-agenda-date))) (if (stringp nano-agenda-clock-format) (progn (goto-char (point-min)) (nano-agenda--insert-clock))) (goto-char (point-min)) (insert nano-agenda-header) (run-hooks nano-agenda-update-hook)))
  nano-agenda-update()
  nano-agenda()
  funcall-interactively(nano-agenda)
  command-execute(nano-agenda record)
  execute-extended-command(nil "nano-agenda" "nano-ag")
  funcall-interactively(execute-extended-command nil "nano-agenda" "nano-ag")
  command-execute(execute-extended-command)
  recursive-edit()
  debug()
  funcall-interactively(debug)
  command-execute(debug record)
  execute-extended-command(nil "debug" "debu")
  funcall-interactively(execute-extended-command nil "debug" "debu")
  command-execute(execute-extended-command)

@rougier
Copy link
Owner

rougier commented Jan 9, 2024

Can you remove the SCHEDULED from the entry?

@TristanCacqueray
Copy link

Sure, I now get the clock, but still no todo :)

image

@rougier
Copy link
Owner

rougier commented Jan 9, 2024

I meant remove only the SCHEDULED: word such as to have only the date (I do not handle scheduled properly yet)

@TristanCacqueray
Copy link

Oh, so without any TODO I get:

image

But if the entry has TODO or DONE, then I get the (wrong-type-argument listp "Mark entry as done")

@rougier
Copy link
Owner

rougier commented Jan 10, 2024

Can you post the minimal projects.org above such that I can test locally?

@TristanCacqueray
Copy link

@rougier With this config:

(require 'hl-line)
(require 'nano)
(require 'nano-agenda)

;; Keep track of when the task was completed
(setq org-log-done 'time)

;; Tell org-agenda where are the org files
(setq org-agenda-files '("~/org"))

And this org file ~/org/projects.org:

* Inbox
:PROPERTIES:
:CATEGORY: Inbox
:END:
** TODO Test rewrite branch of nano-agenda
<2024-01-10 Wed>

I get #9 (comment) when running M-x nano-agenda.

@rougier
Copy link
Owner

rougier commented Jan 15, 2024

Can you try (setq org-agenda-files '("~/org/projects.org")) just to make sure agenda is only parsing one file?

@TristanCacqueray
Copy link

@rougier this is a sandbox environment (container), there is only one org file and above is the full .emacs.el . My goal is to package nano-agenda and your GTD setup as a standalone application, ideally as a TUI.

@rougier
Copy link
Owner

rougier commented Jan 16, 2024

What is the error you get exactly?

@TristanCacqueray
Copy link

@rougier I get #9 (comment) with the stacktrace #9 (comment)

Then after a while: Error running timer ‘nano-agenda-update’: (wrong-type-argument listp "Mark entry as done")

@rougier
Copy link
Owner

rougier commented Jan 22, 2024

Can you update svg-lib to the github version and/post documentation for svg-lib-button on your machine?

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

No branches or pull requests

3 participants