#+TITLE: mms Emacs Config - Misc #+AUTHOR: MichaƂ Sapka (https://michal.sapka.me) #+STARTUP: showall indent logdone #+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ #+HUGO_WEIGHT: 400 #+HUGO_SECTION: emacs/config #+HUGO_CATEGORIES: emacs emacs-config #+HUGO_MENU :menu "emacs-config" :name "Miscellaneous" #+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - miscellaneous onfig" #+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "mastodon and email" #+EXPORT_FILE_NAME: misc * Intro Why not do some other cool things inside Emacs? Those configs here are very rudementaty, and a work-in-progress. * Mastodon I use mastodon (use can find me on [[https://emacs.ch/@mms][emacs.ch]]). Why not use it in Emacs? I need to add dedicated config for keybindings. #+begin_src emacs-lisp (use-package mastodon :ensure t :config (setq mastodon-instance-url "https://emacs.ch" mastodon-active-user "mms") ) #+end_src * Email Oh email, how I love you! ** Reading I use notmuch as my MUA. You can find my guide on my [[https://michal.sapka.me/emacs/notmuch/][emacs site]]. #+BEGIN_SRC emacs-lisp (use-package notmuch :commands notmuch-hello :config (setq notmuch-search-oldest-first nil notmuch-search-line-faces '(("gh-pr-todo" . ((t :foreground "#f77"))))) ) #+END_SRC #+begin_src emacs-lisp (mms-leader-keys "m m" '(lambda () (interactive) (notmuch-hello) :wk "Notmuch hello")) #+end_src ** composing I use =msmtp= for email sendout. In near future I'll move to =mstmtp-queue=, but for now I need basic setup. I set up =mms-email-address= in my config_local.el, as it changes between machines and is private #+begin_src emacs-lisp (setq send-mail-function 'sendmail-send-it user-mail-address mms-email-address sendmail-program "/usr/local/bin/msmtp" mail-specify-envelope-from t message-sendmail-envelope-from 'header mail-envelope-from 'header) #+end_src #+begin_src emacs-lisp (setq mail-default-headers (concat "BCC: " mms-email-address)) #+end_src #+begin_src emacs-lisp (mms-leader-keys "m c" '(lambda () (interactive) (compose-mail) :wk "compose email")) #+end_src * Jabber I self-host an XMPP server for my family. Of course I want to have it inside Emacs! #+begin_src emacs-lisp (use-package fsm :ensure t) (use-package srv :ensure t) (use-package jabber :after '(fsm srv) :ensure t) #+end_src * Demos #+begin_src emacs-lisp (use-package demo-it :ensure t) #+end_src * Open links First, let's be able to run Youtube inside emacs #+begin_src emacs-lisp (use-package yeetube :general (:states 'normal :keymaps 'yeetube-mode-map "RET" 'yeetube-play "d" 'yeetube-download-video "b" 'yeetube-play-saved-video "B" 'yeetube-save-video "x" 'yeetube-remove-saved-video "/" 'yeetube-search "0" 'yeetube-toggle-video )) #+end_src Then, let's create linkhandler to pass the link to the correct handler. #+begin_src emacs-lisp (defun mms-open-link-under-point () (interactive) (let (url) (setq url (thing-at-point 'url)) (cond ((string-match "youtube.com" url) (yeetube-search url)) (t (eww url))) ) ) #+end_src #+RESULTS: : mms-open-link-under-point And I want to have as =leader - enter - enter= #+begin_src emacs-lisp (mms-leader-keys "RET RET" '(lambda () (interactive) (mms-open-link-under-point) :wk "follow link")) #+end_src * Music player ** EMMS I listen to local files, so I want to control it in Emacs. #+begin_src emacs-lisp (use-package emms :config (emms-all) (setq emms-player-list '(emms-player-mpv) emms-info-functions '(emms-info-native)) ) (mms-leader-keys "p p" '(lambda () (interactive) (emms-pause) :wk "Pause") "p e" '(lambda () (interactive) (emms) :wk "Emms") ) #+end_src ** Listen #+begin_src emacs-lisp (use-package listen :ensure t) #+end_src #+RESULTS: : [nil 26173 8423 527702 nil elpaca-process-queues nil nil 696999 nil] * Gnus Yeah, I'm trying it. #+begin_src emacs-lisp (use-package gnus :ensure nil :config (setq gnus-select-method '(nntp "news.gwene.org")) ;; Read feeds/atom through gwene (setq gnus-summary-line-format "%U%R%z%d %I%(%[ %F %] %s %)\n")) (mms-leader-keys "o g" '(lambda () (interactive) (gnus) :wk "Gnus")) #+end_src