From 1ad31877ce86f4e5f9336360e875e33d208a801f Mon Sep 17 00:00:00 2001 From: plugd Date: Fri, 16 Jul 2021 11:41:27 +0200 Subject: [PATCH] Added command to list networks. --- lurk.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lurk.el b/lurk.el index bd1e416..bae68ce 100644 --- a/lurk.el +++ b/lurk.el @@ -826,6 +826,7 @@ in which case they match anything.") '(("DEBUG" "Toggle debug mode on/off." lurk-command-debug lurk-boolean-completions) ("HEADER" "Toggle display of header." lurk-command-header lurk-boolean-completions) ("CONNECT" "Connect to an IRC network." lurk-command-connect lurk-network-completions) + ("NETWORKS" "List known IRC networks." lurk-command-networks) ("TOPIC" "Set topic for current channel." lurk-command-topic) ("ME" "Display action." lurk-command-me) ("VERSION" "Request version of another user's client via CTCP." lurk-command-version) @@ -893,6 +894,15 @@ in which case they match anything.") (lurk-connect network)) (lurk-display-notice nil "Usage: /connect "))) +(defun lurk-command-networks (params) + (lurk-display-notice nil "Currently-known networks:") + (dolist (row lurk-networks) + (seq-let (network server port &rest others) row + (lurk-display-notice nil "\t" network + " [" server + " " (number-to-string port) "]"))) + (lurk-display-notice nil "(Modify the `lurk-networks' variable to add more.)")) + (defun lurk-command-quit (params) (let ((quit-msg (if params (string-join params " ") nil))) (lurk-send-msg (lurk-msg nil nil "QUIT" quit-msg)))) @@ -1075,7 +1085,6 @@ in which case they match anything.") (lurk-enter-string line)))) - ;;; Mode ;; -- 2.20.1