Thread View: gnu.emacs.gnus
1 messages
1 total messages
Started by Mekeor Melire
Mon, 05 Oct 2026 10:32
Re: Completion for ERC networks
Author: Mekeor Melire
Date: Mon, 05 Oct 2026 10:32
Date: Mon, 05 Oct 2026 10:32
51 lines
2435 bytes
2435 bytes
On 2026-10-01 at 17:21, <phako@invalid.net> wrote:
> Hello everybody,
Hi!
This is the NNTP group / mailing-list for Gnus. Your question is
not related to Gnus but to ERC.
> --8<---------------cut here---------------start------------->8---
> (defun my-erc-up (network)
> (interactive "Snetwork: ")
>
> (pcase network
> ('libera
> (let ((erc-sasl-mechanism 'external))
> (erc-tls :server "irc.libera.chat" :port 6697
> :client-certificate t)))
> ('example
> (let ((erc-sasl-auth-source-function
> #'erc-sasl-auth-source-password-as-host))
> (erc-tls :server "irc.example.net" :port 6697
> :user "alyssa"
> :password "Example.Net")))))
> --8<---------------cut here---------------end--------------->8---
>
> However, I wish it could be possible to have these networks be
> autocompleted when the function is run and I'm prompted for the network
> name in the mini-buffer.
> If someone knows a quick solution, TIA.
Try
(completing-read "Network: " '("libera" "example"))
which I think you can put into the `interactive' expression:
(defun my-erc-up (network)
(interactive
(list (completing-read "Network: " '("libera" "example"))))
...)
Make sure to check out the optional arguments to
`completing-read', particularly REQUIRE-MATCH.
(completing-read PROMPT COLLECTION &optional PREDICATE
REQUIRE-MATCH INITIAL-INPUT HIST DEF INHERIT-INPUT-METHOD)
--
Good luck!
Mekeor
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads