Update mailboxes in sidebar

This commit is contained in:
Thomas Dehaeze 2019-12-15 10:54:16 +01:00
parent 1747b866e2
commit e8247e225c

View File

@ -547,6 +547,8 @@ Documentation:
*** Generic *** Generic
#+begin_src conf #+begin_src conf
bind generic Q exit
bind generic <Return> select-entry bind generic <Return> select-entry
bind generic l select-entry bind generic l select-entry
@ -778,6 +780,7 @@ Use =urlview= to extract urls from the mail.
#+begin_src conf #+begin_src conf
macro index,pager S "<pipe-message>$HOME/scripts/mutt-save-org-link.py\n" macro index,pager S "<pipe-message>$HOME/scripts/mutt-save-org-link.py\n"
#+end_src #+end_src
**** Link mail to orgmode - Script **** Link mail to orgmode - Script
:PROPERTIES: :PROPERTIES:
:header-args: :tangle ~/scripts/mutt-save-org-link.py :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 # Grab the relevant message headers
message_id = urllib.parse.quote(message['message-id'].strip()[1:-1]) 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 # Ask emacsclient to save a link to the message
p = subprocess.Popen([ p = subprocess.Popen([
'emacsclient', '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() p.wait()
@ -1191,7 +1195,8 @@ This empty code block is used to add a new line after signatude
set mail_check_stats set mail_check_stats
# Display the Sidebar mailboxes using this format string. # 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: # Sort the mailboxes in the Sidebar using this method:
# count - total number of messages # 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. *** Mailboxes to show in the sidebar.
#+BEGIN_SRC conf #+BEGIN_SRC conf
mailboxes \ # mailboxes \
+search \ # +search \
"+Google" \ # +gmail/Inbox \
+gmail/Inbox \ # +gmail/Archive \
+gmail/Archive \ # +gmail/Drafts \
+gmail/Drafts \ # +gmail/Sent \
+gmail/Sent \ # +gmail/Trash \
+gmail/Trash \ # +esrf/Inbox \
"+ESRF" \ # +esrf/Archive \
+esrf/Inbox \ # +esrf/Drafts \
+esrf/Archive \ # +esrf/Sent \
+esrf/Drafts \ # +esrf/Trash \
+esrf/Sent \ # +ulg/Inbox \
+esrf/Trash \ # +ulg/Archive \
"+ULG" \ # +ulg/Drafts \
+ulg/Inbox \ # +ulg/Sent \
+ulg/Archive \ # +ulg/Trash \
+ulg/Drafts \
+ulg/Sent \ named-mailboxes "  Search" =search
+ulg/Trash \ 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 set sendmail_wait = 0 # no please don't silently fail, email is important
unset move unset move