reddit / emacs

Is there a way to choose how many todo's to display in global todo list?

copperbranch · 2022-06-03 17:14
It is usually overwhelming for me to see a bunch of things to do, so I'd like to have the ability to limit that. Ideally I'd like to pick this number at the moment, and of course I would need a way to move "pages" to show the next *n* todo's. Is there any defaults for that? If not, how would I go about trying to make that happen?
yantar92 · 2022-06-04 01:05
`org-agenda-max-todos`
copperbranch · 2022-06-04 02:17
>org-agenda-max-todos Cool, that did work in limiting the todos. But I couldn't find a way to see the "next *n* todos". Do you know how to? If that isn't possible, then it's not really usable.
yantar92 · 2022-06-04 02:31
> But I couldn't find a way to see the "next n todos" Well. That kind of defeats the purpose, IMHO. In any case, it is not possible. You may instead just finish some todos and refresh agenda to be filled up to `org-agenda-max-todos` again. Generally, having too many todos is not something you should work around. It is a sign that something is wrong with your planning. Instead of limiting the number of dislpayed todos and being afraid that some importants ones are missing, I recommend limiting the number of scheduled tasks + going through agenda in the morning and postponing whatever you actually don't plan to work on. Or you may have 2 agenda views. One for really important tasks and the other, long one, for the rest.
copperbranch · 2022-06-04 02:52
This is for the global todo list. My regular agenda view is fine, since I only schedule things that are hard dates. Very unlikely to have more than 5 items there. My issue is when I'm trying to decide what tasks to do in any given moment. What I do is go to the global todo list to decide what things to work on based on my mood, energy and so and so. But I've noticed that having that huge list of todo's always makes me feel a bit overwhelmed, so I hope to find a way to list them say 5 by 5. So I can check them all, move to next page, check, move to next page...
yantar92 · 2022-06-04 03:26
Then you may need to advice `org-agenda-finalize-entries` functions to achieve what you want.
yantar92 · 2022-06-04 05:41
Another possibility could be just narrowing the agenda buffer to, say, 5 entries (select region containing 5 entries + M-x narrow-to-region). Then, you can write a function that moves the narrow down or up another 5 entries and bind it to some key. The function might be something like the following (defun yant/narrow-to-n-lines-or-move (&optional arg) "Narrow to 5 or ARG lines starting from point. If narrowing is in effect, move the narrow down or up with \\[universal-argument]." (interactive "P") (if (buffer-narrowed-p) (let ((lines (- (line-number-at-pos (point-max)) (line-number-at-pos (point-min)))) (backward-p arg)) (if backward-p (progn (goto-char (point-min)) (widen) (beginning-of-line (- (1- lines))) (yant/narrow-to-n-lines-or-move lines)) (progn (goto-char (point-max)) (widen) (beginning-of-line) (yant/narrow-to-n-lines-or-move lines))) (goto-char (point-min))) (let ((lines (or (and (numberp arg) arg) 5)) (beg (line-beginning-position))) (beginning-of-line (1+ lines)) (narrow-to-region beg (point)) (goto-char (point-min)) (when (= (point-min) (point-max)) (widen) (user-error "Buffer boundary")))))
copperbranch · 2022-06-04 12:59
That’s an interesting solution. I’ll give it a try, thanks!