summaryrefslogtreecommitdiff
path: root/lisp/erc
Commit message (Collapse)AuthorAgeFilesLines
* ; Fix typos in symbol namesStefan Kangas2024-01-141-1/+1
|
* ; Add 2024 to copyright yearsPo Lu2024-01-0240-40/+40
|
* ; Fix typosStefan Kangas2023-12-031-1/+1
|
* Explain ERC 5.5 regressions in new version 5.5.0.29.1F. Jason Park2023-04-263-12/+42
| | | | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Bump version to 5.5.0.29.1. * etc/ERC-NEWS: Don't hype bugged option `erc-reconnect-display'. * lisp/erc/erc-dcc.el (erc-dcc-do-GET-command): Add comment explaining parsing bug in ERC 5.5 (bug#62444). * lisp/erc/erc-networks.el (erc-networks-on-MOTD-end): Mention known /MOTD bug in error notice so people don't waste energy reporting it (bug#62151). * lisp/erc/erc.el: Change Version header to 5.5.0.29.1. Don't bother updating the `customize-package-emacs-version-alist' entry because no option defaults are affected. (erc-version): Change version to 5.5.0.29.1. (erc-reconnect-display, erc-query-on-unjoined-chan-privmsg): Add warning to doc strings and `custom-set' functions. It's believed that these bugs degrade the user experience significantly enough to warrant such mentions (bug#62833). (erc-query): Fix erroneous redirect string in deprecation spec. Do not merge to master.
* Release ERC 5.5F. Jason Park2023-03-031-4/+5
| | | | | | | | | * doc/misc/erc.texi: Update ERCVER to 5.5. * lisp/erc/erc.el: Increment main version header to 5.5. Update Compat version in package-requires header to 29.1.3.4. Update `customize-package-emacs-version-alist' entry by mapping ERC 5.5 to Emacs 29.1. (erc-version): Update value to 5.5.
* ; Fix wrong error name in erc-server-908 doc string.F. Jason Park2023-03-031-2/+3
| | | | | | * lisp/erc/erc-sasl.el (erc-server-908): Correct well-known name for 908 numeric in doc string. (erc--register-connection): Fold overlong line.
* Yield to erc-move-to-prompt before unhiding promptF. Jason Park2023-02-222-21/+16
| | | | | | | | | | * lisp/erc/erc-backend.el (erc--hide-prompt): Change hook depth from 0 to 91 to allow the `move-to-prompt' module to do its thing. This feature was added by bug#54826 and first appeared in Emacs 29. * lisp/erc/erc-common.el (erc-server-user): Remove erroneous comment. The `buffers' field is a list of buffers. * test/lisp/erc/erc-tests.el (erc-hide-prompt): Use `erc--target' instead of `erc-default-recipients' because this is new code.
* ; Prepare to update ERC version to 5.5F. Jason Park2023-02-146-50/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Mention in various places that ERC is also available from GNU ELPA. * etc/ERC-NEWS: Mention Compat dependency and shorten title for auth-source section. * lisp/erc/erc-backend.el: (erc-server-reconnect-function, erc-tags-format): Update package version to 5.5. (erc--parse-message-tags): Downcase warning "type" to remain consistent with all other ERC warnings. * lisp/erc/erc-button.el: (erc-button-alist): Change package-version to 5.5. * lisp/erc/erc-match.el (erc-match-quote-when-adding): Update package version to 5.5. * lisp/erc/erc-sasl.el: Mention actual info node in Commentary. (erc-sasl): Update package version to 5.5. (erc-sasl-password): Reword doc string. (erc-sasl-auth-source-function): Capitalize "info" in doc string. * lisp/erc/erc-services.el (erc-auth-source-services-function): Update package version to 5.5. Capitalize "info" in doc string. Change choice type from const to function-item. * lisp/erc/erc.el (erc-password): Capitalize "info" in doc string. (erc-inhibit-multiline-input, erc-ask-about-multiline-input, erc-prompt-hidden, erc-hide-prompt, erc-unhide-query-prompt, erc-join-buffer, erc-reconnect-display, erc-kill-server-hook, erc-kill-channel-hook, erc-kill-buffer-hook, erc-url-connect-function): Update package version to 5.5. (erc-auth-source-server-function, erc-auth-source-join-function): Update package version to 5.5. Change choice type from const to function-item. Capitalize "info" in doc string. (erc-tls): Capitalize "info" in doc string.
* Don't casemap erc-sasl-user when set to :nickF. Jason Park2023-02-031-6/+5
| | | | | | | | | | | * lisp/erc/erc-sasl.el (erc-sasl-user): Fix doc string. (erc-sasl--get-user): Don't apply casemapping when the option `erc-sasl-user' is set to `:nick'. While many servers and auth-services providers perform case-folding when comparing SASL usernames, only some recognize RFC1459 mappings, which ERC previously applied blindly. Instead, ERC now behaves like other clients in leaving such preparation in the hands of the server. This bug was introduced with changes new to ERC 5.5 and Emacs 29 (bug#29108).
* Don't load erc-goodies atop erc.elF. Jason Park2023-01-201-1/+2
| | | | | | | | | | * lisp/erc/erc.el: Commit c2d657e7c4fd9685591f2120007eabf78745919d "Move ERC's core dependencies to a separate file" ironed out ERC's interwoven dependencies for the better but didn't cleanly sidestep the goodies interdependency, specifically with regard to custom options. This reverts the tiny portion impacting this aspect by once again requiring `erc-goodies' at the very end of ERC's main library. Special thanks to Libera.Chat user jrm for reporting this bug.
* Don't preserve non-module minor modes in erc-openF. Jason Park2023-01-172-10/+14
| | | | | | | | | | | | | | | | | | * lisp/erc/erc-common.el (define-erc-module): Add symbol property `erc-module' to minor modes defined as part of a module. * lisp/erc/erc.el (erc--merge-local-modes): Be more conservative when persisting local minor-mode state across ERC sessions. User and third-party modes that were not defined via `define-erc-modules' should be left alone. (erc-open): Run major-mode hooks and enable minor modes after prompt has been set up. This ensures that module-setup code can access a fully initialized `erc-input-marker'. * test/lisp/erc/erc-tests.el (erc--merge-local-modes): Add mocks for `erc-module' symbol property and a test case covering some foreign ERC mode. (define-erc-module--global, define-erc-module--local): Expect the `erc-module' symbol property to be defined for mode symbols and aliases. (Bug#60784.)
* Use correct buffer for local-module vars in erc-openF. Jason Park2023-01-171-2/+13
| | | | | | | | | | | | | | | | | | | | | * lisp/erc/erc.el (erc--target-priors): New internal variable to do for target buffers what `erc--server-reconnecting' does for server buffers. (erc-open): Source the state of a local module's mode variable from its actual buffer rather than its server buffer. Additionally, make all local variables from a prior session available to module-activation functions and `erc-mode' hooks, even when `erc-reuse-buffers' is nil. This bug arrived with the introduction of "local-modules" (bug#57955). * test/lisp/erc/erc-scenarios-base-local-modules.el (erc-scenarios-base-local-modules--toggle-helpers): Remove useless `with-current-buffer'. (erc-scenarios-base-local-modules--local-var, erc--phony-sblm--enable, erc--phony-sblm--disable, erc--phony-sblm--mode): Add fake local module and data var for test scenario. (erc-scenarios-base-local-modules--var-persistence) Add slightly hacky test case with promise to improve later when splitting the file.
* ; Avoid plist-get as generalized var in erc-compatF. Jason Park2023-01-171-2/+2
| | | | | | * lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search): The gv expander for `plist-get' was added in Emacs 28. But ERC still supports 27, as of this function's introduction, in Emacs 29.
* Remove obsolete server buffers on MOTD in erc-trackF. Jason Park2023-01-102-2/+16
| | | | | | | | | | | | | | | | | * lisp/erc/erc-networks.el (erc-networks--copy-server-buffer-functions): New internal hook through which modules can perform housekeeping when server buffers belonging to the same network context are merged. (erc-networks--copy-over-server-buffer-contents): Run new internal hook `erc-networks--copy-server-buffer-functions'. * lisp/erc/erc-track.el (erc-track-enable, erc-track-disable): Manage membership in `erc-networks--copy-server-buffer-functions' hook. (erc-track--replace-killed-buffer): New function to replace server buffer being killed in `erc-modified-channels-alist'. * test/lisp/erc/erc-scenarios-base-association.el (erc-scenarios-networks-merge-server-track): New test. * test/lisp/erc/resources/networks/merge-server/track.eld: New test data. (Bug#60560.)
* ; Fix wrong type in erc-ignore hide-list optionsF. Jason Park2023-01-101-2/+4
| | | | | * lisp/erc/erc.el (erc-network-hide-list, erc-channel-hide-list): Fix type in custom definition.
* Fix default-port regression in erc-select-read-argsF. Jason Park2023-01-021-9/+29
| | | | | | | | | | | | | | * lisp/erc/erc.el (erc--warn-unencrypted): New function, likely temporary, to warn new users connecting interactively to the default server, "irc.libara.chat", via the default non-TLS port, 6667. (erc-select-read-args): Remove stray code from incomplete feature introduced by bug#56514. Ensure connecting always works with default port, which is non-TLS. Respect `erc-prompt-for-password' when user pastes URL containing password component into "server" prompt. Maybe add `erc--warn-unencrypted' as one-off hook for impending connection. * test/lisp/erc/erc-tests.el (erc-select-read-args): Always expect password prompt and sometimes a non-TLS port when `erc' called interactively. (Bug#60428.)
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-0140-40/+40
|
* Warn of absent networks module in ERCF. Jason Park2022-12-284-9/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Add linkable note in Modules chapter about some modules being required. Also tweak markup in auth-source section. * etc/ERC-NEWS: Mention the special role of `networks'. * lisp/erc/erc-backend.el (erc--server-post-connect-hook): Add internal hook for core modules to perform post-network-process, pre-protocol config validation even when they haven't been loaded. (erc--register-connection): Run `erc--server-post-connect-hook'. * lisp/erc/erc-networks.el (erc-networks--bouncer-targets, erc-networks-on-MOTD-end): Fix comments and doc strings. Also change former from constant to internal variable in case adjustment needed between releases. (erc-networks--warn-on-connect): New function to warn about the `networks' module being absent from `erc-modules'. This could probably run at any time up to and including when the logical IRC connection is established, but doing so at the process/protocol boundary seems ideal. * lisp/erc/erc-sasl.el (erc--register-connection): Defer to base method instead of calling `erc-login' explicitly. * lisp/erc/erc.el (erc-generate-new-buffer-name): Don't reconcile buffer names when networks module not in play. (erc-format-target-and/or-network): Don't assume networks module loaded. * test/lisp/erc/erc-scenarios-base-unstable.el: (erc-scenarios-networks-no-module): New test. * test/lisp/erc/resources/networks/no-module/basic.eld: New test data file. (Bug#60331.)
* Avoid "already compiled" warning in erc-compatF. Jason Park2022-12-281-1/+1
| | | | | | | * lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search): Don't `byte-compile' sub-29 secrets wrapper. This was especially noisy in tests. Ditch closed-over vars via HOF instead of suppressing because compiling emits "unused lexical" warning on Emacs 27.
* ; Really respect browse-url var in erc-compatF. Jason Park2022-12-192-11/+11
| | | | | | | | | * lisp/erc/erc-compat.el: Do what was supposed to be done by 75f26646d4a569cfb485de4baddcda66ff44b2c3 "; Be nicer when updating browse-url var in erc-compat". This is the less harmful version of that patch (from bug#59976#8) but without the cl-lib requirement since users may not want to load the main ERC library right away. * lisp/erc/erc.el: Clarify some comments regarding the core API.
* Fix some naming issues involving query buffers in ERCF. Jason Park2022-12-162-19/+20
| | | | | | | | | | | | | | | | | | | * lisp/erc/erc-networks.el (erc-networks-rename-surviving-target-buffer): Don't kill a surviving target buffer when another, non-target buffer, possibly not even belonging to ERC, already exists and sports the target's name. (erc-networks--reconcile-buffer-names): Always append a network-ID suffix to a target buffer's name if another buffer of that name already exists. (Bug#59976.) * lisp/erc/erc.el (erc, erc-tls): Revise `:id' portion of doc strings. Thanks to Mike Kazantsev for the suggestion and for filing this bug and helping solve it. * test/lisp/erc/erc-networks-tests.el: (erc-networks-rename-surviving-target-buffer--query-non-target): Add new test. * test/lisp/erc/erc-scenarios-base-association-query.el: New file. * test/lisp/erc/resources/base/assoc/queries/netnick.eld: New file. * test/lisp/erc/resources/base/assoc/queries/non-erc.eld: New file.
* ; Fix doc string in ERC's module-activation commandsF. Jason Park2022-12-161-1/+2
| | | | | | | | | * lisp/erc/erc-common.el (erc--assemble-toggle): Previously, the doc string implied that a prefix argument was necessary to achieve connection-wide effects, which might lead a person to think the interactive code should be an uppercase "P". * test/lisp/erc/erc-tests.el (define-erc-module--local): Update expected result of code-gen.
* Increment erc-debug-irc-protocol-version to 2F. Jason Park2022-12-161-3/+6
| | | | | | | * lisp/erc/erc.el (erc-debug-irc-protocol-version): Change version to 2 to help dependent tooling detect redacted passwords. (erc-log-irc-protocol): Don't bother redacting incoming messages. (Bug#59284.)
* Don't send erc-sasl-user as USER command argumentF. Jason Park2022-12-141-6/+19
| | | | | | | | | | | | | | | | * lisp/erc/erc-sasl.el (erc-sasl--send-cap-ls): Add internal switch for sending an opening "CAP LS". The rationale for not enabling this by default is twofold: one, it more strongly implies that ERC supports IRCv3 client capability negotiation, which is somewhat disingenuous; and, two, We'd still be "faking it" by firing and forgetting, and more balls in the air makes things less predictable. (erc--register-connection): Possibly send a "CAP LS" before anything depending on the value of `erc-sasl--send-cap-ls'. Also, don't attempt to send `erc-session-username' when it holds an SASL username because the latter may contain protocol-defying characters. * test/lisp/erc/resources/base/local-modules/fourth.eld: change user parameter of "USER" command to reflect nick when `erc-sasl-user' is set to `:user'. (Bug#59976.)
* Set erc-network to a "given" ID instead of failingF. Jason Park2022-12-141-17/+40
| | | | | | | | | | | | | | | | | | | | | * lisp/erc/erc-networks.el (erc-networks--determine): Return the so-called "given" ID from a non-nil `:id' keyword arg passed to `erc' or `erc-tls'. (erc-networks--allow-unknown-network): Add internal variable to allow IRC session to continue despite the network being unknown. (erc-networks--set-name): Tell the user about falling back to a given ID when the network can't be determined. When that's so, end the session by destroying the connection unless `erc-networks--allow-unknown-network' is enabled. (Bug#59976.) (erc-networks--ensure-announced): Include the fallback announced server name in the error message. * test/lisp/erc/erc-networks-tests.el (erc-networks--set-name): Add dummy server process and don't expect an error to be signaled. * test/lisp/erc/erc-scenarios-misc.el (erc-scenarios-networks-announced-missing): Don't expect an error to be signaled. * test/lisp/erc/resources/networks/announced-missing/foonet.eld: Remove "mode" match pattern.
* Limit casemapping to appropriate ranges in ERCF. Jason Park2022-12-142-19/+25
| | | | | | | | | | | | | * lisp/erc/erc-common.el (erc-downcase): Use case table for `erc-downcase' so that case conversions are limited to the ASCII interval. * lisp/erc/erc.el (erc-casemapping--rfc1459-strict, erc--casemapping-rfc1459): Make these case tables instead of translation tables. The functions in case-table.el modify the standard syntax table, but that doesn't seem to make sense here, right? * test/lisp/erc/erc-tests.el (erc-downcase): Add cases showing mappings outside of the ASCII range. (Bug#59976.)
* Actually accept non-symbols as IDs in erc-openF. Jason Park2022-12-141-4/+5
| | | | | | | | | | | | | | * lisp/erc/erc.el (erc-generate-new-buffer-name): Despite what it says in the documentation, only symbols were being accepted as valid `:id' entry-point arguments. This uses the interned `princ' representation of the argument instead. * test/lisp/erc/erc-scenarios-base-netid-samenet.el (erc-scenarios-common--base-network-id-same-network): Randomly specify a string for the ID param instead of a non-nil symbol when opening a new connection. * test/lisp/erc/resources/erc-scenarios-common.el (erc-scenarios-common-assert-initial-buf-name): Adjust helper to allow for non-symbol IDs. (Bug#59976.)
* ; Be nicer when updating browse-url var in erc-compatF. Jason Park2022-12-141-2/+5
| | | | | | | * lisp/erc/erc-compat.el: Be more cautious about modifying `browse-url-default-handlers' when loading erc-compat on Emacs 28. A user may have already added an entry for irc:// URLs before loading `erc-compat'.
* Respect a nil erc-session-password when reconnectingF. Jason Park2022-12-141-1/+3
| | | | | | | | | | | | * lisp/erc/erc.el (erc-open): Simplify `old-vars' expression. (erc--compute-server-password): Only compute a server password when first connecting. For compatibility, this respects third-party code that expects session passwords in target buffers when initially non-nil. * test/lisp/erc/erc-scenarios-services-misc.el (erc-scenarios-services-auth-source-reconnect): Add new test. * test/lisp/erc/resources/services/auth-source/recon.eld: Add new test data file. (Bug#59858.)
* Add dedicated auth-source section in ERC manualF. Jason Park2022-12-143-5/+5
| | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Move auth-source description from the Password subheading of the Advanced chapter's Connecting section to the new Integrations section as a new node, Auth-Source, and give it a bit more structure. Fix various misuses of xref vs. pxref. Convert URL subheading to subsection and add anchor. Prefer "backend" as a single word, based on usage in other manuals. Also replace loud "warning" in SASL troubleshooting section. * etc/ERC-NEWS: Re-link auth-source mention. * lisp/erc/erc-sasl.el (erc-sasl-auth-source-function): Update info node in doc string. * lisp/erc/erc-services.el (erc-auth-source-services-function): Re-link auth-source info node in doc string. * lisp/erc/erc.el (erc-password, erc-auth-source-server-function, erc-auth-source-join-function): Re-link auth-source info node in doc strings.
* ; * lisp/erc/erc.el (erc-default-target): Fix comment.F. Jason Park2022-12-091-9/+8
|
* Respect some spaces in auth-source-pass--match-regexpF. Jason Park2022-12-091-4/+4
| | | | | | | | | | | | | | * lisp/auth-source-pass.el (auth-source-pass--match-regexp): Allow an entry's host and user fields to contain spaces, just like other backends do. * lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass--retrieve-parsed): Change regexp to allow spaces in host and user components of file names. * test/lisp/auth-source-pass-tests.el (auth-source-pass-any-host): Silence warning message re wildcards emitted by `auth-source-pass-search'. (auth-source-pass-extra-query-keywords--suffixed-user): Add spaces to users and hosts of some example entries. (Bug#58985.)
* Simplify erc-sasl's auth-source APIF. Jason Park2022-11-291-30/+47
| | | | | | | | | | | | | | | | * doc/misc/erc.texi: Revise descriptions in SASL chapter to reflect simplified auth-source options. * lisp/erc/erc-sasl.el (erc-sasl-password, erc-sasl-auth-source-function): Revise doc strings. (erc-sasl-auth-source-password-as-host): New function to serve as more useful choice for option `erc-sasl-auth-source-function'. (erc-sasl--read-password): Promote auth-source to pole position, above an explicit string and `:password'. * test/lisp/erc/erc-sasl-tests.el (erc-sasl--read-password--basic): Massage tests to conform to simplified `erc-sasl-password' API. (Bug#29108.)
* Add erc-sasl-auth-source-function to cached optionsF. Jason Park2022-11-281-4/+6
| | | | | | | | | | | | * lisp/erc/erc-sasl.el (erc-sasl--read-password): Consult cached options instead of `erc-sasl-auth-source-function'. (erc-sasl--init): Add `erc-sasl-auth-source-function' to `erc-sasl--options'. * test/lisp/erc/erc-sasl-tests.el (erc-sasl--read-password--basic, erc-sasl--read-password--auth-source): Look for original value of `erc-sasl-auth-source-function' in `erc-sasl--options' under the `authfn' key.
* Disable auth-source-pass-extra-query-keywords by defaultF. Jason Park2022-11-251-1/+1
| | | | | | | | | | | | | | | | * doc/misc/auth.texi: Mention subdomain matching in `auth-source-pass-extra-query-keywords' section. * etc/NEWS: Mention the loss of traditional auth-source-pass features when `auth-source-pass-extra-query-keywords' is enabled. * lisp/auth-source-pass (auth-source-pass-extra-query-keywords): Set default to nil. Mention domain matching in doc string. (auth-source-pass--match-regexp): Allow username to contain "@". * lisp/erc/erc-compat.el: (erc-compat--29-auth-source-pass--retrieve-parsed): Adjust regexp. * test/lisp/auth-source-pass-tests.el (auth-source-pass-extra-query-keywords--suffixed-user): make plain username more email-like. (Bug#58985.)
* Accept functions in place of passwords in ERCF. Jason Park2022-11-235-12/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/erc/erc-backend.el (erc-session-password): Add comment explaining type is now string, nil, or function. * lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search): Use obfuscation from auth-source function when available. * lisp/erc/erc-sasl.el (erc-sasl--read-password, erc-server-AUTHENTICATE): Use `erc--unfun'. * lisp/erc/erc-services.el (erc-nickserv-get-password, erc-nickserv-send-identify): Use `erc--unfun'. * lisp/erc/erc.el (erc--unfun): New function for unwrapping a password couched in a getter. (erc--debug-irc-protocol-mask-secrets): Add variable to indicate whether to mask passwords in debug logs. (erc--mask-secrets): New function to swap masked secret with question marks in debug logs. (erc-log-irc-protocol): Conditionally mask secrets when `erc--debug-irc-protocol-mask-secrets' is non-nil. (erc--auth-source-search): Don't unwrap secret from function before returning. (erc-server-join-channel, erc-login): Use `erc--unfun'. * test/lisp/erc/erc-services-tests.el (erc-services-tests--wrap-search): Add helper for `erc--unfun'. (erc-services-tests--auth-source-standard, erc-services-tests--auth-source-announced, erc-services-tests--auth-source-overrides, erc-nickserv-get-password): Use `erc--unfun'. * test/lisp/erc/erc-tests.el (erc--debug-irc-protocol-mask-secrets): Add test for masking secrets with `erc--unfun' and friends.
* Add non-IRCv3 SASL module to ERCF. Jason Park2022-11-234-0/+510
| | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Add SASL section in Advanced Usage chapter to document the new SASL module. * etc/ERC-NEWS: Mention addition of erc-sasl module for SASL support. * lisp/erc/erc-compat.el (erc-compat--29-sasl-scram-construct-gs2-header, erc-compat--29-sasl-scram-client-first-message, erc-compat--29-sasl-scram--client-final-message): Fix encoding bug and add minimal authorization support with copies of SASL functions introduced in Emacs 29. * lisp/erc/erc.el (erc-modules): Add `sasl'. * lisp/erc/erc-sasl.el: New file (bug#29108). * test/lisp/erc/erc-sasl-tests.el: New file. * test/lisp/erc/erc-scenarios-sasl.el: New file. * test/lisp/erc/resources/sasl/plain-failed.eld: New file. * test/lisp/erc/resources/sasl/plain.eld: New file. * test/lisp/erc/resources/sasl/scram-sha-1.eld: New file. * test/lisp/erc/resources/sasl/scram-sha-256.eld: New file. * test/lisp/erc/resources/sasl/external.eld: New file.
* Call erc-login indirectly via new generic wrapperF. Jason Park2022-11-231-2/+6
| | | | | | | * lisp/erc/erc-backend (erc--register-connection): Add new internal generic function that defers to `erc-login' by default. (erc-process-sentinel, erc-server-connect): Call `erc--register-connection' instead of `erc-login'.
* Support local ERC modules in erc-mode buffersF. Jason Park2022-11-233-51/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Mention local modules in Modules chapter. * etc/ERC-NEWS: Mention changes to `erc-update-modules'. * lisp/erc/erc.el (erc-migrate-modules): Add some missing mappings. (erc-modules): When a user removes a module, disable it and kill its local variable in all ERC buffers. (erc-update-modules): Move body of `erc-update-modules' to new internal function. (erc--update-modules): Add new function, a renamed and slightly modified version of `erc-update-modules'. Specifically, change return value from nil to a list of minor-mode commands for local modules. Use `custom-variable-p' to detect flavor. (erc--merge-local-modes): Add helper for finding local modules already active as minor modes in an ERC buffer. (erc-open): Replace `erc-update-modules' with `erc--update-modules'. Defer enabling of local modules via `erc--update-modules' until after buffer is initialized with other local vars. Also defer major-mode hooks so they can detect things like whether the buffer is a server or target buffer. Also ensure local module setup code can detect when `erc-open' was called with a non-nil `erc--server-reconnecting'. * lisp/erc/erc-common.el (erc--module-name-migrations, erc--features-to-modules, erc--modules-to-features): Add alists of old-to-new module names to support module-name migrations. (erc--assemble-toggle): Add new helper for constructing mode toggles, like `erc-sasl-enable'. (define-erc-modules): Defer to `erc--assemble-toggle' to create toggle commands. (erc--normalize-module-symbol): Add helper for `erc-migrate-modules'. * lisp/erc/erc-goodies.el: Require cl-lib. * test/lisp/erc/erc-tests.el (erc-migrate-modules, erc--update-modules): Add rudimentary unit tests asserting correct module-name mappings. (erc--merge-local-modes): Add test for helper. (define-erc-module--global, define-erc-module--local): Add tests asserting module-creation macro. (Bug#57955.)
* Make erc--server-reconnecting non-buffer-localF. Jason Park2022-11-232-11/+12
| | | | | | | | | | | | * lisp/erc/erc-backend.el (erc--server-reconnecting): Mention expected non-nil value type in doc string. (erc-server-connect): Don't set `erc--server-reconnecting'. (erc-server--reconnect): Let-bind `erc--server-reconnecting' instead of setting it locally in the server buffer. Set it to an alist containing the current buffer's local variables. (erc-process-sentinel-2): Don't set `erc--server-reconnect'. * lisp/erc/erc.el (erc--cmd-reconnect): Clean up some assertions. (Bug#57955.)
* Don't set erc-networks--id until network is knownF. Jason Park2022-11-233-37/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/erc/erc-networks.el (erc-networks--id-given): Accept a null argument. (erc-networks--id-on-connect): Remove unused function. (erc-networks--id-equal-p): Add method for comparing initialized and unset IDs. (erc-networks--update-server-identity): Ensure `erc-networks--id' is set before continuing search. (erc-networks--init-identity): Don't assume `erc-networks--id' is non-nil. Add branch condition to reload ID on non-nil case. (erc-networks-on-MOTD-end): Let init-ID function handle renaming of server buffer. * lisp/erc/erc.el (erc-open): For continued sessions, try copying over the last network ID. (erc--auth-source-determine-params-default): Don't expect a network ID to have been initialized. (erc-set-current-nick): When connected, reload network ID. Leave comment warning that it may be unneeded. * lisp/erc/erc-backend.el (erc-server-NICK, erc-server-433): Unless already connected, schedule ID reload when server rejects or mandates a nick change. * test/lisp/erc/erc-scenarios-base-association-nick.el (erc-scenarios-base-association-nick-bumped, erc-scenarios-base-association-nick-bumped-mandated-renick): Update to reflect more liberal association behavior when renamed by IRCd.
* ; Fix typosStefan Kangas2022-11-201-2/+3
|
* Improve new connections in erc-handle-irc-urlF. Jason Park2022-11-162-19/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Add new Integrations section to the info manual under Advanced Usage. * etc/ERC-NEWS: Add new section mentioning improved UX when clicking on irc:// links. * lisp/erc/erc.el (erc-handle-irc-url): Add optional "scheme" parameter. Fix `erc-open' invocation so that the server buffer is named correctly by deferring to a new customizable opener. Arrange for JOINing a channel in a manner similar to ERC's autojoin module. (erc-url-connect-function): Add new option for creating a new ERC connection based on info parsed from a URL. (erc--url-default-connect-function): New function to serve as an interactive-only fallback when a user hasn't specified a URL connect function. * lisp/erc/erc-compat.el (erc-compat--29-browse-url--irc): Add new compatibility function for `browse-url-irc' and include it in `browse-url-default-handlers' on Emacs versions below 29. * test/lisp/erc/erc-tests.el (erc-tests--make-server-buf, erc-tests--make-client-buf): Add helpers for creating dummy ERC buffers. (erc-handle-irc-url): Add test. * test/lisp/erc/erc-scenarios-misc.el (erc-scenarios-handle-irc-url): Add new test. * test/lisp/erc/resources/join/legacy/foonet.eld: Relax timeout. (Bug#56514.)
* Add optional server param to erc-networks--determineF. Jason Park2022-11-161-4/+5
| | | | | | | * lisp/erc/erc-networks.el (erc-networks--determine): Accept optional `server' argument. * test/lisp/erc/erc-networks-tests.el (erc-networks--determine): Add test. (Bug#56514.)
* Default to TLS port when calling erc-tls from lispF. Jason Park2022-11-161-4/+13
| | | | | | | | | | | * lisp/erc/erc.el (erc-normalize-port): Add standard IANA port-name mappings for 6667 and 6697. (erc-open): Add note to doc string explaining that params `connect' and `channel' are mutually exclusive. (erc-tls): Call `erc-compute-port' with override. (erc-compute-port): Call `erc-normalize-port' with result'. * test/lisp/erc/erc-tests.el (erc-tls): Add simplistic test focusing on default parameters. (Bug#56514.)
* Refactor erc-select-read-argsF. Jason Park2022-11-162-42/+47
| | | | | | | | | | | | | | | | * lisp/erc/erc-backend.el (erc--server-connect-dumb-ipv6-regexp): Add liberal pattern for matching bracketed IPv6 addresses. (erc-server-connect): Remove brackets from IPv6 hosts before connecting. * lisp/erc/erc.el (erc--ensure-url): Add compat adapter to massage partial URLs given as input that may be missing the scheme:// portion. (erc-select-read-args): Keep bracketed IPv6 hosts intact. Make this function fully URL-aware (was only partially so). Accept optional `input' argument. * lisp/erc/erc-tests.el (erc-tests--ipv6-examples, erc--server-connect-dumb-ipv6-regexp, erc-select-read-args): Add test reading user input during interactive invocations of entry points. (Bug#56514.)
* Warn of future breaking change to erc-response.tagsF. Jason Park2022-11-162-3/+57
| | | | | | | | | | | | * lisp/erc/erc-backend.el (erc-parse-tags-format): New option to determine type of the `erc-response' "tags" field. (erc-parse-tags): Defer to internal generic function. (erc--parse-tags): New function to hold original `erc-parse-tags' implementation. (erc--parse-message-tags): New generic function that conditionally calls `erc--parse-tags', perhaps emitting a warning beforehand. (erc-parse-server-response): Call `erc--parse-message-tags'. (Bug#58797.)
* Improve auto-reconnect visibility in ERCF. Jason Park2022-11-163-35/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/erc/erc-backend.el (erc--server-reconnect-timer): New variable. (erc-server-reconnect-function): New user option. (erc-process-sentinel-2): Display time remaining until next reconnection attempt. Also remove condition case and move bulk of else condition logic to `erc-schedule-reconnect'. More importantly, no longer set `erc--server-reconnecting here'). (erc-server-connect): Initialize `erc--server-reconnect-timer' to nil. (erc-server-reconnect): Set `erc-server--reconnecting' here. (erc--mode-line-process-reconnecting): New constant to store value for "reconnect" state of `mode-line-process'. (erc--cancel-auto-reconnect-timer): New function to cancel auto-reconnect timer and print message. (erc-schedule-reconnect): New function for scheduling another reconnect attempt. * lisp/erc/erc.el (erc-open): Only update mode line for target buffers. For server buffers, let `erc-login' and/or process sentinels take care of it. (erc--cmd-reconnect, erc-cmd-RECONNECT): Rename latter to former, a new function, but repurpose existing to recognize newly allowed additional arguments and act accordingly. In new internal function, cancel an existing auto-reconnect timer, if any, before proceeding. Defer to `erc-server-reconnect' to set `erc--server-reconnecting'. Fix `with-suppressed-warnings' form. (erc-update-mode-line-buffer): Show "reconnecting in Ns" for `mode-line-process' when awaiting an automatic reconnect attempt. (erc-message-english-reconnecting, erc-message-english-reconnect-canceled): Add new message functions to English catalog. * lisp/erc/erc-pcomplete.el (pcomplete/erc-mode/RECONNECT): Perform completion for newly subcommand-aware `erc-cmd-RECONNECT'. * lisp/erc/erc-scenarios-base-reconnect (erc-scenarios-base-cancel-reconnect): Add new test case for canceling reconnect timers. (Bug#58840.)
* Support auth-source-pass in ERCF. Jason Park2022-11-162-1/+120
| | | | | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Mention that the auth-source-pass backend is supported. * lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search, erc-compat--29-auth-source-pass--build-result-many, erc-compat--29-auth-source-pass--retrieve-parsed, erc-compat--29-auth-source-pass-backend-parse, erc-compat--auth-source-backend-parser-functions): Adapt some yet unreleased functions from auth-source-pass that mimic the netrc backend, and add forward declarations to support them. * lisp/erc/erc.el (erc--auth-source-search): Use own auth-source-pass erc-compat backend. * test/lisp/erc/erc-services-tests.el (erc-join-tests--auth-source-pass-entries): Remove useless items. (erc--auth-source-search--pass-standard, erc--auth-source-search--pass-announced, erc--auth-source-search--pass-overrides): Remove `ert-skip' guard. (Bug#58985.)
* ; Fix typosStefan Kangas2022-11-111-2/+2
|