From e2594671af9056b4da13a64646211ebc71c3879d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 13 Sep 2018 22:05:05 -0700 Subject: [PATCH] Move all configuration from org to elisp files --- emacs/.emacs.d/init/oni-circe-init.el | 105 +++++++++++++++++++ emacs/.emacs.d/init/oni-circe-init.org | 123 ----------------------- emacs/.emacs.d/init/oni-company-init.org | 22 ---- emacs/.emacs.d/init/oni-dired-init.el | 46 +++++++++ emacs/.emacs.d/init/oni-dired-init.org | 43 -------- emacs/.emacs.d/init/oni-ediff-init.el | 49 +++++++++ emacs/.emacs.d/init/oni-ediff-init.org | 41 -------- emacs/.emacs.d/init/oni-java-init.el | 37 +++++++ emacs/.emacs.d/init/oni-java-init.org | 24 ----- emacs/.emacs.d/init/oni-magit-init.el | 43 ++++++++ emacs/.emacs.d/init/oni-magit-init.org | 37 ------- emacs/.emacs.d/init/oni-shr-init.el | 39 +++++++ emacs/.emacs.d/init/oni-shr-init.org | 28 ------ emacs/.emacs.d/init/oni-slack-init.el | 42 ++++++++ emacs/.emacs.d/init/oni-slack-init.org | 30 ------ 15 files changed, 361 insertions(+), 348 deletions(-) create mode 100644 emacs/.emacs.d/init/oni-circe-init.el delete mode 100644 emacs/.emacs.d/init/oni-circe-init.org delete mode 100644 emacs/.emacs.d/init/oni-company-init.org create mode 100644 emacs/.emacs.d/init/oni-dired-init.el delete mode 100644 emacs/.emacs.d/init/oni-dired-init.org create mode 100644 emacs/.emacs.d/init/oni-ediff-init.el delete mode 100644 emacs/.emacs.d/init/oni-ediff-init.org create mode 100644 emacs/.emacs.d/init/oni-java-init.el delete mode 100644 emacs/.emacs.d/init/oni-java-init.org create mode 100644 emacs/.emacs.d/init/oni-magit-init.el delete mode 100644 emacs/.emacs.d/init/oni-magit-init.org create mode 100644 emacs/.emacs.d/init/oni-shr-init.el delete mode 100644 emacs/.emacs.d/init/oni-shr-init.org create mode 100644 emacs/.emacs.d/init/oni-slack-init.el delete mode 100644 emacs/.emacs.d/init/oni-slack-init.org diff --git a/emacs/.emacs.d/init/oni-circe-init.el b/emacs/.emacs.d/init/oni-circe-init.el new file mode 100644 index 0000000..27484cc --- /dev/null +++ b/emacs/.emacs.d/init/oni-circe-init.el @@ -0,0 +1,105 @@ +;;; oni-circe-init.el --- My Circe configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My Circe configuration + +;;; Code: + +(require 'circe) +(require 'circe-color-nicks) +(require 'circe-serenity) +(require 'oni-circe) +;(require 'mowedline) + +(add-to-list 'circe-network-options + `("Freenode" + :nick "ryuslash" + :channels ("#mowedline" + "#ninthfloor" + "#dispass" + "#linuxvoice" + "#conkeror" + "#emacs-circe" + "#chicken" + :after-auth + "#emacs") + :nickserv-password + ,(oni-circe-get-password-for "irc.freenode.net"))) + +(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)) + +(enable-circe-color-nicks) + +(enable-circe-serenity) + +(defun mowedline-colorize-mode-line-spec (s) + (cond + ((stringp s) (string-trim s)) + ((eq ':propertize (car s)) + (let ((s (cadr s)) + (face (plist-get (cddr s) 'face))) + (if face + `(color ,(face-foreground face) + ,(substring-no-properties s)) + s))) + (t ""))) + +;(setq mowedline-update-function 'mowedline-update/dbus) + +(defvar jjf-tracking-buffers '()) +(defvar jjf-external-tracking-timer nil) +(defun jjf-external-tracking () + (setq jjf-external-tracking-timer nil) + (mowedline-update + 'irc + (if (stringp jjf-tracking-buffers) + (mowedline-colorize jjf-tracking-buffers t) + (format "%S" (mapcar #'mowedline-colorize-mode-line-spec + jjf-tracking-buffers))))) + +(defun oni:clear-irc-mowedline-widget () + (mowedline-clear 'irc)) + +(defun jjf-external-tracking-advice (orig-fun &rest args) + "Update my external status bar when tracking computes a new +status line, and suppress tracking in the mode-line. Since +tracking-status may be called many times in quick succession, for +example on a make-frame-visible event, we use a short timer to +only call the updater once within a minimum duration." + (setq jjf-tracking-buffers (apply orig-fun args)) + (when jjf-external-tracking-timer + (cancel-timer jjf-external-tracking-timer)) + (setq jjf-external-tracking-timer + (run-at-time 0.2 nil 'jjf-external-tracking)) + nil) + +;(advice-add 'tracking-status :around #'jjf-external-tracking-advice) +;(add-hook 'kill-emacs-hook 'oni:clear-irc-mowedline-widget) + +(provide 'oni-circe-init) +;;; oni-circe-init.el ends here diff --git a/emacs/.emacs.d/init/oni-circe-init.org b/emacs/.emacs.d/init/oni-circe-init.org deleted file mode 100644 index 929e06e..0000000 --- a/emacs/.emacs.d/init/oni-circe-init.org +++ /dev/null @@ -1,123 +0,0 @@ -#+TITLE: Circe config - -#+BEGIN_SRC emacs-lisp - (require 'circe) - (require 'circe-color-nicks) - (require 'circe-serenity) - (require 'oni-circe) - (require 'mowedline) -#+END_SRC - -I switched to Circe from ERC because I couldn't make the -customizations I wanted to, Circe seems much better at this. - -I spend most of my time on IRC on Freenode. - -#+BEGIN_SRC emacs-lisp -r -l ";(ref:%s)" - (add-to-list 'circe-network-options - `("Freenode" - :nick "ryuslash" - :channels ("#mowedline" - "#ninthfloor" - "#dispass" - "#linuxvoice" - "#conkeror" - "#emacs-circe" - "#chicken" - :after-auth ;(ref:aauth) - "#emacs") - :nickserv-password - ,(oni-circe-get-password-for "irc.freenode.net"))) -#+END_SRC - -The [[(aauth)][:after-auth]] keyword is used to specify that the =#emacs= channel -should only be joined once the authentication with NickServ has -finished. This has apparently become a requirement. - -Sometimes I watch some Twitch streams as well. - -#+BEGIN_SRC emacs-lisp - (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 - (enable-circe-color-nicks) -#+END_SRC - -Align all nicks and generally clean up the buffer. I call it: Circe -Serenity. - -#+BEGIN_SRC emacs-lisp - (enable-circe-serenity) -#+END_SRC - -Add external tracking. Show the status of tracked buffers in -mowedline instead in the mode-line. With color! - -This code has been generously donated by [[http://retroj.net][retroj]], the author of -mowedline. - -First define a function to parse the text properties from the tracking -buffers list so that highlights (from mentions) also appear in -mowedline. - -#+BEGIN_SRC emacs-lisp - (defun mowedline-colorize-mode-line-spec (s) - (cond - ((stringp s) (string-trim s)) - ((eq ':propertize (car s)) - (let ((s (cadr s)) - (face (plist-get (cddr s) 'face))) - (if face - `(color ,(face-foreground face) - ,(substring-no-properties s)) - s))) - (t ""))) -#+END_SRC - -Also tell mowedline to use the dbus interface directly, instead of -going through the command-line interface. - -#+BEGIN_SRC emacs-lisp - (setq mowedline-update-function 'mowedline-update/dbus) -#+END_SRC - -#+BEGIN_SRC emacs-lisp - (defvar jjf-tracking-buffers '()) - (defvar jjf-external-tracking-timer nil) - (defun jjf-external-tracking () - (setq jjf-external-tracking-timer nil) - (mowedline-update - 'irc - (if (stringp jjf-tracking-buffers) - (mowedline-colorize jjf-tracking-buffers t) - (format "%S" (mapcar #'mowedline-colorize-mode-line-spec - jjf-tracking-buffers))))) - - (defun oni:clear-irc-mowedline-widget () - (mowedline-clear 'irc)) - - (defun jjf-external-tracking-advice (orig-fun &rest args) - "Update my external status bar when tracking computes a new - status line, and suppress tracking in the mode-line. Since - tracking-status may be called many times in quick succession, for - example on a make-frame-visible event, we use a short timer to - only call the updater once within a minimum duration." - (setq jjf-tracking-buffers (apply orig-fun args)) - (when jjf-external-tracking-timer - (cancel-timer jjf-external-tracking-timer)) - (setq jjf-external-tracking-timer - (run-at-time 0.2 nil 'jjf-external-tracking)) - nil) - - (advice-add 'tracking-status :around #'jjf-external-tracking-advice) - (add-hook 'kill-emacs-hook 'oni:clear-irc-mowedline-widget) -#+END_SRC diff --git a/emacs/.emacs.d/init/oni-company-init.org b/emacs/.emacs.d/init/oni-company-init.org deleted file mode 100644 index 343a215..0000000 --- a/emacs/.emacs.d/init/oni-company-init.org +++ /dev/null @@ -1,22 +0,0 @@ -#+TITLE: Company mode configuration - -#+BEGIN_SRC emacs-lisp - (require 'company) - (require 'diminish) -#+END_SRC - -Don't show that company mode is enabled in the minibuffer. - -#+BEGIN_SRC emacs-lisp - (diminish 'company-mode) -#+END_SRC - -Show a tooltip when there is more than one completion, show the -documentation for a symbol in the echo area and always show a preview. - -#+BEGIN_SRC emacs-lisp - (setq company-frontends - '(company-pseudo-tooltip-unless-just-one-frontend - company-echo-metadata-frontend - company-preview-frontend)) -#+END_SRC diff --git a/emacs/.emacs.d/init/oni-dired-init.el b/emacs/.emacs.d/init/oni-dired-init.el new file mode 100644 index 0000000..d3bedf9 --- /dev/null +++ b/emacs/.emacs.d/init/oni-dired-init.el @@ -0,0 +1,46 @@ +;;; oni-dired-init.el --- My Dired configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My dired configuration. + +;;; Code: + +(require 'dired) +(require 'dired-x) + +(defun oni:dired-add-wdired-keybinding () + "Add a keybinding for wdired mode." + (define-key dired-mode-map (kbd "E") 'wdired-change-to-wdired-mode)) + +(setq dired-listing-switches "-alh") +(setq dired-subdir-switches "-Alh") + +(add-hook 'dired-mode-hook 'oni:dired-add-wdired-keybinding) + +(add-to-list 'dired-guess-shell-alist-user + `(,(rx ".pdf" eos) "zathura")) + +(add-to-list 'dired-guess-shell-alist-user + `(,(rx (or ".jpg" ".jpeg" ".png" ".gif") eos) "feh")) + +(provide 'oni-dired-init) +;;; oni-dired-init.el ends here diff --git a/emacs/.emacs.d/init/oni-dired-init.org b/emacs/.emacs.d/init/oni-dired-init.org deleted file mode 100644 index 8966d71..0000000 --- a/emacs/.emacs.d/init/oni-dired-init.org +++ /dev/null @@ -1,43 +0,0 @@ -#+TITLE: Dired - -#+BEGIN_SRC emacs-lisp - (require 'dired) - (require 'dired-x) -#+END_SRC - -Show human-readable sizes in dired buffers. - -#+BEGIN_SRC emacs-lisp - (setq dired-listing-switches "-alh") -#+END_SRC - -Show the same info for subdirectories, but don't show the =.= and =..= -directories, since those are most likely already shown in the buffer. - -#+BEGIN_SRC emacs-lisp - (setq dired-subdir-switches "-Alh") -#+END_SRC - -Add a keybinding to dired buffers to change to wdired. - -#+BEGIN_SRC emacs-lisp - (defun oni:dired-add-wdired-keybinding () - "Add a keybinding for wdired mode." - (define-key dired-mode-map (kbd "E") 'wdired-change-to-wdired-mode)) - - (add-hook 'dired-mode-hook 'oni:dired-add-wdired-keybinding) -#+END_SRC - -Open PDF files in zathura. - -#+BEGIN_SRC emacs-lisp - (add-to-list 'dired-guess-shell-alist-user - `(,(rx ".pdf" eos) "zathura")) -#+END_SRC - -Open Jpeg, Gif and PNG files in feh. - -#+BEGIN_SRC emacs-lisp - (add-to-list 'dired-guess-shell-alist-user - `(,(rx (or ".jpg" ".jpeg" ".png" ".gif") eos) "feh")) -#+END_SRC diff --git a/emacs/.emacs.d/init/oni-ediff-init.el b/emacs/.emacs.d/init/oni-ediff-init.el new file mode 100644 index 0000000..9d91bcc --- /dev/null +++ b/emacs/.emacs.d/init/oni-ediff-init.el @@ -0,0 +1,49 @@ +;;; oni-ediff-init.el --- My Ediff configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My Ediff configuration. + +;;; Code: + +(require 'ediff) + +(setq ediff-window-setup-function 'ediff-setup-windows-plain) + +(setq ediff-split-window-function 'split-window-horizontally) + +(setq ediff-diff-options "-w") + +(defun oni:turn-on-fullscreen () + (unless (memq (frame-parameter nil 'fullscreen) + '(fullscreen fullboth)) + (set-frame-parameter nil 'fullscreen 'fullboth))) + +(defun oni:turn-off-fullscreen () + (when (memq (frame-parameter nil 'fullscreen) + '(fullscreen fullboth)) + (set-frame-parameter nil 'fullscreen nil))) + +(add-hook 'ediff-mode-hook 'oni:turn-on-fullscreen) +(add-hook 'ediff-cleanup-hook 'oni:turn-off-fullscreen) + +(provide 'oni-ediff-init) +;;; oni-ediff-init.el ends here diff --git a/emacs/.emacs.d/init/oni-ediff-init.org b/emacs/.emacs.d/init/oni-ediff-init.org deleted file mode 100644 index 588a605..0000000 --- a/emacs/.emacs.d/init/oni-ediff-init.org +++ /dev/null @@ -1,41 +0,0 @@ -#+TITLE: Ediff - -#+BEGIN_SRC emacs-lisp - (require 'ediff) -#+END_SRC - -Don't use a special frame for the ediff control buffer. - -#+BEGIN_SRC emacs-lisp - (setq ediff-window-setup-function 'ediff-setup-windows-plain) -#+END_SRC - -Show the different buffers next to eachother instead of underneath -eachother. - -#+BEGIN_SRC emacs-lisp - (setq ediff-split-window-function 'split-window-horizontally) -#+END_SRC - -Don't show whitespace changes in ediff buffers. - -#+BEGIN_SRC emacs-lisp - (setq ediff-diff-options "-w") -#+END_SRC - -Show ediff in a fullscreen frame. - -#+BEGIN_SRC emacs-lisp - (defun oni:turn-on-fullscreen () - (unless (memq (frame-parameter nil 'fullscreen) - '(fullscreen fullboth)) - (set-frame-parameter nil 'fullscreen 'fullboth))) - - (defun oni:turn-off-fullscreen () - (when (memq (frame-parameter nil 'fullscreen) - '(fullscreen fullboth)) - (set-frame-parameter nil 'fullscreen nil))) - - (add-hook 'ediff-mode-hook 'oni:turn-on-fullscreen) - (add-hook 'ediff-cleanup-hook 'oni:turn-off-fullscreen) -#+END_SRC diff --git a/emacs/.emacs.d/init/oni-java-init.el b/emacs/.emacs.d/init/oni-java-init.el new file mode 100644 index 0000000..782e195 --- /dev/null +++ b/emacs/.emacs.d/init/oni-java-init.el @@ -0,0 +1,37 @@ +;;; oni-java-init.el --- My java-mode configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My `java-mode' configuration. + +;;; Code: + +(add-hook 'java-mode-hook 'electric-pair-local-mode) + +(add-hook 'java-mode-hook 'electric-indent-local-mode) + +(with-eval-after-load 'jdee-bsh + (setq jdee-server-dir "~/usr/share/java/jdee/")) + +(add-hook 'java-mode-hook 'fci-mode) + +(provide 'oni-java-init) +;;; oni-java-init.el ends here diff --git a/emacs/.emacs.d/init/oni-java-init.org b/emacs/.emacs.d/init/oni-java-init.org deleted file mode 100644 index c18a1a4..0000000 --- a/emacs/.emacs.d/init/oni-java-init.org +++ /dev/null @@ -1,24 +0,0 @@ -Enable electric pair mode - -#+BEGIN_SRC emacs-lisp - (add-hook 'java-mode-hook 'electric-pair-local-mode) -#+END_SRC - -Enable electric indent mode - -#+BEGIN_SRC emacs-lisp - (add-hook 'java-mode-hook 'electric-indent-local-mode) -#+END_SRC - -Configure the JDEE server - -#+BEGIN_SRC emacs-lisp - (with-eval-after-load 'jdee-bsh - (setq jdee-server-dir "~/usr/share/java/jdee/")) -#+END_SRC - -Enable fill column indicator - -#+BEGIN_SRC emacs-lisp - (add-hook 'java-mode-hook 'fci-mode) -#+END_SRC diff --git a/emacs/.emacs.d/init/oni-magit-init.el b/emacs/.emacs.d/init/oni-magit-init.el new file mode 100644 index 0000000..17f50da --- /dev/null +++ b/emacs/.emacs.d/init/oni-magit-init.el @@ -0,0 +1,43 @@ +;;; oni-magit-init.el --- My magit configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My magit configuration. + +;;; Code: + +(require 'magit) +(require 'magithub) + +(setq magit-diff-refine-hunk 'all) + +(defvar oni:magit-status-rx + (rx bos "*magit: ")) + +(defun oni:display-buffer-in-only-window (buffer alist) + (delete-other-windows) + (display-buffer-same-window buffer alist)) + +(add-to-list 'display-buffer-alist + `(,oni:magit-status-rx oni:display-buffer-in-only-window)) + +(provide 'oni-magit-init) +;;; oni-magit-init.el ends here diff --git a/emacs/.emacs.d/init/oni-magit-init.org b/emacs/.emacs.d/init/oni-magit-init.org deleted file mode 100644 index 7981a77..0000000 --- a/emacs/.emacs.d/init/oni-magit-init.org +++ /dev/null @@ -1,37 +0,0 @@ -#+TITLE: Magit - -#+BEGIN_SRC emacs-lisp - (require 'magit) -#+END_SRC - -Magit is a very nice interface to Git for Emacs. It allows you to do -just about anything with Git without leaving the comfort of your Emacs -session. - -Integrate github issues and pull requests in Magit. Requires the =hub= -executable. - -#+BEGIN_SRC emacs-lisp - (require 'magithub) -#+END_SRC - -Show refined diffs in magit. This makes it much easier to see /what/ -has changed on a line. - -#+BEGIN_SRC emacs-lisp - (setq magit-diff-refine-hunk 'all) -#+END_SRC - -Make the magit status buffer always open as the only window in Emacs. - -#+BEGIN_SRC emacs-lisp - (defvar oni:magit-status-rx - (rx bos "*magit: ")) - - (defun oni:display-buffer-in-only-window (buffer alist) - (delete-other-windows) - (display-buffer-same-window buffer alist)) - - (add-to-list 'display-buffer-alist - `(,oni:magit-status-rx oni:display-buffer-in-only-window)) -#+END_SRC diff --git a/emacs/.emacs.d/init/oni-shr-init.el b/emacs/.emacs.d/init/oni-shr-init.el new file mode 100644 index 0000000..3345dd9 --- /dev/null +++ b/emacs/.emacs.d/init/oni-shr-init.el @@ -0,0 +1,39 @@ +;;; oni-shr-init.el --- My shr configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My shr configuration. + +;;; Code: + +(require 'shr) + +(defun oni:shr-colorize-remove-last-arg (args) + "If ARGS has more than 3 items, remove the last one." + (if (> (length args) 3) + (butlast args) + args)) + +(advice-add #'shr-colorize-region :filter-args + #'oni:shr-colorize-remove-last-arg) + +(provide 'oni-shr-init) +;;; oni-shr-init.el ends here diff --git a/emacs/.emacs.d/init/oni-shr-init.org b/emacs/.emacs.d/init/oni-shr-init.org deleted file mode 100644 index 3aa8626..0000000 --- a/emacs/.emacs.d/init/oni-shr-init.org +++ /dev/null @@ -1,28 +0,0 @@ -#+TITLE: shr configuration - -#+BEGIN_SRC emacs-lisp - (require 'shr) -#+END_SRC - -* Remove background colors - - Define a procedure that removes the last argument it gets if there - are more than 3. - - #+BEGIN_SRC emacs-lisp - (defun oni:shr-colorize-remove-last-arg (args) - "If ARGS has more than 3 items, remove the last one." - (if (> (length args) 3) - (butlast args) - args)) - #+END_SRC - - Add the function as a filter-args advice to - =shr-colorize-region=. The last (fourth) argument to that function - is the background color to use, it's optional, so removing it - effectively stops shr from adding background colors. - - #+BEGIN_SRC emacs-lisp - (advice-add #'shr-colorize-region :filter-args - #'oni:shr-colorize-remove-last-arg) - #+END_SRC diff --git a/emacs/.emacs.d/init/oni-slack-init.el b/emacs/.emacs.d/init/oni-slack-init.el new file mode 100644 index 0000000..ac7015c --- /dev/null +++ b/emacs/.emacs.d/init/oni-slack-init.el @@ -0,0 +1,42 @@ +;;; oni-slack-init.el --- My Slack configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My Slack configuration. + +;;; Code: + +(require 'slack) + +(setq slack-prefer-current-team t) + +(setq slack-buffer-function 'switch-to-buffer) + +(slack-register-team :name "Picturefix" + :default t + :client-id oni:slack-client-id + :client-secret oni:slack-client-secret + :token oni:slack-token + :subscribed-channels + '(general picturefix random shirtlobby)) + +(provide 'oni-slack-init) +;;; oni-slack-init.el ends here diff --git a/emacs/.emacs.d/init/oni-slack-init.org b/emacs/.emacs.d/init/oni-slack-init.org deleted file mode 100644 index 097a388..0000000 --- a/emacs/.emacs.d/init/oni-slack-init.org +++ /dev/null @@ -1,30 +0,0 @@ -#+TITLE: Slack configuration - -#+BEGIN_SRC emacs-lisp - (require 'slack) -#+END_SRC - -Use the current team for most interactive commands. - -#+BEGIN_SRC emacs-lisp - (setq slack-prefer-current-team t) -#+END_SRC - -Use the regular =switch-to-buffer= so slack doesn't create a new -window every time I open a channel. - -#+BEGIN_SRC emacs-lisp - (setq slack-buffer-function 'switch-to-buffer) -#+END_SRC - -Register my work team. - -#+BEGIN_SRC emacs-lisp - (slack-register-team :name "Picturefix" - :default t - :client-id oni:slack-client-id - :client-secret oni:slack-client-secret - :token oni:slack-token - :subscribed-channels - '(general picturefix random shirtlobby)) -#+END_SRC