From 02fe027e618cb3a5b3c1c0112266428efe7e1b03 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 20 Oct 2023 08:40:34 +0200 Subject: [PATCH] Move mailing related configuration to its own section --- configuration.org | 162 ++++++++++++++++++++++++---------------------- 1 file changed, 83 insertions(+), 79 deletions(-) diff --git a/configuration.org b/configuration.org index 1c03fd5..ca06bc4 100644 --- a/configuration.org +++ b/configuration.org @@ -2413,75 +2413,31 @@ directory. It is available from [[http://plantuml.com/download][here]]. :after org) #+end_src -* Custom commands and functions +* Mailing -** Frame manipulation +** Set up whitespace handling in mu4e buffers -*** Hidden modeline mode -:PROPERTIES: -:SOURCE: http://emacs-doctor.com/emacs-strip-tease.html -:END: +Due to my programming (and maybe a bit of OCD) needs, i set trailing whitespace +to have a red background so it stands out *a lot*. However, many emails contain +a lot of trailing whitespace which makes them really hard to read in Emacs. -To temporarily hide the mode line. +The below snippet creates a trailing whitespace face specific to mu4e view +buffers. The accompanying function will be added to ~mu4e-view-mode-hook~. -#+BEGIN_SRC emacs-lisp -(defvar hidden-mode-line-mode nil) -(defvar hide-mode-line nil) - -(define-minor-mode hidden-mode-line-mode - "Minor mode to hide the mode-line in the current buffer." - :init-value nil - :global nil - :variable hidden-mode-line-mode - :group 'editing-basics - (if hidden-mode-line-mode - (setq hide-mode-line mode-line-format - mode-line-format nil) - (setq mode-line-format hide-mode-line - hide-mode-line nil)) - (force-mode-line-update) - (redraw-display) - (when (and (called-interactively-p 'interactive) - hidden-mode-line-mode) - (run-with-idle-timer - 0 nil 'message - (concat "Hidden Mode Line Mode enabled. " - "Use M-x hidden-mode-line-mode to make mode-line appear.")))) -#+END_SRC - -* ~use-package~ packages - -** GNU Globals - -#+BEGIN_SRC emacs-lisp -(defun gpolonkai/cond-enable-ggtags-mode () - (when (derived-mode-p 'c-mode 'c++-mode 'java-mode) - (ggtags-mode t))) - -(use-package ggtags - :hook - (c-mode-common . gpolonkai/cond-enable-ggtags-mode)) -#+END_SRC - -** Mailing with mu4e - -Due to my programming (and maybe a bit of OCD) needs, i set trailing whitespace to have a red -background so it stands out *a lot*. However, many emails contain a lot of trailing whitespace -which makes them really hard to read in Emacs. - -The below snippet creates a trailing whitespace face specific to mu4e view buffers. The -accompanying function will be added to ~mu4e-view-mode-hook~. - -#+BEGIN_SRC emacs-lisp +#+begin_src emacs-lisp (copy-face 'trailing-whitespace 'trailing-whitespace-mu4e) (set-face-attribute 'trailing-whitespace-mu4e nil :background 'unspecified) (defun gpolonkai/mu4e-trailing-whitespace-fix () (set (make-local-variable 'face-remapping-alist) '((trailing-whitespace trailing-whitespace-mu4e)))) -#+END_SRC +#+end_src -#+BEGIN_SRC emacs-lisp +** ~mu4e~ + +Now that’s out of the way, let’s configure mu4e itself. + +#+begin_src emacs-lisp (use-package mu4e :after vertico :ensure nil @@ -2551,9 +2507,9 @@ accompanying function will be added to ~mu4e-view-mode-hook~. ("m i" . mu4e~headers-jump-to-maildir) ("m c" . mu4e-compose-new) ("m s" . mu4e-headers-search))) -#+END_SRC +#+end_src -*** Also, some sendmail hacking +** ~sendmail~ #+begin_src emacs-lisp (use-package sendmail @@ -2565,6 +2521,73 @@ accompanying function will be added to ~mu4e-view-mode-hook~. (message-send-mail-function 'message-send-mail-with-sendmail)) #+end_src +** ~org-msg~ to write messages using Org-mode + +#+begin_src emacs-lisp +(use-package org-msg + :after mu4e + :defer t + :config + (org-msg-mode) + :custom + (org-msg-supported-mua '((sendmail-user-agent . "mu4e"))) + (org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil") + (org-msg-startup "hidestars indent inlineimages") + (org-msg-greeting-fmt "\nHello,\n\n") + (org-msg-greeting-fmt-mailto nil) + (org-msg-signature "\n\nBest,\n\n,#+begin_signature\n-- *Gergely Polonkai* \\\\\n,#+end_signature")) +#+end_src + +* Custom commands and functions + +** Frame manipulation + +*** Hidden modeline mode +:PROPERTIES: +:SOURCE: http://emacs-doctor.com/emacs-strip-tease.html +:END: + +To temporarily hide the mode line. + +#+BEGIN_SRC emacs-lisp +(defvar hidden-mode-line-mode nil) +(defvar hide-mode-line nil) + +(define-minor-mode hidden-mode-line-mode + "Minor mode to hide the mode-line in the current buffer." + :init-value nil + :global nil + :variable hidden-mode-line-mode + :group 'editing-basics + (if hidden-mode-line-mode + (setq hide-mode-line mode-line-format + mode-line-format nil) + (setq mode-line-format hide-mode-line + hide-mode-line nil)) + (force-mode-line-update) + (redraw-display) + (when (and (called-interactively-p 'interactive) + hidden-mode-line-mode) + (run-with-idle-timer + 0 nil 'message + (concat "Hidden Mode Line Mode enabled. " + "Use M-x hidden-mode-line-mode to make mode-line appear.")))) +#+END_SRC + +* ~use-package~ packages + +** GNU Globals + +#+BEGIN_SRC emacs-lisp +(defun gpolonkai/cond-enable-ggtags-mode () + (when (derived-mode-p 'c-mode 'c++-mode 'java-mode) + (ggtags-mode t))) + +(use-package ggtags + :hook + (c-mode-common . gpolonkai/cond-enable-ggtags-mode)) +#+END_SRC + ** Kubernetes dashboard #+BEGIN_SRC emacs-lisp @@ -2883,25 +2906,6 @@ Because that’s still my favourite language. (use-package flycheck-pkg-config) #+END_SRC -* Org mode - -** Write messages with Org-mode - -#+BEGIN_SRC emacs-lisp -(use-package org-msg - :after mu4e - :defer t - :config - (org-msg-mode) - :custom - (org-msg-supported-mua '((sendmail-user-agent . "mu4e"))) - (org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil") - (org-msg-startup "hidestars indent inlineimages") - (org-msg-greeting-fmt "\nHello,\n\n") - (org-msg-greeting-fmt-mailto nil) - (org-msg-signature "\n\nBest,\n\n,#+begin_signature\n-- *Gergely Polonkai* \\\\\n,#+end_signature")) -#+END_SRC - * Mode specific ~use-package~ calls ** JavaScript