summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-09-03 16:19:27 -0500
committerCase Duckworth2021-09-03 16:19:27 -0500
commite8d4afa471bc4812eef63ae9b8f7c156638fd8f8 (patch)
tree2b9849e9a3dd18f83f8b134ec8e2230dbf92ab4b
parentAdd `clone-buffer-write-file' and sort (diff)
downloademacs-e8d4afa471bc4812eef63ae9b8f7c156638fd8f8.tar.gz
emacs-e8d4afa471bc4812eef63ae9b8f7c156638fd8f8.zip
Further improve IRC experience
- Add SLAP command
- Kill buffer on PART
- Turns out, circe formatting variables can be functions!  Thank the gods :D
-rw-r--r--init.el64
-rw-r--r--lisp/acdw-irc.el14
2 files changed, 50 insertions, 28 deletions
diff --git a/init.el b/init.el index 275d830..1dac20c 100644 --- a/init.el +++ b/init.el
@@ -1232,6 +1232,7 @@ like a dumbass."
1232 1232
1233 (:option acdw-irc/left-margin 12 1233 (:option acdw-irc/left-margin 12
1234 acdw-irc/post-my-nick "-> " 1234 acdw-irc/post-my-nick "-> "
1235 circe-channel-killed-confirmation nil
1235 circe-color-nicks-everywhere t 1236 circe-color-nicks-everywhere t
1236 circe-default-nick "acdw" 1237 circe-default-nick "acdw"
1237 circe-default-part-message "See You, Space Cowpokes . . ." 1238 circe-default-part-message "See You, Space Cowpokes . . ."
@@ -1264,6 +1265,12 @@ like a dumbass."
1264 ((t (:inherit (modus-themes-hl-line)))) 1265 ((t (:inherit (modus-themes-hl-line))))
1265 :now)) 1266 :now))
1266 1267
1268 (:bind "C-c C-p" circe-command-PART)
1269
1270 (:advise circe-command-PART :after
1271 (defun circe-command-PART@kill-buffer (&rest _)
1272 (kill-buffer)))
1273
1267 (add-hook 'circe-chat-mode-hook 1274 (add-hook 'circe-chat-mode-hook
1268 (defun circe-chat@setup () 1275 (defun circe-chat@setup ()
1269 (lui-set-prompt 1276 (lui-set-prompt
@@ -1284,34 +1291,35 @@ like a dumbass."
1284 (add-hook 'modus-themes-after-load-theme-hook 1291 (add-hook 'modus-themes-after-load-theme-hook
1285 #'circe-nick-color-reset) 1292 #'circe-nick-color-reset)
1286 1293
1287 (let ((len (number-to-string (- acdw-irc/left-margin 1 1294 (setq circe-format-say
1288 (+ (length acdw-irc/pre-nick) 1295 (lambda (&rest plist)
1289 (length acdw-irc/post-nick))))) 1296 (concat
1290 (my-len (number-to-string (- acdw-irc/left-margin 1 1297 (acdw-irc/margin-format (plist-get plist :nick) "" " |" t)
1291 (+ (length acdw-irc/pre-my-nick) 1298 " "
1292 (length acdw-irc/post-my-nick)))))) 1299 (plist-get plist :body)))
1293 (setq circe-format-say (concat acdw-irc/pre-nick 1300
1294 "{nick:" len "." len "s} " 1301 circe-format-self-say
1295 acdw-irc/post-nick 1302 (lambda (&rest plist)
1296 "{body}") 1303 (concat
1297 circe-format-self-say (concat acdw-irc/pre-my-nick 1304 (acdw-irc/margin-format (plist-get plist :nick) "-" " >" t)
1298 "{nick:" my-len "." my-len "s} " 1305 " "
1299 acdw-irc/post-my-nick 1306 (plist-get plist :body)))
1300 "{body}") 1307
1301 circe-format-action (concat "*" 1308 circe-format-action
1302 (repeat-string 1309 (lambda (&rest plist)
1303 (- acdw-irc/left-margin 3) 1310 (concat
1304 " ") 1311 (acdw-irc/margin-format (plist-get plist :nick) "*" " *" t)
1305 "* {nick} {body}") 1312 " "
1306 circe-format-self-action (concat "-*" 1313 (plist-get plist :body)))
1307 (repeat-string 1314
1308 (- acdw-irc/left-margin 4) 1315 circe-format-self-action
1309 " ") 1316 (lambda (&rest plist)
1310 "* {nick} {body}") 1317 (concat
1311 lui-fill-type (concat 1318 (acdw-irc/margin-format (plist-get plist :nick) "-*" " *" t)
1312 (repeat-string (- acdw-irc/left-margin 2) 1319 " "
1313 " ") 1320 (plist-get plist :body)))
1314 " "))) 1321
1322 lui-fill-type (repeat-string acdw-irc/left-margin " "))
1315 1323
1316 (:option lui-fill-column fill-column 1324 (:option lui-fill-column fill-column
1317 lui-time-stamp-position 'right-margin 1325 lui-time-stamp-position 'right-margin
diff --git a/lisp/acdw-irc.el b/lisp/acdw-irc.el index 0891f31..f5e5657 100644 --- a/lisp/acdw-irc.el +++ b/lisp/acdw-irc.el
@@ -102,6 +102,20 @@ already been connected to."
102 (y-or-n-p (format "Already connected to %s, reconnect?" network))) 102 (y-or-n-p (format "Already connected to %s, reconnect?" network)))
103 (circe network))) 103 (circe network)))
104 104
105;; the most important command ever.
106(defun circe-command-SLAP (nick)
107 "Slap NICK around with a large trout."
108 (interactive "sNick: ")
109 (if (not circe-chat-target)
110 (circe-display-server-message "No target for current buffer")
111 (let ((line (concat "slaps " nick " around a bit with a large trout")))
112 (circe-display 'circe-format-self-action
113 :body line
114 :nick (circe-nick))
115 (irc-send-ctcp (circe-server-process)
116 circe-chat-target
117 "ACTION" line))))
118
105 119
106(provide 'acdw-irc) 120(provide 'acdw-irc)
107;;; acdw-irc.el ends here 121;;; acdw-irc.el ends here