From fe02e6c231dee8abad2a9f2cb1a61fd679941af6 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 16 Jan 2017 08:42:14 +0100 Subject: emacs: some fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- emacs/init.org | 64 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 33 deletions(-) (limited to 'emacs/init.org') diff --git a/emacs/init.org b/emacs/init.org index 15a3b63..af0c2e0 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -4,7 +4,6 @@ #+PROPERTY: header-args :tangle ~/.emacs.d/init.el * Preface -<> This is my attempt of getting my configuration organized with literate programming and =org-babel=. I took the workflow I'm following from [[https://github.com/larstvei][@larstvei]]. @@ -517,7 +516,7 @@ recent versions of GNU Emacs. "u" 'undo-tree-visualize))) #+END_SRC -Another important package is =flycheck=, which is a on-the-fly syntax checking +Another important package is =flycheck=, which is an on-the-fly syntax checking extension. This works with lots of languages with proper glue code. #+BEGIN_SRC elisp @@ -660,11 +659,11 @@ from the [[https://www.djcbsoftware.nl/code/mu/mu4e/Dired.html#Dired][mu4e docum * Evil -Forgive me, [[https://stallman.org/saint.html][Father]], for I have sinned. As I said in the [[:preface][Preface]], I've been -exposed to modal editing through Vim, and that has changed how I view editing -for the foreseeable future. Because of this, I use Evil. The following block -includes some heavy-lifting so Evil and GNU Emacs work without hitting each -other, and it also includes some Evil extensions. +Forgive me, [[https://stallman.org/saint.html][Father]], for I have sinned. I've been exposed to modal editing +through Vim, and that has changed how I view editing for the foreseeable future. +Because of this, I use Evil. The following block includes some heavy-lifting so +Evil and GNU Emacs work without hitting each other, and it also includes some +Evil extensions. #+BEGIN_SRC elisp (defun mssola-evil () @@ -867,40 +866,39 @@ After that, I am defining some functions that will be used in various parts of the configuration. #+BEGIN_SRC elisp - (defun mssola-smtp (server port) - "Set SMTP variables depending on the given SERVER and PORT." +(defun mssola-smtp (server port) + "Set SMTP variables depending on the given SERVER and PORT." - (require 'smtpmail) + (require 'smtpmail) - (setq smtpmail-starttls-credentials - '((server port nil nil)) - smtpmail-auth-credentials - (expand-file-name "~/.authinfo.gpg") - smtpmail-default-smtp-server server - smtpmail-smtp-server server - smtpmail-smtp-service port)) + (setq smtpmail-starttls-credentials + '((server port nil nil)) + smtpmail-auth-credentials + (expand-file-name "~/.authinfo.gpg") + smtpmail-default-smtp-server server + smtpmail-smtp-server server + smtpmail-smtp-service port)) - ;; Define the different accounts that I'm using. This is only available since - ;; mu 0.9.16. +; https://www.reddit.com/r/emacs/comments/47t9ec/share_your_mu4econtext_configs/d0fsih6 +(defun mu4e-message-maildir-matches (msg rx) + "Returns true if the maildir of MSG matches the given regexp RX." - ; https://www.reddit.com/r/emacs/comments/47t9ec/share_your_mu4econtext_configs/d0fsih6 - (defun mu4e-message-maildir-matches (msg rx) - (when rx - (if (listp rx) - ;; if rx is a list, try each one for a match - (or (mu4e-message-maildir-matches msg (car rx)) - (mu4e-message-maildir-matches msg (cdr rx))) - ;; not a list, check rx - (string-match rx (mu4e-message-field msg :maildir))))) + (when rx + (if (listp rx) + ;; if rx is a list, try each one for a match + (or (mu4e-message-maildir-matches msg (car rx)) + (mu4e-message-maildir-matches msg (cdr rx))) + ;; not a list, check rx + (string-match rx (mu4e-message-field msg :maildir))))) - (defun suse-refile-folder (key) - "Returns the refile folder for the given SUSE account in the KEY arg" - (concat "/" key "/Archives/" - (format-time-string "%Y" (current-time)))) +(defun suse-refile-folder (key) + "Returns the refile folder for the given SUSE account in the KEY arg" + (concat "/" key "/Archives/" + (format-time-string "%Y" (current-time)))) #+END_SRC Now it's time to define the different contexts that I have. Defining contexts -this way is relatively new (since mu 0.16). +this way is relatively new (since mu 0.9.16). #+BEGIN_SRC elisp (setq mu4e-contexts -- cgit v1.2.3