-
Notifications
You must be signed in to change notification settings - Fork 15
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
annotations and sorting for activities-completing-read #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. Here are a few comments.
BTW, are there other pieces of information inside an activity that would be relevant to show that occur to you? |
I can't think of any. For myself, the only one that matters is last-used time, anyway. Let's keep this as simple as possible. |
I could show both default and last ages, but that might be confusing. Along that line, do you think having the default and last buf+file cnt is useful or TMI? Another approach would be to use some indicator (like |
I don't think that's necessary. This is just for completing-read, not for "management."
For me, it's TMI. I select activities by name, not by a number of how many windows or files are visible in it. I can't think of a situation where I would need to know that. However, knowing whether an activity has a last-used state could be useful, I think. |
I'm not sure what you mean by "dirty." For me what would be interesting is whether the activity has a last-used state or just the default. |
Sorry, I'm not sure I understand your idea. If you have activity auto-saving on (which is the default), an activity will pretty much always have a "last" state, even if it's only lightly modified from the default (different window points, sizes, etc.). So my idea of "dirty" is if the last state differs is an interesting way from the default — i.e. different buffers showing. I did need to accommodate a missing "last" state, but that's a pretty rare case for me, like when I've just defined a new state. |
I often use
I feel like that concept might be hard to communicate to the user, but if you want to add an asterisk or something and document it to mean that, I won't object. |
OK sounds good; lack of asterisk would also mean "no last state". One oddity I've found: when I |
I can see pros and cons on either side. Please feel free to open a new issue about that if you like. |
Thanks. I've pushed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Also, could you post a final screenshot showing what it looks like with the asterisk?
3e2e13a
to
6c26c59
Compare
Thanks for the screenshot.
Well, I do think that active activities should be marked in some way; it would seem like an obviously missing feature otherwise, IMO. Replacing the age with some other string to indicate its being active would be one possibility. OTOH the multiple colors already make that column a bit busy-looking. I'm not sure what the best solution is. We should probably also keep in mind potential window width in terms of the multiple columns of information. Have you tested with a half-screen-width window?
I think a customizable sorting option should be part of this PR, if you're willing to work on it. Having the age column but not sorting by it seems weird. I'd guess that active ones should be sorted first, then the rest by age. There's also https://github.com/alphapapa/frecency.el, which might be good to use. But I think that library should be rewritten; I've learned a lot since I wrote it, and its API is a bit awkward, so I wouldn't suggest using it now. But if the sorting function were customizeable, it could be used later. |
Something else:
This leads to false-positive modified states. Both of these mean I should check for equivalent files (if available) or buffer names (if not). |
311b042
to
b67a3f5
Compare
OK I've got something I'm reasonably happy with, with Obviously still need to sort, and couple of small structural bothers:
|
I got sort working, but I forgot that vertico substitutes it's own "most recent used then shortest candidate" sort function. You can disable it by let-binding Update: Got this working by factoring out a new completion-table and setting |
Have you ever seen the persist file disappear? It's happened to me twice in the past few days while hacking on this. I note that persist removes the file if the value is ever the default value on save ( |
It has happened to me with another package, but only when I used my |
OK, see #87. Give the sort and active marker a look and let me know what you think about preventing the time-tick from updating unless "things have changed". |
Anything further needed here? If you like I can look into updating activity timestamp on save only if buffers changed. |
Improve docstring
Introduces new custom variable `activities-annotation-colors'.
These are the ages that are actually showing during completion.
7bdda9c
to
e131d56
Compare
I have the "keep email address private" option selected, which means github refuses pushes with your actual email as author:
But since it's been mentioned here I temporarily changed that and force-pushed with updated author email. It was a lot of commits! Luckily magit with rebase-interactive and a quick keyboard macro made quick work of it. |
BTW, RE our discussions above of richer abbreviated dates, my related patch was merged to master recently, and will soon be added to |
Thanks. So, after about 8 months, this is finally merged. Thanks for your contribution and, of course, your patience.
I use |
(updated) This provides custom annotation and sorting functions for
activities-completing-read
. It shows the number of buffers (and files), for the last or default state, a magit-style color-coded activity age, and flags for being active or having a modified set of buffers.This is shown below with
vertico
but it should support any UI which handles annotation-functions (most do). For theme friendliness, it creates no new faces, insteadborrowing thebuilding its own color palette (along withvc-annotate
color palettesuccess
andwarning
faces). Happy to take any input/ideas.