From 1a84025699fdd5f5931b574f5210eab431516abc Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 15 Nov 2016 17:28:35 +0100 Subject: Add compilation mode config --- emacs/.emacs.d/init/oni-compilation-init.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 emacs/.emacs.d/init/oni-compilation-init.org (limited to 'emacs/.emacs.d/init') diff --git a/emacs/.emacs.d/init/oni-compilation-init.org b/emacs/.emacs.d/init/oni-compilation-init.org new file mode 100644 index 0000000..2813654 --- /dev/null +++ b/emacs/.emacs.d/init/oni-compilation-init.org @@ -0,0 +1,21 @@ +#+TITLE: Compilation mode configuration + +Scroll output in compilation mode. + +#+BEGIN_SRC emacs-lisp + (setq compilation-scroll-output t) +#+END_SRC + +Show compilation buffers in a side window. + +#+BEGIN_SRC emacs-lisp + (add-to-list 'display-buffer-alist + `(,(rx bos "*compilation*" eos) + display-buffer-in-side-window)) +#+END_SRC + +Bury compilation buffers on successful compilation. + +#+BEGIN_SRC emacs-lisp + (bury-successful-compilation) +#+END_SRC -- cgit v1.2.3-54-g00ecf From c06f101307d0f00268d6982802af7d876d460174 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 15 Nov 2016 23:02:29 +0100 Subject: Remove background colors from shr --- emacs/.emacs.d/init.org | 8 ++++++++ emacs/.emacs.d/init/oni-shr-init.org | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 emacs/.emacs.d/init/oni-shr-init.org (limited to 'emacs/.emacs.d/init') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 6a3ba45..e2e3821 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -456,6 +456,14 @@ To start off, first I need to enable lexical binding. (add-hook 'minibuffer-setup-hook 'electric-pair-local-mode) #+END_SRC +* Libraries + + - [[file:init/oni-shr-init.org][shr]] + + #+BEGIN_SRC emacs-lisp + (with-eval-after-load 'shr (load "oni-shr-init")) + #+END_SRC + * Minor modes - [[file:init/oni-company-init.org][Company mode]] :: A better auto completion system than auto diff --git a/emacs/.emacs.d/init/oni-shr-init.org b/emacs/.emacs.d/init/oni-shr-init.org new file mode 100644 index 0000000..3aa8626 --- /dev/null +++ b/emacs/.emacs.d/init/oni-shr-init.org @@ -0,0 +1,28 @@ +#+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 -- cgit v1.2.3-54-g00ecf From 82759a40548a7b8c1a31611fe6d6c035b9a87075 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 24 Nov 2016 21:42:59 +0100 Subject: Add some more channels to join --- emacs/.emacs.d/init/oni-circe-init.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'emacs/.emacs.d/init') diff --git a/emacs/.emacs.d/init/oni-circe-init.org b/emacs/.emacs.d/init/oni-circe-init.org index 7521c04..1580f9a 100644 --- a/emacs/.emacs.d/init/oni-circe-init.org +++ b/emacs/.emacs.d/init/oni-circe-init.org @@ -21,7 +21,9 @@ I spend most of my time on IRC on Freenode. "#ninthfloor" "#dispass" "#linuxvoice" - "#conkeror") + "#conkeror" + "#emacs-circe" + "#chicken") :nickserv-password ,(oni-circe-get-password-for "irc.freenode.net"))) #+END_SRC -- cgit v1.2.3-54-g00ecf From e3ce510987cec0efaef7c8e9a75750ad0f09e95c Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 24 Nov 2016 21:44:50 +0100 Subject: Add external tracking in mowedline for circe --- emacs/.emacs.d/init/oni-circe-init.org | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'emacs/.emacs.d/init') diff --git a/emacs/.emacs.d/init/oni-circe-init.org b/emacs/.emacs.d/init/oni-circe-init.org index 1580f9a..b7fd14e 100644 --- a/emacs/.emacs.d/init/oni-circe-init.org +++ b/emacs/.emacs.d/init/oni-circe-init.org @@ -5,6 +5,7 @@ (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 @@ -52,3 +53,66 @@ 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 -- cgit v1.2.3-54-g00ecf From d2d929fc119d587f38516f4b51e085a7eab21f68 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 24 Nov 2016 21:45:01 +0100 Subject: Enable nameless mode for Emacs lisp files --- emacs/.emacs.d/init/oni-emacs-lisp-mode-init.org | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'emacs/.emacs.d/init') diff --git a/emacs/.emacs.d/init/oni-emacs-lisp-mode-init.org b/emacs/.emacs.d/init/oni-emacs-lisp-mode-init.org index 14a2a99..8050247 100644 --- a/emacs/.emacs.d/init/oni-emacs-lisp-mode-init.org +++ b/emacs/.emacs.d/init/oni-emacs-lisp-mode-init.org @@ -24,3 +24,9 @@ Enable flycheck mode to help me avoid errors. #+BEGIN_SRC emacs-lisp (add-hook 'emacs-lisp-mode-hook 'flycheck-mode) #+END_SRC + +Enable namesless mode to help with viewing name-prefixed symbols. + +#+BEGIN_SRC emacs-lisp + (add-hook 'emacs-lisp-mode-hook 'nameless-mode) +#+END_SRC -- cgit v1.2.3-54-g00ecf From 0fcfe9e6f7c4279f9742675393f0220f16c02c5c Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 24 Nov 2016 21:45:37 +0100 Subject: Enable org-protocol --- emacs/.emacs.d/init/oni-org-init.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'emacs/.emacs.d/init') diff --git a/emacs/.emacs.d/init/oni-org-init.org b/emacs/.emacs.d/init/oni-org-init.org index a7ea4f0..36f7be3 100644 --- a/emacs/.emacs.d/init/oni-org-init.org +++ b/emacs/.emacs.d/init/oni-org-init.org @@ -2,6 +2,7 @@ #+BEGIN_SRC emacs-lisp (require 'org) + (require 'org-capture) #+END_SRC Tell org-mode to fontify code blocks in their specified languages. @@ -21,3 +22,22 @@ Enable automatic text filling for org-mode. #+BEGIN_SRC emacs-lisp (add-hook 'org-mode-hook 'auto-fill-mode) #+END_SRC + +* Org protocol + + Load org-protocol to let external applications add information to + org. + + #+BEGIN_SRC emacs-lisp + (require 'org-protocol) + #+END_SRC + + This template is used by Conkeror to capture a bookmark into my + bookmarks file. + + #+BEGIN_SRC emacs-lisp + (add-to-list 'org-capture-templates + '("b" "Bookmark" entry (file "~/documents/org/bookmarks.org") + "* %c\n\n %i" + :empty-lines 1)) + #+END_SRC -- cgit v1.2.3-54-g00ecf