From a6b55e023154254363d8c98482c635fbd6d78cd5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 4 Sep 2020 18:25:56 -0500 Subject: Setup circe --- init.el | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/init.el b/init.el index 8aca951..e471f5d 100644 --- a/init.el +++ b/init.el @@ -378,3 +378,73 @@ (use-package rainbow-mode :hook (prog-mode . rainbow-mode)) + +(defun my/fetch-password (&rest params) + "Fetch a password from auth-sources" + (require 'auth-source) + (let ((match (car (apply 'auth-source-search params)))) + (if match + (let ((secret (plist-get match :secret))) + (if (functionp secret) + (funcall secret) + secret)) + (error "Password not found for %S" params)))) + +(defun my/sasl-password (nick server) + "Fetch a password for $server and $nick" + (my/fetch-password :user nick :host server)) + +(use-package circe + :init + (require 'lui-autopaste) + (defun my/circe-prompt () + (lui-set-prompt + (concat (propertize (concat (buffer-name) ">") + 'face 'circe-prompt-face) + " "))) + (defun my/lui-setup () + (setq right-margin-width 5 + fringes-outside-margins t + word-wrap t + wrap-prefix " ") + (setf (cdr (assoc 'continuation fringe-indicator-alist)) nil)) + :hook + (circe-channel-mode . enable-lui-autopaste) + (circe-chat-mode-hook . my/circe-prompt) + (lui-mode-hook . my/circe-set-margin) + :custom + (circe-reduce-lurker-spam t) + (circe-format-say "{nick:-16s} {body}") + (lui-time-stamp-position 'right-margin) + (lui-fill-type nil) + (lui-time-stamp-format "%H:%M") + (lui-track-bar-behavior 'before-switch-to-buffer) + (circe-network-options + `(("Freenode" + :tls t + :port 6697 + :nick "acdw" + :sasl-username "acdw" + :sasl-password ,(my/sasl-password "acdw" "irc.freenode.net") + :channels ("#emacs" "#daydreams")) + ("Tilde.chat" + :tls t + :port 6697 + :nick "acdw" + :sasl-username "acdw" + :sasl-password ,(my/sasl-password "acdw" "irc.tilde.chat") + :channels ("#gemini" "#meta")))) + :custom-face + (circe-my-message-face ((t (:foreground "dark violet")))) + :config + (enable-lui-track-bar)) + +;; elfeed +(use-package elfeed + :custom + (elfeed-feeds + '("https://planet.emacslife.com/atom.xml"))) + +(use-package smartparens + :config + (smartparens-global-mode)) -- cgit 1.4.1-21-gabe81