aboutsummaryrefslogtreecommitdiff
path: root/emacs/init.org
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2017-05-19 09:27:05 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2017-05-19 09:27:05 +0200
commitbcabd7921bacffd54296f38fcbaea6dcacafd529 (patch)
treec32b851ce23006260c34292a1904297db47c5924 /emacs/init.org
parent50420c3af0d1ab61aca1c550ea4b8d252ab863cc (diff)
downloaddotfiles-bcabd7921bacffd54296f38fcbaea6dcacafd529.tar.gz
dotfiles-bcabd7921bacffd54296f38fcbaea6dcacafd529.zip
emacs: fixed logging in ERC
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'emacs/init.org')
-rw-r--r--emacs/init.org47
1 files changed, 37 insertions, 10 deletions
diff --git a/emacs/init.org b/emacs/init.org
index 8b9c677..413b258 100644
--- a/emacs/init.org
+++ b/emacs/init.org
@@ -1550,14 +1550,23 @@ Will work on both org-mode and any mode that accepts plain html."
* IRC
-I'm giving ERC a chance. First of all, I'm setting up basic stuff.
+I'm using [[https://www.gnu.org/software/emacs/manual/html_mono/erc.html][ERC]] for IRC.
#+BEGIN_SRC elisp
(use-package erc
:config
+#+END_SRC
+
+First of all, let's add some basic modules.
- (erc-track-mode t)
+#+BEGIN_SRC elisp
+ (dolist (mod '(autojoin track truncate))
+ (add-to-list 'erc-modules mod))
+#+END_SRC
+Setting up basic stuff.
+
+#+BEGIN_SRC elisp
(setq erc-hide-list '("PART")
erc-prompt (lambda () (concat (buffer-name) ">"))
erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE")
@@ -1567,10 +1576,6 @@ I'm giving ERC a chance. First of all, I'm setting up basic stuff.
erc-kill-server-buffer-on-quit t
erc-fill-column 100
erc-fill-prefix ""
- erc-log-channels t
- erc-log-write-after-insert t
- erc-log-insert-log-on-open nil
- erc-log-channels-directory "~/.emacs.d/erc/"
erc-timestamp-format "[%H:%M] "
erc-insert-timestamp-function 'erc-insert-timestamp-left
erc-insert-away-timestamp-function 'erc-insert-timestamp-left
@@ -1583,7 +1588,25 @@ I'm giving ERC a chance. First of all, I'm setting up basic stuff.
erc-away-nickname "msabate"
erc-enable-logging t
erc-query-on-unjoined-chan-privmsg t)
+#+END_SRC
+Let's log messages whenever I receive/send them. The other option is to only do
+that on =/quit= or =/part=, but it's better to be safe than sorry.
+
+#+BEGIN_SRC elisp
+ (require 'erc-log)
+ (erc-log-enable)
+
+ (setq erc-log-channels-directory "~/.emacs.d/erc"
+ erc-save-buffer-on-part nil
+ erc-save-queries-on-quit nil
+ erc-log-write-after-send t
+ erc-log-write-after-insert t)
+#+END_SRC
+
+Servers and channels to auto-join.
+
+#+BEGIN_SRC elisp
(setq erc-autojoin-channels-alist
'(("irc.freenode.net" "#gnu" "#emacs")
("irc.suse.de" "#suse" "#docker")))
@@ -1620,12 +1643,16 @@ At this point, we can safely update all the loaded ERC modules.
(lambda (x) (erc-update-modules)))
#+END_SRC
-According to the [[https://www.emacswiki.org/emacs/ErcFilling][wiki]], =auto-fill-mode= should be disabled if I'm using
-=erc-fill-mode=.
+Start some modules which won't do it by default. Moreover, according to the [[https://www.emacswiki.org/emacs/ErcFilling][wiki]]
+=auto-fill-mode= should be disabled if I'm using =erc-fill-mode=.
#+BEGIN_SRC elisp
-(add-hook 'erc-mode-hook
- (lambda () (auto-fill-mode 0)))
+ (add-hook 'erc-mode-hook
+ '(lambda ()
+ (erc-track-mode t)
+ (auto-fill-mode -1)
+ (erc-log-mode 1)
+ (erc-autojoin-mode 1)))
#+END_SRC
And now define a function to connect to both IRC servers.