diff options
author | Marc Coquand <marc@mccd.space> | 2024-09-22 17:06:48 +0300 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2024-09-22 17:06:48 +0300 |
commit | 9dc78c4627e4b300fda2b650e9ea065d012faada (patch) | |
tree | 4ebda4b5224573120584bc8bcf790a8ccad2519c /emacs | |
parent | b2f56a06a9b6d3c2fdc09b33fbbd568b651d5eab (diff) | |
download | bsd-9dc78c4627e4b300fda2b650e9ea065d012faada.tar.gz bsd-9dc78c4627e4b300fda2b650e9ea065d012faada.tar.bz2 bsd-9dc78c4627e4b300fda2b650e9ea065d012faada.zip |
emacs
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs | 45 |
1 files changed, 41 insertions, 4 deletions
@@ -8,11 +8,11 @@ (pixel-scroll-precision-mode) (delete-selection-mode 1) (fset 'yes-or-no-p 'y-or-n-p) -(setq initial-scratch-message ";; scratch") +(setq initial-scratch-message "") (setq-default frame-title-format '("%b")) (setq ring-bell-function 'ignore) (setq inhibit-startup-screen t) -(setq line-spacing 0.15) +(setq line-spacing 0.2) ;; Put Emacs auto-save and backup files to /tmp @@ -72,6 +72,11 @@ ;; Pairs (electric-pair-mode 1) +(global-set-key (kbd "M-{") 'insert-pair) +(global-set-key (kbd "M-\"") 'insert-pair) +(global-set-key (kbd "M-\'") 'insert-pair) +(global-set-key (kbd "M-<") 'insert-pair) +(global-set-key (kbd "M-[") 'insert-pair) ;; IDO (ido-mode t) @@ -127,7 +132,25 @@ mastodon-active-user "marcc" mastodon-instance-url "https://fosstodon.org") + + ;; Mu4e +(defun marc/set-msmtp-account () + (if (message-mail-p) + (save-excursion + (let* + ((from (save-restriction + (message-narrow-to-headers) + (message-fetch-field "from"))) + (account + (cond + ((string-match "marcc@fastmail.fr" from) "home") + ((string-match "marc.coqxuand@sustainably.app" from) "work") + ((string-match "marc@mccd.space" from) "home")))) + (setq message-sendmail-extra-arguments (list '"-a" account)))))) + +(add-hook 'message-send-mail-hook 'marc/set-msmtp-account) + (use-package mu4e :ensure nil :load-path "/usr/share/emacs/site-lisp/mu4e/" @@ -135,7 +158,21 @@ ;; This is set to 't' to avoid mail syncing issues when using mbsync (setq mu4e-change-filenames-when-moving t) + + ;; don't keep message compose buffers around after sending: + (setq message-kill-buffer-on-exit t) + ;; send function: + (setq send-mail-function 'sendmail-send-it + message-send-mail-function 'sendmail-send-it) + + ;; send program: + ;; this is exeranal. remember we installed it before. + (setq sendmail-program (executable-find "msmtp")) + + ;; select the right sender email from the context. + (setq message-sendmail-envelope-from 'header) + ;; Refresh mail using isync every 10 minutes (setq mu4e-update-interval (* 10 60) mu4e-get-mail-command "mbsync -a" @@ -143,7 +180,6 @@ mu4e-view-show-addresses t mu4e-attachment-dir "~/Downloads" mu4e-view-prefer-html t - message-send-mail-function 'smtpmail-send-it mu4e-maildir "~/mail") (setq mu4e-contexts @@ -163,6 +199,7 @@ (mu4e-sent-folder . "/home/Sent") (mu4e-refile-folder . "/home/Archive") (mu4e-trash-folder . "/home/Trash") + (mu4e-maildir-shortcuts . (("/home/INBOX" . ?i) ("/home/Archive/Done" . ?d) @@ -206,7 +243,7 @@ '(font-lock-type-face ((t (:foreground "black")))) '(font-lock-variable-name-face ((t (:foreground "black")))) '(header-line ((t (:inherit mode-line :background "white" :foreground "grey20" :box nil :underline "black")))) - '(highlight ((t (:background "light yellow")))) + '(highlight ((t (:background "white smoke")))) '(mastodon-display-name-face ((t (:inherit nil :weight bold)))) '(mode-line ((t (:background "white" :foreground "black" :box (:line-width (1 . -1) :style flat-button) :overline "black")))) '(mu4e-header-highlight-face ((t (:inherit hl-line :extend t :weight bold)))) |