ahyatt / ekg

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

Add ekg-auto-save #118

Closed qingshuizheng closed 10 months ago

qingshuizheng commented 11 months ago

Auto-save ekg notes:

  1. when emacs has been idle for x secs (by default, value is the same as auto-save-timeout)
  2. on every x characters are typed (by default, value is the same as auto-save-interval)
  3. when specific command is triggerred, e.g., on running command previous-buffer
  4. when specific hook is triggerred
  5. before kill-buffer

User options:

~1. ekg-auto-save-when-idle~ ~2. ekg-auto-save-idle~ ~3. ekg-auto-save-silently~ ~4. ekg-auto-save-triggers~ ~5. ekg-auto-save-hook-triggers~ ~6. ekg-auto-save-as-draft~ ~7. ekg-auto-save-predicates~

  1. ekg-auto-save-interval
  2. ekg-auto-save-timeout
  3. ekg-auto-save-no-message
  4. ekg-auto-save-command-triggers
  5. ekg-auto-save-hook-triggers
  6. ekg-auto-save-force-save-on-buffer-kill
  7. ekg-auto-save-predicate

UPDATE: to reflect the latest commit.

qingshuizheng commented 11 months ago

I just pushed a new commit for review. (Too messy :-(

BTW, let me know before you merge this, I will squash them into one commit.

qingshuizheng commented 10 months ago

Hello Andrew, I just force-pushed the new edits. Since there are too many minor adjustments, and basically not reviewable imo, so I squashed them into several commits.

What's in the commits:

  1. Set buffer modified status to nil after save
  2. Add option ekg-save-no-message (name borrowed from builtin auto-save-no-message)
  3. Add the ekg-auto-save file.
ahyatt commented 10 months ago

Thank you for all the edits! This looks good now, so I'll merge it in. I'll see if I can get rid of the advice before I make a major release.