Add neomutt connection
This commit is contained in:
		@@ -109,7 +109,6 @@
 | 
			
		||||
  :PROPERTIES:
 | 
			
		||||
  :header-args:emacs-lisp+: :tangle ~/.spacemacs.d/user-config.el
 | 
			
		||||
  :END:
 | 
			
		||||
 | 
			
		||||
** Others
 | 
			
		||||
#+BEGIN_SRC emacs-lisp
 | 
			
		||||
  ;; Line Wrapping
 | 
			
		||||
@@ -258,7 +257,8 @@
 | 
			
		||||
                                                                  "#+LATEX_HEADER: \\newcommand{\\refUrl}{${url}}\n"
 | 
			
		||||
                                                                  "#+LATEX_HEADER: \\newcommand{\\refKeywords}{${keywords}}\n"
 | 
			
		||||
                                                                  "#+LATEX_HEADER: \\input{config.tex}\n"
 | 
			
		||||
                                                                  ":end:\n"
 | 
			
		||||
                                                                  "#+LATEX_HEADER: \\graphicspath{{./figs/${=key=}/}}\n"
 | 
			
		||||
                                                                  ":END:\n"
 | 
			
		||||
                                                                  "\n"
 | 
			
		||||
                                                                  "#+BEGIN_abstract\n"
 | 
			
		||||
                                                                  "\n"
 | 
			
		||||
@@ -444,6 +444,7 @@ https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html
 | 
			
		||||
- Things reading (BOOKMARS)
 | 
			
		||||
- Things to read
 | 
			
		||||
- etc...
 | 
			
		||||
 | 
			
		||||
*** Org Notification based on calendar event
 | 
			
		||||
https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events
 | 
			
		||||
#+BEGIN_SRC emacs-lisp
 | 
			
		||||
@@ -1035,6 +1036,8 @@ Ressources:
 | 
			
		||||
 | 
			
		||||
#+BEGIN_SRC emacs-lisp
 | 
			
		||||
  (with-eval-after-load 'org
 | 
			
		||||
    (setq org-noter-always-create-frame nil)
 | 
			
		||||
    (setq org-noter-kill-frame-at-session-end nil)
 | 
			
		||||
    ;; Fraction of the frame that the document window will occupy when split
 | 
			
		||||
    (setq org-noter-doc-split-fraction '(0.6 . 0.6))
 | 
			
		||||
    ;; Save the last visited location automatically; when starting a new session, go to that location
 | 
			
		||||
@@ -1102,9 +1105,9 @@ Disable automatic highlight of TODO keywords in orgmode buffers
 | 
			
		||||
 | 
			
		||||
*** Setup Matlab Mode
 | 
			
		||||
#+BEGIN_SRC emacs-lisp
 | 
			
		||||
  (setq matlab-shell-command "/usr/local/bin/matlab")
 | 
			
		||||
  (setq matlab-shell-command-switches (list "-nodesktop -nosplash"))
 | 
			
		||||
  (setq mlint-programs '("mlint" "/usr/local/MATLAB/R2018a/bin/glnxa64/mlint"))
 | 
			
		||||
  ;; (setq matlab-shell-command "/usr/local/bin/matlab")
 | 
			
		||||
  ;; (setq matlab-shell-command-switches (list "-nodesktop -nosplash"))
 | 
			
		||||
  ;; (setq mlint-programs '("mlint" "/usr/local/matlab/r2018a/bin/glnxa64/mlint"))
 | 
			
		||||
#+END_SRC
 | 
			
		||||
 | 
			
		||||
*** Setup Flycheck
 | 
			
		||||
@@ -1125,10 +1128,10 @@ Disable automatic highlight of TODO keywords in orgmode buffers
 | 
			
		||||
#+END_SRC
 | 
			
		||||
 | 
			
		||||
#+BEGIN_SRC emacs-lisp :tangle no
 | 
			
		||||
(defadvice org-edit-src-code (around set-buffer-file-name activate compile)
 | 
			
		||||
  (let ((file-name (buffer-file-name))) ;; (1)
 | 
			
		||||
    ad-do-it                            ;; (2)
 | 
			
		||||
    (setq buffer-file-name file-name))) ;; (3)
 | 
			
		||||
  (defadvice org-edit-src-code (around set-buffer-file-name activate compile)
 | 
			
		||||
    (let ((file-name (buffer-file-name))) ;; (1)
 | 
			
		||||
      ad-do-it                            ;; (2)
 | 
			
		||||
      (setq buffer-file-name file-name))) ;; (3)
 | 
			
		||||
#+END_SRC
 | 
			
		||||
 | 
			
		||||
*** Setup Company - not working
 | 
			
		||||
@@ -1406,3 +1409,36 @@ Org simply =C-c l= to store the link to the email and then =C-c C-l= and paste t
 | 
			
		||||
#+BEGIN_SRC emacs-lisp
 | 
			
		||||
  (cancel-timer recentf-auto-save-timer)
 | 
			
		||||
#+END_SRC
 | 
			
		||||
 | 
			
		||||
** TODO [#C] Neomutt connection
 | 
			
		||||
https://mentat.za.net/blog/2018/10/31/using-org-mode-with-neomutt/
 | 
			
		||||
 | 
			
		||||
#+BEGIN_SRC emacs-lisp
 | 
			
		||||
  (require 'org-protocol)
 | 
			
		||||
  ;; Call this function, which spawns neomutt, whenever org-mode
 | 
			
		||||
  ;; tries to open a link of the form mutt:message-id+goes_here@mail.gmail.com
 | 
			
		||||
 | 
			
		||||
  (defun tdehaeze/mutt-open-message (message-id)
 | 
			
		||||
    "In neomutt, open the email with the the given Message-ID"
 | 
			
		||||
    (let*
 | 
			
		||||
        ((message-id (replace-regexp-in-string "^/*" "" message-id))
 | 
			
		||||
        (mail-file
 | 
			
		||||
          (replace-regexp-in-string
 | 
			
		||||
          "\n$" "" (shell-command-to-string
 | 
			
		||||
                    (format "mu find -n 1 -f l i:%s" message-id))))
 | 
			
		||||
        (mail-dir (replace-regexp-in-string "/\\(cur\\|new\\|tmp\\)/$" ""
 | 
			
		||||
                                            (file-name-directory mail-file)))
 | 
			
		||||
        (message-id-escaped (regexp-quote message-id))
 | 
			
		||||
        (mutt-keystrokes
 | 
			
		||||
          (format "L~i %s\n\n" (shell-quote-argument message-id-escaped)))
 | 
			
		||||
        (mutt-command (list "neomutt" "-R" "-f" mail-dir
 | 
			
		||||
                            "-e" (format "push '%s'" mutt-keystrokes))))
 | 
			
		||||
 | 
			
		||||
      (message "Launching neomutt for message %s" message-id)
 | 
			
		||||
      (call-process "setsid" nil nil
 | 
			
		||||
                    "-f" "termite" "-e"
 | 
			
		||||
                    (concat "neomutt -R -f " mail-dir " -e \"" (format "push '%s a l'\"" mutt-keystrokes)))))
 | 
			
		||||
 | 
			
		||||
  ;; Hook up `message:...` style URLs
 | 
			
		||||
  (org-add-link-type "message" 'tdehaeze/mutt-open-message)
 | 
			
		||||
#+end_src
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user