Move mailing related configuration to its own section

This commit is contained in:
Gergely Polonkai 2023-10-20 08:40:34 +02:00
parent c058cfe853
commit 02fe027e61
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4

View File

@ -2413,75 +2413,31 @@ directory. It is available from [[http://plantuml.com/download][here]].
:after org) :after org)
#+end_src #+end_src
* Custom commands and functions * Mailing
** Frame manipulation ** Set up whitespace handling in mu4e buffers
*** Hidden modeline mode Due to my programming (and maybe a bit of OCD) needs, i set trailing whitespace
:PROPERTIES: to have a red background so it stands out *a lot*. However, many emails contain
:SOURCE: http://emacs-doctor.com/emacs-strip-tease.html a lot of trailing whitespace which makes them really hard to read in Emacs.
:END:
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 #+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
(copy-face 'trailing-whitespace 'trailing-whitespace-mu4e) (copy-face 'trailing-whitespace 'trailing-whitespace-mu4e)
(set-face-attribute 'trailing-whitespace-mu4e nil :background 'unspecified) (set-face-attribute 'trailing-whitespace-mu4e nil :background 'unspecified)
(defun gpolonkai/mu4e-trailing-whitespace-fix () (defun gpolonkai/mu4e-trailing-whitespace-fix ()
(set (make-local-variable 'face-remapping-alist) (set (make-local-variable 'face-remapping-alist)
'((trailing-whitespace trailing-whitespace-mu4e)))) '((trailing-whitespace trailing-whitespace-mu4e))))
#+END_SRC #+end_src
#+BEGIN_SRC emacs-lisp ** ~mu4e~
Now thats out of the way, lets configure mu4e itself.
#+begin_src emacs-lisp
(use-package mu4e (use-package mu4e
:after vertico :after vertico
:ensure nil :ensure nil
@ -2551,9 +2507,9 @@ accompanying function will be added to ~mu4e-view-mode-hook~.
("m i" . mu4e~headers-jump-to-maildir) ("m i" . mu4e~headers-jump-to-maildir)
("m c" . mu4e-compose-new) ("m c" . mu4e-compose-new)
("m s" . mu4e-headers-search))) ("m s" . mu4e-headers-search)))
#+END_SRC #+end_src
*** Also, some sendmail hacking ** ~sendmail~
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package sendmail (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)) (message-send-mail-function 'message-send-mail-with-sendmail))
#+end_src #+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 ** Kubernetes dashboard
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -2883,25 +2906,6 @@ Because thats still my favourite language.
(use-package flycheck-pkg-config) (use-package flycheck-pkg-config)
#+END_SRC #+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 * Mode specific ~use-package~ calls
** JavaScript ** JavaScript