From 082b63610c9890b8e97297567dd4f941e09a3f19 Mon Sep 17 00:00:00 2001 From: Benjamin Andresen Date: Mon, 2 Apr 2018 07:53:51 +0200 Subject: [PATCH 1/3] Add: app/irc: pretty up a few more kinds of messages --- modules/app/irc/config.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index 0b98053cc..e1da7c1ab 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -56,6 +56,10 @@ playback.") circe-format-self-say circe-format-say circe-format-action (format "{nick:+%ss} * {body}" +irc-left-padding) circe-format-self-action circe-format-action + circe-format-server-notice + (let ((left "-Server-")) (concat (make-string (- +irc-left-padding (length left)) ? ) + (concat left " _ {body}"))) + circe-format-notice (format "{nick:%ss} _ {body}" +irc-left-padding) circe-format-server-topic (+irc--pad "Topic" "{userhost}: {topic-diff}") circe-format-server-join-in-channel @@ -70,6 +74,8 @@ playback.") (+irc--pad "Quit" "{nick} ({userhost}) left {channel}: {reason}]") circe-format-server-rejoin (+irc--pad "Re-join" "{nick} ({userhost}), left {departuredelta} ago") + circe-format-server-netmerge + (+irc--pad "Netmerge" "{split}, split {ago} ago (Use /WL to see who's still missing)") circe-format-server-nick-change (+irc--pad "Nick" "{old-nick} ({userhost}) is now known as {new-nick}") circe-format-server-nick-change-self From fbf80489da7500bb5ab744f4a303738bd5b12b4f Mon Sep 17 00:00:00 2001 From: Benjamin Andresen Date: Mon, 2 Apr 2018 08:07:44 +0200 Subject: [PATCH 2/3] Document: app/irc: add docstrings for all variables --- modules/app/irc/config.el | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index e1da7c1ab..97ce99658 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -1,7 +1,9 @@ ;;; app/irc/config.el -*- lexical-binding: t; -*- (defvar +irc-left-padding 13 - "TODO") + "By how much spaces the left hand side of the line should be padded. +Below a value of 12 this may result in uneven alignment between the various +types of messages.") (defvar +irc-truncate-nick-char ?… "Character to displayed when nick > `+irc-left-padding' in length.") @@ -11,16 +13,23 @@ "If these commands are called pre prompt the buffer will scroll to `point-max'.") (defvar +irc-disconnect-hook nil - "TODO") + "Runs each hook when circe noticies the connection has been disconnected. +Useful for scenarios where an instant reconnect will not be successful.") (defvar +irc-bot-list '("fsbot" "rudybot") - "TODO") + "Nicks listed have `circe-fool-face' applied and will not be tracked.") (defvar +irc-time-stamp-format "%H:%M" - "TODO") + "The format of time stamps. + +See `format-time-string' for a full description of available +formatting directives. ") (defvar +irc-notifications-watch-strings nil - "TODO") + "A list of strings which can trigger a notification. You don't need to put +your nick here. + +See `circe-notifications-watch-strings'.") (defvar +irc-defer-notifications nil "How long to defer enabling notifications, in seconds (e.g. 5min = 300). From 4f4176c6463a67c7046cb524e5999f8b8040fe2b Mon Sep 17 00:00:00 2001 From: Benjamin Andresen Date: Mon, 2 Apr 2018 08:08:13 +0200 Subject: [PATCH 3/3] Add: app/irc: include disconnect hook code --- modules/app/irc/config.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index 97ce99658..7d7c6df11 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -98,6 +98,10 @@ playback.") (add-hook 'circe-channel-mode-hook #'turn-on-visual-line-mode) + (defun +irc*circe-disconnect-hook (&rest _) + (run-hooks '+irc-disconnect-hook)) + (advice-add 'circe--irc-conn-disconnected :after #'+irc*circe-disconnect-hook) + ;; Let `+irc/quit' and `circe' handle buffer cleanup (map! :map circe-mode-map [remap kill-buffer] #'bury-buffer)