ahyatt / ekg

The emacs knowledge graph, app for notes and structured data.
GNU General Public License v3.0
230 stars 19 forks source link

kill window on capture abort #184

Closed QiangF closed 1 month ago

QiangF commented 1 month ago

The window layout should be restored.

ahyatt commented 1 month ago

Thank you for your contribution! I'm curious why this is needed, though - with https://github.com/ahyatt/ekg/commit/789cb6d954e0b31f8c25cc0bfa84ba812820f5cf, we no longer open the notes in a different window - so theoretically we shouldn't need to kill the window. For example, if the user has two windows, and opens notes in one of them, I think it'd be a mistake to kill that window when quiting out of the notes buffer. What do you think?

QiangF commented 1 month ago

For example, if the user has two windows, and opens notes in one of them, I think it'd be a mistake to kill that window when quiting out of the notes buffer. What do you think?

I agree that it is a user preference issue. But since the note buffer is temporary, it maybe better to be shown in a popup, not shown in the current window. I use Shackle to manage popup windows, shackle unfortunately can not delete the window after use.

I have my improved shackle here https://github.com/QiangF/shackle

QiangF commented 1 month ago

Comment for my last commit:

  1. currently the whole note (tag and note abstract) are highlighted with hl-line face, which is quite distracting, highlight the current line using hl-line-mode is enough.
  2. when there are too many items in an ekg notes buffer, add more tags to further filter the result is an useful functionality, the tags in effect is removed from the complete read list.
QiangF commented 1 month ago

I am not good at git. Please feel free to close or modified the pull request as you see fit.

qingshuizheng commented 1 month ago
  1. highlighted with hl-line face, which is quite distracting

Quite agree on this. I'd like to disable it by default.

QiangF commented 1 month ago

I find I can put window closing in kill-buffer-hook, I have added that support https://github.com/QiangF/shackle

ahyatt commented 1 month ago

Without hl-line-mode, though, how do you know what the current note is? There needs to be some visual indication.

As far as the behavior of creating windows or not (and then killing them on quitting out), perhaps the behavior can be configured. Let me see if there's some standard practice that I might be missing here.

QiangF commented 1 month ago

Without hl-line-mode, though, how do you know what the current note is? There needs to be some visual indication.

You are right. I find it is less unpleasing when I limit the amount of the previewed note content in ekg-display-note-template. I think this pull request could be closed now. Just don't forget to make the buffer name more consistent, use "EKG " instead of "ekg ".

ahyatt commented 1 month ago

Thank you for bringing up these points, though - I appreciate the pull request. I'm not sure what the best solution is yet, but I'll continue to think about this.