Comments (11)
Looking at this again, changing the date-based selectors to use org-agenda-current-date
would not be a trivial change. It's past time to tag a new v1.3 release, so I'll revisit this in the future.
from org-super-agenda.
Hi,
Thanks for org-super-agenda, it's a big help.
Glad to hear it, thanks.
Is the way I expect this to behave not the more natural way? Or am I missing an obvious point?
Unfortunately org-super-agenda isn't really designed to work with multiple agenda blocks or multi-day spans. The way it works is to post-process all of the agenda items at once, put them into groups, and then hand them back to the agenda finalizing functions. It has no concept of nor relation to what spans or blocks the rest of the Org agenda code produces. So you could say that the date-related grouping functions are designed to work with single-day agenda views.
I guess I should put that in the readme, although it's not that easy to explain clearly. Suggestions for how to word it are welcome. :)
from org-super-agenda.
P.S. Although it would be nice to fix this, I don't think it's practical at all. The Org Agenda code is very complicated and not very modular. We would need to either reimplement large parts of the agenda ourselves, or insert a bunch of calls to intercept and modify agenda items at other stages of item collection, which would be extremely complicated, error-prone, and very unlikely to be merged into Org proper. (Not to mention that I have no interest in trying to do so, haha. ;)
However, if you have any interest in hacking on the Org Agenda, you might find this interesting: https://github.com/alphapapa/org-agenda-ng It's a very primitive agenda by comparison, but it has a more modular design that might be a foundation or a prototype for rewriting the Org Agenda completely, perhaps with features like grouping built-in.
from org-super-agenda.
Hi again, thanks for the explanation.
Just to be clear: Does the difficulty/impracticality of a solution relate to getting it to work with multi-day-spans; or to making the date that ":scheduled today" refers to relative to the active day-view, even on single-day views?
The issue is I was trying to highlight is, "today" always seems to mean the actual today, no matter which day-view we're looking at. On today's single-day-view, it's fine. But on another day's single-day-view, it still pivots on the actual today, so the tasks there are grouped based on today's date and not the date of that day's view.
(For instance, if you take out the org-agenda-span line from the above example, it still behaves as I described)
I actually would be happy if it worked (as I expect :) with only single-day agenda views - I rarely use day-spans.
org-agenda-ng looks very interesting, I will try it as well. (But I wonder if the behaviour of "scheduled :today" will be different).
from org-super-agenda.
The issue is I was trying to highlight is, "today" always seems to mean the actual today, no matter which day-view we're looking at. On today's single-day-view, it's fine. But on another day's single-day-view, it still pivots on the actual today, so the tasks there are grouped based on today's date and not the date of that day's view.
Okay, now I understand what you mean...
Just to be clear: Does the difficulty/impracticality of a solution relate to getting it to work with multi-day-spans; or to making the date that ":scheduled today" refers to relative to the active day-view, even on single-day views?
I think these are separate issues, and from what I can tell, neither one would be simple to fix. I thought that org-today
accounted for the, shall we say, "perspective date," in agenda views, but it doesn't seem to. It does account for org-extend-today-until
, but that also apparently does not set the perspective date when gathering agenda items (e.g. see org-agenda-get-scheduled
). That seems to be set by the date
variable in e.g. org-agenda-get-day-entries
. (org-agenda.el
does not use lexical binding, so date
in org-agenda-get-scheduled
is bound by the function that calls it.) It might be possible to access that variable in org-super-agenda--group-scheduled
, but I almost don't even want to try, because the name date
is so ambiguous in this context, haha. But that might be possible, and that might fix the single-day-span views of days other than the real-world today.
org-agenda-ng looks very interesting, I will try it as well. (But I wonder if the behaviour of "scheduled :today" will be different).
It won't be different, because this issue is within org-super-agenda
. What I meant was, it might be possible to build a more flexible Org Agenda system that would make it easier to fix these issues in org-super-agenda
. The problem is basically that we don't have access from org-super-agenda
to the date that the Org Agenda is building a view for (the "perspective date", as I call it), so we don't know whether an item is scheduled on that date; we only know the current real-world date and the date of the item.
So a more flexible underlying agenda system might e.g. set a defvar
like org-agenda-perspective-date
while building a view for that date, and then we could easily know which date to compare items to.
And, in fact, that might be a feasible solution to this problem as well: just do that in the existing Agenda code, which would be only a few lines of code, and might be accepted in Org proper. However, it would likely be not quite as simple as it seems, because it would probably need to be set in several different places, in different functions, ensuring that it is done properly and in every place so that it's consistent. But it's probably worth asking about on the mailing list.
from org-super-agenda.
Note, I think I was confused: setting a special variable wouldn't do any good. But setting an agenda-perspective-date
text property on each item probably would let us fix this, at least theoretically.
from org-super-agenda.
I think I may have experienced this. Given org file:
* TODO thing 1 :foo:
* TODO thing 2 :foo:
* TODO thing 3 :bar:
And groups:
(setq org-super-agenda-groups
'((:name "foo" :tag "foo")
(:name "superset of foo" :tag ("foo" "bar"))))
I'd like the agenda to look like:
foo
====
TODO thing 1
TODO thing 2
superset of foo
==================
TODO thing 1
TODO thing 2
TODO thing 3
Instead since things matched in foo seem to be discarded I see:
foo
====
TODO thing 1
TODO thing 2
superset of foo
==================
TODO thing 3
The real world use of this being something like having a tag you want at the top of your agenda like "Top3PrioritiesToday", but also wanting your time grid to have those items if you happen to be scrolling through that section.
from org-super-agenda.
@codygman Please refer to the documentation. Grouping selectors consume items.
from org-super-agenda.
@alphapapa : the variable org-agenda-current-date
looks like what you were looking for (it's been two years, after all). I think this would make the whole thing easier (I would guess we rarely want "today" and usually want what you called the "perspective date" of the agenda view).
from org-super-agenda.
@nchachereau Thanks, I'll take a look at that.
from org-super-agenda.
Until that problem is solved properly, here's a cheap hack if all you need is selecting items scheduled on or with deadline on the "perspective date".
(defun tim/is-today-deadline-entry-p (item)
(string-prefix-p " Deadline:" item))
(defun tim/is-today-scheduled-entry-p (item)
(string-prefix-p " Scheduled:" item))
(inspired by #238)
Then you can select with, e.g., :pred tim/is-today-deadline-entry-p
, which simply matches all lines starting with "Deadline:".
from org-super-agenda.
Related Issues (20)
- question: week-long view? HOT 1
- Customize group name ? HOT 7
- Group item by last modified state ? HOT 3
- Wrong parent headers HOT 2
- Cannot find file org-super-agenda-autoloads? HOT 1
- cond: Invalid org-super-agenda-groups selector: (:discard (:scheduled future)) HOT 7
- Can't use simple lisp expressions for :deadline HOT 4
- Showing the section name for an empty section? HOT 5
- Separating Deadline and Scheduled entries of the same task HOT 3
- Placing cursor on top of group heading changes the keymap and replaces the org-agenda buffer with a calendar when pressed `j ` both on Spacemacs and Doom Emacs HOT 3
- There is error -remove: Symbol’s function definition is void: s-blank-str? HOT 1
- Add explicit :or operator for use within :and operator? HOT 3
- Apply face transformation to item only if cheduled HOT 3
- How to use :property properly? HOT 2
- :property selector doesn't recognize properties set in a file's header HOT 1
- Is it possible to reuse blocks of org-super-agenda settings? HOT 1
- Org 9.7 `org-element` API changes break habit selector HOT 9
- question on using org-ql HOT 2
- Selector to match diary entries (was: how to exclude diary entries) HOT 1
- `:deadline nil` or/and `:scheduled nil` not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org-super-agenda.