2016-01-08 11:41:05 +01:00
|
|
|
#+PROPERTY: tangle site-lisp/lui-init.el
|
|
|
|
#+STARTUP: content
|
|
|
|
|
|
|
|
Since starting to use Circe I've also tried using the lui library on
|
|
|
|
another project: emacs-slack. This has caused lui to be loaded without
|
|
|
|
circe being loaded, so my lui customizations need to be loaded
|
|
|
|
separately when lui is loaded, not when circe is loaded.
|
|
|
|
|
|
|
|
* Enable lexical binding
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp :padline no
|
|
|
|
;; -*- lexical-binding: t -*-
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
* Require the needed libraries
|
|
|
|
|
|
|
|
In order to keep compiler warnings to a minimum, I require the
|
|
|
|
libraries that are used in this configuration.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(require 'lui)
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
* Change the time-stamp
|
|
|
|
|
|
|
|
I use only a small window to view the IRC channel I'm in usually,
|
|
|
|
the default format put the time-stamp just a little too far to the
|
|
|
|
right and would always cause either line truncation or filling to
|
|
|
|
the next line. So I put the time-stamp in the right margin so it's
|
|
|
|
always to the right of all messages and no messages can run under
|
|
|
|
it, so essentially it has it's own column.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq lui-time-stamp-position 'right-margin)
|
|
|
|
(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
|
|
|
|
|
2016-02-08 01:01:11 +01:00
|
|
|
* Clean-up the channel buffers further
|
|
|
|
|
|
|
|
When chatting with people in an IRC channel, there really isn't much
|
|
|
|
need for any information in the mode-line. This is mostly because
|
|
|
|
the channel I'm most active on always has its own window. Visual
|
|
|
|
line mode is very handy to have in chats, in case I type very long
|
|
|
|
lines. And the =wrap-prefix= is set so that when I do type long lines,
|
|
|
|
they are filled nicely to the circe prompt.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(defun oni:remove-mode-line ()
|
|
|
|
(setq mode-line-format nil))
|
|
|
|
|
|
|
|
(defun oni:set-lui-prompt-wrap-prefix ()
|
|
|
|
(setq wrap-prefix " "))
|
|
|
|
|
|
|
|
(add-hook 'lui-mode-hook #'oni:remove-mode-line)
|
|
|
|
(add-hook 'lui-mode-hook #'oni:set-lui-prompt-wrap-prefix)
|
|
|
|
(add-hook 'lui-mode-hook 'visual-line-mode)
|
|
|
|
#+END_SRC
|
|
|
|
|
2016-01-08 11:41:05 +01:00
|
|
|
* Provide the right feature
|
|
|
|
|
|
|
|
In order to be able to use =(require 'lui-init)= we must first
|
|
|
|
=provide= it.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(provide 'lui-init)
|
|
|
|
#+END_SRC
|