rougier / mu4e-dashboard

A dashboard for mu4e (mu for emacs)
GNU General Public License v3.0
467 stars 43 forks source link

suggestion: make the dashboard read/write (or embeddable) #50

Open dmgerman opened 8 months ago

dmgerman commented 8 months ago

hi Nicolas,

I have been a long time user of the mu4e-dashboard. Thank you for developing it.

However, I find two major issues with it:

  1. It is read only
  2. It is not "embeddable" into other files.

Ideally, I would like to use the dashboard from my daily file. That way my daily is my main dashboard.

I thought about it and implemented a function that:

  1. Finds a predefined header (e.g. Flagged Emails).
  2. Removes its contents
  3. Scans the flagged emails (up to a maximum number)
    • for each email, create an entry in a table: date, subject, from
    • the subject is an org link to the email using its message id

This way I can run a function to update the headline.

I have also done something similar to NEXT actions.

In general, the idea would be that an action in the dashboard replaces a given header (or creates it if does not exist) with the corresponding content.

Note that text properties allow sections of a buffer to be read-only. So it is possible to guarantee that some sections in the mu4e dashboard remain always read-only.

If this is of interest to anybody, I can share the code.

--dmg

rougier commented 8 months ago

Problem is that during an update, the dashboard is written automatically and if you edit at the same time, it will mess up things. I've commited a modification that suspend update when you're in RW mode but you have to explicitly enter RW mode manually. Would that work for you?