Subject: Re: bug#57955: 29.0.50; Allow session-local ERC modules

From: "J.P." <[email-masked]>
Date: Sat, 10 Feb 2024 12:36:04 -0800

A new Emacs user recently complained about the lack of an example
showing local modules being `let'-bound around calls to ERC's entry
point functions in lisp code. Perhaps we should add such an example to
the Modules chapter and also possibly update the "Multiple networks"
example in Advanced > SASL to include a non-SASL connection:

  (defun my-erc-up (network)
    (interactive "Snetwork: ")
  
    (pcase network
      ('libera
       (let ((erc-modules (cons 'sasl erc-modules))
             (erc-sasl-mechanism 'external))
         (erc-tls :server "irc.libera.chat" :port 6697
                  :client-certificate t)))
      ('example
       (let ((erc-modules (cons 'sasl erc-modules))
             (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")))
      (_ (call-interactively #'erc-tls))))