From: plugd Date: Fri, 16 Jul 2021 09:41:27 +0000 (+0200) Subject: Added command to list networks. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=1ad31877ce86f4e5f9336360e875e33d208a801f;p=lurk.git Added command to list networks. --- 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 ;;