aboutsummaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d/init
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.emacs.d/init')
-rw-r--r--emacs/.emacs.d/init/oni-circe-init.org68
-rw-r--r--emacs/.emacs.d/init/oni-compilation-init.org21
-rw-r--r--emacs/.emacs.d/init/oni-emacs-lisp-mode-init.org6
-rw-r--r--emacs/.emacs.d/init/oni-org-init.org20
-rw-r--r--emacs/.emacs.d/init/oni-shr-init.org28
5 files changed, 142 insertions, 1 deletions
diff --git a/emacs/.emacs.d/init/oni-circe-init.org b/emacs/.emacs.d/init/oni-circe-init.org
index 7521c04..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
@@ -21,7 +22,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
@@ -50,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
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
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
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
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