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

Feature requests #10

Closed
ylc opened this issue May 8, 2023 · 2 comments
Closed

Feature requests #10

ylc opened this issue May 8, 2023 · 2 comments

Comments

@ylc
Copy link

ylc commented May 8, 2023

  1. Can we have a function that closes all expanded views in ednc-log buffer?
    The reason why I would like this is because I open all new notifications in expanded form.
  2. Can we have a way to close previous notifications upon new ones arriving?

Thank you for this package. I have ednc-log buffer open all the time, and I rely on it to an eye on my notifications.

sinic added a commit that referenced this issue May 24, 2023
While this technically breaks the API, you would have had to use a
negative prefix for ednc-toggle-expanded-view for it to become a
problem, which I can't imagine anyone doing.

Impetus for this change comes from GitHub user @ylc in issue #10.
Thanks!
@sinic
Copy link
Owner

sinic commented May 24, 2023

The default behavior of EDNC is just a starting point that users are free to customize, and I would rather not introduce any functions that are a better fit for an individual user's configuration file. (For the same reason, I have helpful functions like list-notifications and stack-notifications in my README, but not in the package's codebase.)

The important thing is that EDNC's public API is flexible enough for users to implement their ideas, and in your case it turned out that life could be made easier by a small change to ednc-toggle-expanded-view, namely to provide a way to unexpand notifications unconditionally. This technically breaks the API, but since EDNC's major version is still 0, I feel that's okay.

Can we have a function that closes all expanded views in ednc-log buffer?
The reason why I would like this is because I open all new notifications in expanded form.

You can now use a function like the following in your log-buffer to close all expanded views:

(defun unexpand-all-notifications ()
  (goto-char (point-max))
  (while (zerop (forward-line -1)) (ednc-toggle-expanded-view (point) -1)))

Can we have a way to close previous notifications upon new ones arriving?

You can leverage the function above to do that as well:

(defun unexpand-log-buffer-on-new (old new)
  (when new (with-current-buffer (get-buffer-create ednc-log-name)
              (unexpand-all-notifications))))

(push #'unexpand-log-buffer-on-new ednc-notification-presentation-functions)

(Yes, this unexpands all notifications, including the new one, but you presumably use ednc-pop-to-notification-in-log-buffer, which expands it again. Otherwise it shouldn't be hard to modify to leave the most recent one alone.)

Thanks for the feedback.

@sinic sinic closed this as completed May 24, 2023
@ylc
Copy link
Author

ylc commented May 26, 2023

Thank you.

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

2 participants