From e8247e225cc0bba9eaaf547944f315e1fe4e9050 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Sun, 15 Dec 2019 10:54:16 +0100 Subject: [PATCH] Update mailboxes in sidebar --- dotfiles/mail.org | 68 +++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/dotfiles/mail.org b/dotfiles/mail.org index d34ce45..eacc4ec 100644 --- a/dotfiles/mail.org +++ b/dotfiles/mail.org @@ -547,6 +547,8 @@ Documentation: *** Generic #+begin_src conf + bind generic Q exit + bind generic select-entry bind generic l select-entry @@ -778,6 +780,7 @@ Use =urlview= to extract urls from the mail. #+begin_src conf macro index,pager S "$HOME/scripts/mutt-save-org-link.py\n" #+end_src + **** Link mail to orgmode - Script :PROPERTIES: :header-args: :tangle ~/scripts/mutt-save-org-link.py @@ -796,12 +799,13 @@ Use =urlview= to extract urls from the mail. # Grab the relevant message headers message_id = urllib.parse.quote(message['message-id'].strip()[1:-1]) - subject = message['subject'].replace('[', '{').replace(']', '}') + subject = message['subject'].replace('[', '{').replace(']', '}').replace('\n', ' ') + subject = (subject[:75] + '..') if len(subject) > 75 else subject # Ask emacsclient to save a link to the message p = subprocess.Popen([ 'emacsclient', - f'org-protocol://store-link?url=message://{message_id}&title={subject}' + f'org-protocol://capture?template=pm&url={message_id}&title={subject}' ]) p.wait() @@ -1191,7 +1195,8 @@ This empty code block is used to add a new line after signatude set mail_check_stats # Display the Sidebar mailboxes using this format string. - set sidebar_format = '%B %?N?(%N)?%* %S' + # set sidebar_format = '%B %?N?(%N)?%* %S' + set sidebar_format = '%B %* %?N?[%N]?' # Sort the mailboxes in the Sidebar using this method: # count - total number of messages @@ -1204,26 +1209,43 @@ This empty code block is used to add a new line after signatude *** Mailboxes to show in the sidebar. #+BEGIN_SRC conf - mailboxes \ - +search \ - "+Google" \ - +gmail/Inbox \ - +gmail/Archive \ - +gmail/Drafts \ - +gmail/Sent \ - +gmail/Trash \ - "+ESRF" \ - +esrf/Inbox \ - +esrf/Archive \ - +esrf/Drafts \ - +esrf/Sent \ - +esrf/Trash \ - "+ULG" \ - +ulg/Inbox \ - +ulg/Archive \ - +ulg/Drafts \ - +ulg/Sent \ - +ulg/Trash \ + # mailboxes \ + # +search \ + # +gmail/Inbox \ + # +gmail/Archive \ + # +gmail/Drafts \ + # +gmail/Sent \ + # +gmail/Trash \ + # +esrf/Inbox \ + # +esrf/Archive \ + # +esrf/Drafts \ + # +esrf/Sent \ + # +esrf/Trash \ + # +ulg/Inbox \ + # +ulg/Archive \ + # +ulg/Drafts \ + # +ulg/Sent \ + # +ulg/Trash \ + + named-mailboxes "  Search" =search + named-mailboxes " GMAIL" =empty/gmail + named-mailboxes "  Inbox" =gmail/Inbox + named-mailboxes "  Sent" =gmail/Sent + named-mailboxes "  Drafts" =gmail/Drafts + named-mailboxes " ﮊ Archive" =gmail/Archive + named-mailboxes "  Trash" =gmail/Trash + named-mailboxes " ESRF" =empty/esrf + named-mailboxes "  Inbox" =esrf/Inbox + named-mailboxes "  Sent" =esrf/Sent + named-mailboxes "  Drafts" =esrf/Drafts + named-mailboxes " ﮊ Archive" =esrf/Archive + named-mailboxes "  Trash" =esrf/Trash + named-mailboxes " ULG" =empty/ulg + named-mailboxes "  Inbox" =ulg/Inbox + named-mailboxes "  Sent" =ulg/Sent + named-mailboxes "  Drafts" =ulg/Drafts + named-mailboxes " ﮊ Archive" =ulg/Archive + named-mailboxes "  Trash" =ulg/Trash set sendmail_wait = 0 # no please don't silently fail, email is important unset move