diff options
Diffstat (limited to 'emacs/.emacs.d/init.org')
-rw-r--r-- | emacs/.emacs.d/init.org | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index a5a7ee5..95c89b5 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -561,6 +561,133 @@ To start off, first I need to enable lexical binding. '("-a" "picturefix")))))) #+END_SRC +** Linewise user-interface + + This is the library used by Circe and Slack to display messages. + + #+BEGIN_SRC emacs-lisp + (eval-when-compile (require 'lui)) + #+END_SRC + + Put the time stamp in lui buffers in the right margin. This gives + the text some extra room. + + #+BEGIN_SRC emacs-lisp + (with-eval-after-load 'lui + (setq lui-time-stamp-position 'right-margin)) + #+END_SRC + + Remove the "[]" from the time stamp, it's not really necessary. + + #+BEGIN_SRC emacs-lisp + (with-eval-after-load 'lui + (setq lui-time-stamp-format "%H:%M")) + #+END_SRC + + Give the right margin just enough room to show the time-stamps, no + more, no less. + + #+BEGIN_SRC emacs-lisp + (defun oni:set-circe-margin-width () + (setq right-margin-width 5)) + + (add-hook 'lui-mode-hook #'oni:set-circe-margin-width) + #+END_SRC + + Fix the wrap prefix so that text at the prompt is aligned properly. + + #+BEGIN_SRC emacs-lisp + (defun oni:set-lui-prompt-wrap-prefix () + (setq wrap-prefix " ")) + + (add-hook 'lui-mode-hook #'oni:set-lui-prompt-wrap-prefix) + #+END_SRC + + Enable visual line mode in lui buffers so my text doesn't go + off-screen. + + #+BEGIN_SRC emacs-lisp + (add-hook 'lui-mode-hook 'visual-line-mode) + #+END_SRC + +** Circe + + I switched to Circe from ERC because I couldn't make the + customizations I wanted to, Circe seems much better at this. + + #+BEGIN_SRC emacs-lisp + (ensure-library circe) + #+END_SRC + + I prefer storing my passwords in a GPG encrypted authinfo + file. Circe doesn't look at this out-of-the-box, but it's easy + enough to get this. This function returns a function that will get + a stored password for the given host. + + #+BEGIN_SRC emacs-lisp + (defun oni:circe-get-password-for (host) + (lambda (_) + (let ((found (nth 0 (auth-source-search :max 1 + :host host + :require '(:secret))))) + (when found + (let ((secret (plist-get found :secret))) + (if (functionp secret) + (funcall secret) + secret)))))) + #+END_SRC + + I spend most of my time on IRC on Freenode. + + #+BEGIN_SRC emacs-lisp + (eval-when-compile (require 'circe)) + + (with-eval-after-load 'circe + (add-to-list 'circe-network-options + `("Freenode" + :nick "ryuslash" + :channels ("#emacs" + "#mowedline" + "#ninthfloor" + "#dispass" + "#linuxvoice" + "#conkeror") + :nickserv-password + ,(oni:circe-get-password-for "irc.freenode.net")))) + #+END_SRC + + Sometimes I watch some Twitch streams as well. + + #+BEGIN_SRC emacs-lisp + (with-eval-after-load 'circe + (add-to-list 'circe-network-options + `("Twitch" + :use-tls nil + :nick "ryuslash" + :host "irc.twitch.tv" + :pass ,(oni:circe-get-password-for "irc.twitch.tv") + :port 6667))) + #+END_SRC + + Enable coloring of nicks. + + #+BEGIN_SRC emacs-lisp + (with-eval-after-load 'circe + (require 'circe-color-nicks) + (enable-circe-color-nicks)) + #+END_SRC + + Align all nicks. + + #+BEGIN_SRC emacs-lisp + (ensure-library circe-aligned-nicks + :path "vendor-lisp/circe-aligned-nicks") + + (with-eval-after-load 'circe + (require 'circe-aligned-nicks) + (enable-circe-aligned-nicks)) + #+END_SRC + * Custom Put the customize settings in a different file so that Emacs doesn't |