diff --git a/dotfiles/mail.org b/dotfiles/mail.org index db05081..36e9185 100644 --- a/dotfiles/mail.org +++ b/dotfiles/mail.org @@ -681,30 +681,11 @@ Labels macro attach W ~/Downloads/y "Save entry" #+end_src -*** TODO Compose -#+BEGIN_SRC conf - bind compose p postpone-message - - bind compose R rename-attachment - - bind compose a attach-file -#+END_SRC - Attach multiple files using ranger #+begin_src conf macro compose A "bash $HOME/.config/neomutt/bin/rangerpicksource /tmp/rangerpickbash $HOME/.config/neomutt/bin/rangerpick clean" "Attach with Ranger" #+end_src -Write html emails using markdown -#+BEGIN_SRC conf - # macro compose M "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=us-ascii\n" -#+END_SRC - -Open another instance of neomutt in readonly mode while composing -#+BEGIN_SRC conf - macro compose M "termite -e \"neomutt -R\"" -#+END_SRC - **** Attach with Ranger Script :PROPERTIES: :header-args: :tangle ~/.config/neomutt/bin/rangerpick @@ -720,6 +701,25 @@ Open another instance of neomutt in readonly mode while composing fi #+end_src +*** TODO Compose +#+BEGIN_SRC conf + bind compose p postpone-message + + bind compose R rename-attachment + + bind compose a attach-file +#+END_SRC + +Write html emails using markdown +#+BEGIN_SRC conf + # macro compose M "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=us-ascii\n" +#+END_SRC + +Open another instance of neomutt in readonly mode while composing +#+BEGIN_SRC conf + macro compose M "termite -e \"neomutt -R\"" +#+END_SRC + *** Browser #+begin_src conf bind browser l select-entry @@ -778,6 +778,34 @@ 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 + :header-args+: :comments both :mkdirp yes + :header-args+: :shebang "#!/usr/bin/env python3" + :END: +#+begin_src python + import sys + import email + import subprocess + import urllib.parse + + # Parse the email from standard input + message_bytes = sys.stdin.buffer.read() + message = email.message_from_bytes(message_bytes) + + # Grab the relevant message headers + message_id = urllib.parse.quote(message['message-id'].strip()[1:-1]) + subject = message['subject'].replace('[', '{').replace(']', '}') + + # Ask emacsclient to save a link to the message + p = subprocess.Popen([ + 'emacsclient', + f'org-protocol://store-link?url=message://{message_id}&title={subject}' + ]) + + p.wait() +#+end_src ** Colors *** Basic colors @@ -1353,31 +1381,3 @@ Libreoffice application/wordperfect; libreoffice --nologo --writer '%s'; copiousoutput text/rtf; libreoffice --nologo --writer '%s'; copiousoutput #+end_src -** Link mail to orgmode - :PROPERTIES: - :header-args: :tangle ~/scripts/mutt-save-org-link.py - :header-args+: :comments both :mkdirp yes - :header-args+: :shebang "#!/usr/bin/env python3" - :END: -#+begin_src python - import sys - import email - import subprocess - import urllib.parse - - # Parse the email from standard input - message_bytes = sys.stdin.buffer.read() - message = email.message_from_bytes(message_bytes) - - # Grab the relevant message headers - message_id = urllib.parse.quote(message['message-id'].strip()[1:-1]) - subject = message['subject'].replace('[', '{').replace(']', '}') - - # Ask emacsclient to save a link to the message - p = subprocess.Popen([ - 'emacsclient', - f'org-protocol://store-link?url=message://{message_id}&title={subject}' - ]) - - p.wait() -#+end_src