1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-11 09:20:51 +00:00
Commit Graph

83 Commits

Author SHA1 Message Date
F. Jason Park
4d6ed774fe Respect existing invisibility props in erc-stamp
* etc/ERC-NEWS: mention `erc-match-toggle-hidden-fools' and new
merging behavior when handling `invisible' text property.
* lisp/erc/erc-match.el (erc-hide-fools): change `invisible' property
to `erc-match' for all messages, not just those with offset bounds.
(erc-match--modify-invisibility-spec): Fix error in doc string.
(erc-match-toggle-hidden-fools): New command.
* lisp/erc/erc-stamp.el (erc-stamp--invisible-property): Add new
internal variable to hold existing `invisible' property merged with
the one registered by this module, the non-namespaced `timestamp'.
(erc-stamp--skip-when-invisible): Add new internal variable, an escape
hatch for pre-ERC-5.6 behavior in which timestamps were not applied at
all to invisible messages.  This led to strange-looking, uneven logs,
and it prevented other modules from offering toggle functionality for
invisibility-spec members registered to them.
(erc-add-timestamp): Merge with existing `invisible' property, when
present, instead of clobbering, but only when escape hatch
`erc-stamp--skip-when-invisible' is nil.
(erc-insert-timestamp-left, erc-format-timestamp): Use possibly merged
`invisible' prop value.  Don't bother with `isearch-open-invisible',
which only affects overlays.
(erc-insert-timestamp-right): Bind `buffer-invisibility-spec' to nil
when figuring `current-column'.  Apply `invisible' text prop to white
space around stamp.
* test/lisp/erc/erc-scenarios-match.el: Require `erc-fill' and
`erc-stamp'.
(erc-scenarios-match--invisible-stamp): Move common setup and core
assertions for some stamp and invisibility-related tests into a
fixture-like helper.
(erc-scenarios-match--stamp-left-fools-invisible): Fix temporarily
disabled test and use fixture.
(erc-scenarios-match--find-eol): New helper.
(erc-scenarios-match--stamp-right-fools-invisible,
erc-scenarios-match--stamp-right-invisible-fill-wrap,
erc-scenarios-match--stamp-both-invisible-fill-static): New tests.
(Bug#64301)
2023-07-13 18:45:31 -07:00
F. Jason Park
96785a8037 Deprecate erc-server-alist and erc-server-select
* etc/ERC-NEWS: Announce deprecation of `erc-server-alist' and
`erc-server-select'.
* lisp/erc/erc-networks.el: Comment out call to `erc-get' at end of
file.
(erc-server-alist) Change shape to accommodate a fifth member: TLS
ports.  Add default TLS ports for Libera.Chat and OFTC.  Deprecate
option.
(erc-ports-list): Overload for internal use to accept a number instead
of a list, but don't advertise this fact.
(erc-networks--server-select): Convert `erc-server-select' into a
function that performs the same prompting but returns a full URL or a
host name instead of calling `erc'.
(erc-server-select): Move to erc.el.
* lisp/erc/erc.el (erc--prompt-for-server-functions): New variable to
allow callers of `erc-select-read-args' to affect how server-prompting
is handled without adding additional params.
(erc-select-read-args): Defer to `erc--prompt-for-server-function'
when non-nil.
(erc-server-select): New transplanted function, a deprecated, now
TSL-aware version of the old quirky entry point from erc-networks.el.
Reimplemented as a simple wrapper for `erc'.
* test/lisp/erc/erc-networks-tests.el (erc-ports-list): New test.
* test/lisp/erc/erc-tests.el (erc-server-select): New test.
(Bug#64478)
2023-07-13 18:45:31 -07:00
F. Jason Park
d0325e2309 Revert "Account for leading timestamps in erc-match"
This reverts commit 99d74dcd45 but keeps
the test file test/lisp/erc/erc-scenarios-match.el.  It also
implements a partial alternative solution by undoing the reordering of
insert hooks owned by the `stamp' and `match' modules.  The initial
reordering stems from d880a08f "Cement ordering of essential hook
members in ERC" and was intended to address the problem of timestamps
not being hidden in matched "fool" messages.  However, a more
comprehensive solution is being pursued as part of bug#64301.  The
following changes differ from those in a pure revert.

* erc/ERC-NEWS: Fix erroneous claim about relative hook ordering
pre-5.6.
* lisp/erc/erc-match.el (erc-match-mode, erc-match-enable): Lower hook
depth of `erc-match-message' in `erc-insert-modify-hook' from 60 to
50.
(erc-text-matched-hook): Retain cleaned-up portion of revised doc
string instead of reverting completely.
* lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable): Raise
depth of `erc-add-timestamp' in `erc-insert-modify-hook' and
`erc-send-modify-hook' from 50 to 60.
* test/lisp/erc/erc-scenarios-match.el
(erc-scenarios-match--stamp-left-current-nick
erc-scenarios-match--stamp-left-fools-invisible): Temporarily disable
the latter and fix expected hook ordering.
* test/lisp/erc/erc-tests.el (erc--essential-hook-ordering): Fix
expected order of default insert hooks.  (Bug#60936)
2023-07-03 07:30:32 -07:00
F. Jason Park
6ce957154b Redo erc-nickname-in-use-functions as a local module
* etc/ERC-NEWS: Mention new module `services-regain'.
* lisp/erc/erc-backend.el: Rename option.
* lisp/erc/erc-services.el (erc-services-regain-alist): Strategies for
regaining a lost nickname on reconnect.  This option, in addition to
the rest of these changes, is a redo of
`erc-nickname-in-use-functions' from commit 8c0c9826 "Add hook to
regain nickname in ERC", which originally stemmed from bug#62044.
(erc-services-retry-nick-on-connect, erc-services-issue-regain,
erc-services-issue-ghost-and-retry-nick): New function variants for
`erc-services-regain-alist.
(erc-services-regain-mode, erc-services-regain-enable,
erc-services-regain-disable): New local module to activate
nick-regaining behavior.
(erc--nickname-in-use-make-request): New method, a services-specific
implementation.
* lisp/erc/erc.el (erc--nickname-in-use-make-request): New generic
function to request alternate nick when first choice is rejected.
(erc-nickname-in-use): Call `erc--nickname-in-use-make-request' to
request alternate nick.
* test/lisp/erc/erc-scenarios-services-misc.el
(erc-scenarios-services-misc--reconnect-retry-nick): Adopt renamed
version of `erc-scenarios-base-renick-auto-regain'.
(erc-scenarios-services-misc--regain-command,
erc-scenarios-services-misc--ghost-and-retry-nick): New tests.
* test/lisp/erc/resources/services/regain/reconnect-retry-again.eld:
New test data file reusing existing blob c0529052 that once lived at
resources/base/renick/regain/normal-again.eld.
* test/lisp/erc/resources/services/regain/reconnect-retry.eld: New
test data file reusing existing blob 9f4df70e5 that once lived at
resources/base/renick/regain/normal.eld.
* test/lisp/erc/resources/services/regain/taken-ghost.eld: New test
data file.
* test/lisp/erc/resources/services/regain/taken-regain.eld New test
data file.
2023-07-01 07:21:30 -07:00
F. Jason Park
d2a7b0c76d Revert "Allow erc-reuse-frames to favor connections"
This (mostly) reverts commit 0e4c07dc74.

* etc/ERC-NEWS: Also revert hunk from 52c8d537 "* etc/ERC-NEWS: Add
section for ERC 5.6." because it announced this feature, which no
longer exists.
* lisp/erc/erc.el (erc-reuse-frames): Revise doc string instead of
reverting completely.  (Bug#62833)
2023-06-25 16:26:40 -07:00
F. Jason Park
2daa71f932 Don't insert prompt input before markers in ERC
* etc/ERC-NEWS: Update entry in 5.6 section announcing a persistent
prompt.
* lisp/erc/erc-dcc.el (erc-dcc-chat-setup): Use helper
`erc--initialize-markers' to set up prompt.
* lisp/erc/erc.el (erc--initialize-markers): Change
`erc-insert-marker' type to t.  Do this to spare modules that want to
remember the current message location from resorting to workarounds,
like leaving a marker one char before the end of a message, which is
not foolproof.
(erc--refresh-prompt): Temporarily change type of `erc-insert-marker'
when inserting prompt.
(erc-display-line-1): Insert incoming message normally instead of
forcing before markers, thus respecting markers left by third parties.
Strictly speaking, this is a breaking change.
(erc-display-msg): Insert normally instead of calling
`insert-before-markers', which was a regression introduced by 05f6fdb9
"Preserve ERC prompt and its bounding markers".
* test/lisp/erc/erc-dcc-tests.el
(erc-dcc-tests--dcc-handle-ctcp-send,
erc-dcc-tests--erc-dcc-do-GET-command): Use helper to initialize
prompt and markers.
* test/lisp/erc/erc-networks-tests.el
(erc-networks--ensure-announced,
erc-networks--rename-server-buffer--existing--reuse,
erc-networks--rename-server-buffer--existing--noreuse,
erc-networks--rename-server-buffer--reconnecting,
erc-networks--rename-server-buffer--id,
erc-networks--rename-server-buffer--existing--live,
erc-networks--rename-server-buffer--local-match,
erc-networks--rename-server-buffer--local-nomatch): Use helper to
initialize prompt and bounding markers.
* test/lisp/erc/erc-stamp-tests.el (erc-stamp-tests--insert-right):
Use `erc--initialize-markers' for setting up prompt.
* test/lisp/erc/erc-tests.el (erc--refresh-prompt): Adjust assertions
for expected prompt content.  (Bug#60936)
2023-06-11 20:14:08 -07:00
F. Jason Park
d880a08f95 Cement ordering of essential hook members in ERC
* etc/ERC-NEWS: Add new section explaining the pinning of certain hook
members owned by built-in modules to fixed depths.
* lisp/erc/erc-button.el (erc-button-mode, erc-button-enable): Change
hook depth for `erc-button-add-buttons' from 90 to 30.
* lisp/erc/erc-fill.el (erc-fill-mode, erc-fill-enable): Change hook
depth for `erc-fill' from 0 to 40.
* lisp/erc/erc-match.el (erc-match-mode, erc-match-enable): Change
hook depth for `erc-match-message' from 90 to 60.
* lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable): Change
hook depth for `erc-add-timestamp' from 90 to 50.
* test/lisp/erc/erc-tests.el
(erc-tests--assert-printed-in-subprocess): Add fixture for testing a
form printed from a subprocess.
(erc--find-mode, erc--essential-hook-ordering): Use helper in existing
and new tests, respectively.  (Bug#60936)
2023-06-11 19:55:11 -07:00
F. Jason Park
e560f9af8e Allow ERC modules to extend erc-nick-popup-alist
* etc/ERC-NEWS: Mention changes to `erc-button-alist' and superficial
changes to `erc-nick-popup-alist'.
* lisp/erc/erc-button.el (erc-nick-popup-alist): Change type to prefer
associating strings with functions instead of arbitrary sexps.
(erc-button-cmd-KICK, erc-button-cmd-MSG): New functions to serve as
interrogative wrappers for `erc-cmd-KICK' and `erc-cmd-MSG' in
`erc-nick-popup-alist'.  The first also fixes a bug in which all but
the first token of a given "reason" would be omitted from the
":trailing" portion of an outgoing "KICK" message.
(erc-button--nick-popup-alist): New variable to help built-in modules
expose special actions to `erc-nick-popup' without touching
`erc-nick-popup-alist'.
(erc-nick-popup): Present members from both `erc--nick-popup-alist'
and `erc-nick-popup-alist' to the invoking user.  Accommodate
functions as well as arbitrary sexps.  (bug#63569)
2023-06-11 19:18:14 -07:00
F. Jason Park
a4df748329 Prefer emacs-news-mode in etc/ERC-NEWS
* etc/ERC-NEWS: Remove `outline' from prop line and prefer
`emacs-news-mode' in local variables list.
* lisp/erc/erc.el (erc-news): Overwrite cached file and ask before
re-fetching.
2023-06-11 19:18:14 -07:00
F. Jason Park
31a80f61ec Preserve prompt in erc-cmd-CLEAR
* etc/ERC-NEWS: Mention behavioral changes to functionality provided
by the `truncate' and `log' modules and also the "/CLEAR" command.
* lisp/erc/erc-log.el (erc-truncate-buffer-on-save): Deprecate option
because three's a crowd, and ERC already has a dedicated module as
well as a slash command for this purpose.  And although this commit
restores functionality, this option has been unusable since at least
the release of ERC 5.5, with no known complaints received thus far.
Also, the doc string of `erc-save-buffer-in-logs' makes no mention of
this feature WRT interactive invocations or otherwise.
(erc-log-mode, erc-log-enable, erc-log-disable): Subscribe to
new internal hook `erc--pre-clear-functions'.
(erc-log--save-in-progress-p): New variable to help restore
`erc-truncate-buffer-on-save' and promote code reuse.
(erc-logging-enabled): Guard with `erc-log--saved-in-progress-p'.
(erc-save-buffer-in-logs): Overload `buffer' parameter to allow
various hooks to supply a non-buffer as well.  Warn when people use
`erc-truncate-buffer-on-save', which is now deprecated.
* lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable,
erc-stamp-disable): Subscribe to `erc--pre-clear-functions'.
(erc-stamp--update-saved-position): New function for updating
last-logged marker on `erc-stamp--insert-date-function'.
(erc-stamp--reset-on-clear): New function to forget last inserted
stamps when truncating.
* lisp/erc/erc-truncate.el (erc-truncate-mode, erc-truncate-enable,
erc-truncate-disable): Use `erc-insert-done-hook' instead of
`erc-insert-post-hook', as implicitly suggested by an ancient comment,
which ponders whether truncating the buffer at the insertion phase may
be harmful to other hook members.
(erc-truncate-buffer-to-size): Set truncation boundary at message
break instead of line break.  Run `erc--pre-clear-functions'.
(erc-truncate-buffer): Save excursion.  This should probably be
handled by `erc-truncate-buffer-to-size' instead, but that's
likelier to cause breakage in third-party code.
* lisp/erc/erc.el (erc--pre-clear-functions): New internal hook.
(erc-cmd-CLEAR): Run `erc--pre-clear-functions' before clearing, and
don't blow away prompt.  The latter was a regression caused by
05f6fdb9e7 "Preserve ERC prompt and its bounding markers".
* test/lisp/erc/erc-scenarios-log.el: New file.  (Bug#60936)
2023-05-29 21:46:23 -07:00
F. Jason Park
8bef8a5566 Simplify erc-tab interface
* etc/ERC-NEWS: Improve section mentioning `erc-tab'.
* lisp/erc/erc-button.el (erc-button-alist): Restore a commented out
version of the "<URL ...>" entry, which was dropped in 5adda2f468
"Revise FORM-as-function interface in erc-button-alist" for being
redundant.  This may help unlikely objectors better adapt to the
churn.
(erc-button-next, erc-button-previous): Don't bother accommodating raw
prefix arguments; expect numeric arguments only.
* lisp/erc/erc.el (erc-tab): Change interactive spec to lowercase
"p".  (Bug#60933)
2023-05-29 21:42:41 -07:00
F. Jason Park
8a149966dd Add command to view ERC-NEWS
* etc/ERC-NEWS: Mention `erc-news' command.
* lisp/erc/erc.el (erc--news-url, erc--news-temp-file, erc-news): Add
new command and supporting variable.
2023-05-29 21:42:37 -07:00
F. Jason Park
8120f5156c ; Silence byte compiler in erc-netsplit-JOIN
* etc/ERC-NEWS: Partially revert edit from c9f1ad2a87 "Revive option
erc-query-on-unjoined-chan-privmsg".
* lisp/erc/erc-netsplit.el (erc-netsplit-JOIN): Silence byte compiler
warning re ignored return value from `delete' when removing nicks.
Could probably suppress rather than reconstitute since the CAR of an
`erc-netsplit-list' entry originates from the trailing "reason" param
of the instigating "QUIT" command and should look something like
"irc.example.org chat.example.org", which cannot be confused for a
nickname.
* test/lisp/erc/resources/erc-scenarios-common.el: Fix wording in
Commentary.
2023-05-21 18:59:33 -07:00
F. Jason Park
75a412d78b Optionally add spacing between ERC messages
* etc/ERC-NEWS: Mention option `erc-fill-line-spacing'.
* lisp/erc/erc-fill.el (erc-fill-line-spacing,
erc-fill-spaced-commands): Add options to allow for extra spacing
between messages.
(erc-fill--function): Internal var allowing modules to override user
option `erc-fill-function'.
(erc-fill): Add extra line-spacing on certain types of messages.
Prefer `erc-fill--function', when set, over `erc-fill-function'.
(erc-fill--make-module-dependency-msg,
erc-fill--wrap-ensure-dependencies): Rename former to latter and make
more useful.
(erc-fill-wrap-mode, erc-fill-wrap-enable, erc-fill-wrap-disable):
Refactor.
(erc-fill--wrap-fix): Remove unused function.
(erc-fill-wrap-nudge): Remove reference to nonexistent function in doc
string.
* test/lisp/erc/erc-fill-tests.el: (erc-fill-tests--graphic-dir): New
variable.
(erc-fill-tests--compare): Look in `erc-fill-tests--graphic-dir' for
graphical snapshots ignored by Git.
(erc-fill-line-spacing): New test.
* test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: New
file.  (Bug#60936)
2023-05-13 07:05:22 -07:00
F. Jason Park
5adda2f468 Revise FORM-as-function interface in erc-button-alist
* lisp/erc/erc-button.el (erc-button-alist): Remove redundant "<URL:
foo>" entry, which adds nothing beyond highlighting the surrounding
bookends at the expense of doubling up on face properties for no
reason.  Revise the FORM-as-function interface by removing the dynamic
binding of face options and treating all implementers as replacements
for `erc-button-add-button'.
(erc-button--maybe-warn-arbitrary-sexp): Make more robust by having it
handle all accepted FORM types other than booleans.
(erc-button-add-buttons-1): Rework to only check FORM field once.
(erc-button--substitute-command-keys-in-region,
erc-button--display-error-with-buttons): Rename former as latter and
change signature to conform to new `erc-button-add-buttons' interface.
(erc-button--display-error-notice-with-keys): Call renamed helper.
* test/lisp/erc/erc-button-tests.el (erc-button-alist--url,
erc-button-tests--form, erc-button-tests--some-var,
erc-button-tests--erc-button-alist--function-as-form,
erc-button-alist--function-as-form,
erc-button-tests--erc-button-alist--nil-form,
erc-button-alist---nil-form): Add tests and helpers.  (Bug#60933)
2023-05-05 17:18:01 -07:00
F. Jason Park
35dd1ade7f Preprocess prompt input linewise in ERC
* etc/ERC-NEWS: Mention revised role of `erc-pre-send-functions'
relative to line splitting.
* lisp/erc/erc-common.el (erc-input): Add new slot `refoldp' to allow
`erc-pre-send-functions' members to indicate that splitting should
occur a second time after all members have had their say.
(erc--input-split): Specify some defaults for overridden slots and
explicitly declare some types for good measure.
* lisp/erc/erc-goodies.el (erc-noncommands-mode,
erc-noncommands-enable, erc-noncommands-disable): Replace
`erc-pre-send-functions' with `erc--input-review-functions'.
* lisp/erc/erc-ring.el (erc-ring-enable, erc-ring-disable,
erc-ring-mode): Subscribe to `erc--input-review-functions' instead of
`erc-pre-send-functions' for `erc--add-to-input-ring'.
* lisp/erc/erc.el (erc-pre-send-functions): Note some nuances
regarding line splitting in doc string and note that a new slot is
available.
(erc--pre-send-split-functions, erc--input-review-functions): Rename
former to latter, while also obsoleting.  Remove large comment.  Add
new default member `erc--run-input-validation-checks'.
(erc-send-modify-hook): Replace the obsolete `erc-send-pre-hook' and
`erc-send-this' with `erc-pre-send-functions' in doc string.
(erc--check-prompt-input-for-excess-lines): Don't trim trailing
blanks.  Rework to also report overages in characters as well as
lines.
(erc--run-input-validation-hooks): New function to adapt an
`erc--input-split' object to `erc--check-prompt-input-functions'.
(erc-send-current-line): Run `erc--input-review-functions' in place of
the validation hooks they've subsumed.  Call `erc--send-input-lines'
instead of the now retired but not deprecated `erc-send-input'.
(erc--run-send-hooks, erc--send-input-lines): New functions that
together form an alternate version of `erc-send-input'.  They operate
on input linewise but make accommodations for older interfaces.
* test/lisp/erc/erc-tests.el (erc-ring-previous-command): Replace
`erc-pre-send-functions' with `erc--input-review-functions'.
(erc-tests--with-process-input-spy): Shadow
`erc--input-review-functions'.
(erc-check-prompt-input-for-excess-lines): Don't expect trailing
blanks to be trimmed.
(erc--run-send-hooks): New test.  (Bug#62947)
2023-05-05 17:18:01 -07:00
F. Jason Park
2e18ba6302 Simplify erc-button movement commands
* etc/ERC-NEWS: Mention TAB being bound to new command `erc-tab' and
`erc-previous-button' now stopping at the start of buttons.
* lisp/erc/erc-button.el (erc-button-mode, erc-button-enable,
erc-button-disable): Add and remove `erc-button-next' to
`erc--tab-functions' hook, which is tantamount to binding the command
in the read-only area of an ERC buffer.
(erc-button-next-function): Deprecate and remove from client code path
because this module doesn't concern itself with prompt input and thus
no longer needs to conform to the `completion-at-point-functions'
interface.
(erc-button--prev-next-predicate-functions): New variable, a hook to
determine whether to continue searching for a button.  Other modules
should utilize this as needed.
(erc-button--end-of-button-p): Add function to serve as default value
for `erc-button--continue-predicate'.
(erc--button-next): Add generalized button-movement function.
(erc-button-next, erc-button-previous): Make `erc-button-previous'
behave more predictably by having it land at the beginning of buttons.
And remove roundabout appeal to HOF in `erc-button-next'.
(erc-button-previous-of-nick): New command to jump to previous
appearance of nick at point.
* lisp/erc/erc-fill.el (erc-fill-wrap, erc-fill-wrap-enable,
erc-fill-wrap-disable): Add and remove merge-related hookee from
`erc-button--prev-next-predicate-functions'.
(erc-fill--wrap-merged-button-p): New function to detect redundant
speakers.
* lisp/erc/erc.el (erc-complete-functions): Quote TAB in doc string.
(erc-mode-map): Bind `erc-tab' to TAB.
(erc--tab-functions, erc-tab): Add new command and hook to serve as
unified dispatch for TAB-related operations.  It calls `c-a-p' in the
input area and defers to module code in the read-only message area.
* test/lisp/erc/erc-button-tests.el: New file.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--wrap-populate): Run
finalizer for transient keymap timer.
* test/lisp/erc/erc-tests.el
(erc-button--display-error-notice-with-keys): Move to new dedicated
test file for erc-button and fix expected behavior of
`erc-button-previous'.  (Bug#62834)
2023-05-05 17:18:01 -07:00
F. Jason Park
5de90fa961 Extend erc-interactive-display to cover /JOINs
* lisp/erc/erc.el (erc-display): Mention that buffer-related display
options live in the customization group `erc-buffers'.
(erc-buffer-display, erc-join-buffer): Swap alias and aliased so that
the favored name, `erc-buffer-display', appears in the definition and
in the Customize menu.  Also note related buffer-display options in
the doc string.
(erc-query-display, erc-interactive-display): Make the former an alias
of the latter, new in ERC 5.6, because their roles were functionally
redundant and thus confusing.  Inherit the default value from
`erc-query-display' because users are more familiar with the pop-up
window behavior than a single-window replacement.
(erc-reconnect-display): Use preferred name for cross-referencing
fallback option `erc-buffer-display' in doc string, and explain how
/reconnect handling differs.
(erc--setup-buffer-hook): Add new internal hook for modules that
operate on windows and frames, such as erc-speedbar and
erc-status-sidebar.
(erc-open): Run `erc--setup-buffer-hook' after `erc-setup-buffer' so
hook members know their code isn't tied to `erc-setup-buffer' itself,
which may be used in other contexts, but rather to a new ERC buffer on
which some display-related action has just been performed.
(erc--called-as-input-p): New variable for "slash" commands, like
`erc-cmd-FOO', to detect whether they're being called "interactively"
as a result of input given at ERC's prompt.
(erc-process-input-line): Bind `erc--called-as-input-p' when running
slash commands.
(erc-cmd-JOIN): When called interactively, schedule a callback to wrap
the response handler and control how new buffers are thus displayed.
(erc-cmd-QUERY): Use preferred alias for `erc-query-display'.
* test/lisp/erc/erc-scenarios-base-buffer-display.el:
(erc-scenarios-base-buffer-display--interactive-default): New test.
* test/lisp/erc/erc-tests.el (erc-process-input-line,
erc-select-read-args, erc-tls, erc--interactive): Change expected
default value of `erc-interactive-display' from `buffer' to
`window'.  (Bug#62833)
2023-05-05 17:18:01 -07:00
F. Jason Park
c9f1ad2a87 Revive option erc-query-on-unjoined-chan-privmsg
* etc/ERC-NEWS: Mention reinstated and renamed legacy option
`erc-query-on-unjoined-chan-privmsg' as well as a change in behavior
for `erc-auto-query', when nil.  Also fix erroneous ChangeLog
reference in 5.5 section.
* lisp/erc/erc-backend.el (erc-server-PRIVMSG): Consider flag
`erc-receive-query-display-defer' and revived option
`erc-query-unjoined-chan-privmsg' when deciding whether to create a
new query buffer.  And only "open" a buffer for an unknown target when
the latter option is non-nil.
* lisp/erc/erc.el (erc-cmd-QUERY): Make error more informative.
(erc-query): Revise deprecation message.
(erc-auto-query, erc-receive-query-display): Swap alias and aliased
and add option to `erc-buffers' group.  Mention the nonstandard
meaning of nil and update package-version to signify a behavioral
change, even though the default value remains untouched.
(erc-receive-query-display-defer): Add new variable, a compatibility
switch to access legacy behavior for `erc-auto-query'.
(erc-query-on-unjoined-chan-privmsg,
erc-ensure-target-buffer-on-privmsg): Revise doc string and add alias.
Change package-version to ERC 5.6 due to slightly refined meaning.
* test/lisp/erc/erc-scenarios-base-attach.el: New file.
* test/lisp/erc/resources/base/channel-buffer-revival/reattach.eld:
New file.  (Bug#62833)
2023-05-05 17:18:01 -07:00
F. Jason Park
52c8d5371e * etc/ERC-NEWS: Add section for ERC 5.6. 2023-04-08 14:23:51 -07:00
F. Jason Park
1e9484f2fd ; * etc/ERC-NEWS: Mention more deprecations. 2023-03-03 05:33:33 -08:00
F. Jason Park
4eac80fcc3 ; Prepare to update ERC version to 5.5
* 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.
2023-02-14 08:25:00 -08:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
F. Jason Park
2ddc480f44 Warn of absent networks module in ERC
* 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.)
2022-12-28 06:51:38 -08:00
F. Jason Park
9ac80e8a6e Add dedicated auth-source section in ERC manual
* 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.
2022-12-14 06:40:55 -08:00
F. Jason Park
ed8862c404
Add non-IRCv3 SASL module to ERC
* 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.
2022-11-23 21:14:25 -05:00
F. Jason Park
4c4936fab2
Support local ERC modules in erc-mode buffers
* 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.)
2022-11-23 19:56:31 -05:00
F. Jason Park
ed5022b4ee Improve new connections in erc-handle-irc-url
* 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.)
2022-11-16 21:34:36 -08:00
F. Jason Park
8721e87a6e ; * etc/ERC-NEWS: Mention move to erc-common.el. 2022-11-04 19:32:23 -07:00
F. Jason Park
132d5cb0a3 Bury new ERC buffers by default
* lisp/erc/erc.el (erc-join-buffer): Change default value to `bury'.
(erc-setup-buffer): Make `window-noselect' behave more like its
description and abstain from ever replacing the current buffer.
* test/lisp/erc/erc-scenarios-base-reconnect.el
(erc-scenarios-common-base-reconnect-options): Update helper to handle
new default value for option `erc-join-buffer'.
(erc-scenarios-base-reconnect-options--buffer): Update and rename
function `erc-scenarios-base-reconnect-options--default'.
(erc-scenarios-base-reconnect-options--default): Update and rename
function `erc-scenarios-base-reconnect-options--bury'.
* etc/ERC-NEWS: Update existing display-buffers section for 5.5.
(Bug#51753)
2022-09-19 17:54:46 -07:00
F. Jason Park
01de334c78 Offer to regexp-quote new items in erc-match commands
* lisp/erc/erc-match.el (erc-match-quote-when-adding) Add new option
to quote new items added to match lists.
(erc-add-entry-to-list): Add optional `alt' parameter indicating
whether to flip the behavior indicated by
`erc-match-quote-when-adding'.
(erc-add-pal, erc-add-fool, erc-add-keyword, erc-add-dangerous-host):
Pass universal arg to `erc-add-entry-to-list' as `alt' argument.
(erc-match-pal-p, erc-match-fool-p, erc-match-keyword-p,
erc-match-dangerous-host-p): Don't bother matching when list is nil.

* lisp/erc/erc.el (erc-list-match (lst str): Join input list as regexp
union instead of looping over items.

* etc/ERC-NEWS: Update misc-UX section for 5.5.

* test/lisp/erc/erc-match-tests.el: New file. (Bug#56450)
2022-09-19 17:54:46 -07:00
F. Jason Park
85c2f3bc3e Update ERC's Info doc with network-ID related changes
* doc/misc/erc.texi: Update the `erc' and `erc-tls' entry-point
sections with the new :id keyword parameter.  Expand the auth-info
related information in the passwords section.  Remove all mention of
the variable `erc-rename-buffers', whose "on" behavior has been made
permanent.

* etc/ERC-NEWS: Add new section for future 5.5 release.
2022-06-30 15:19:53 -07:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Amin Bandali
ca3d7234d3
Release ERC 5.4.1
* doc/misc/erc.texi (ERCVER): Bump to 5.4.1.
* etc/ERC-NEWS: Add entry for 5.4.1 with explanations.
* lisp/erc/erc.el (Version, erc-version): Bump to 5.4.1.
(customize-package-emacs-version-alist): Add entry for 5.4.1.
2021-10-15 16:51:59 -04:00
Amin Bandali
a1a589d07b
* etc/ERC-NEWS: Announce ERC's addition to GNU ELPA. 2021-10-11 10:25:08 -04:00
Amin Bandali
6c7947f0a1
* etc/ERC-NEWS: Fix outline level for the recent additions. 2021-10-11 10:13:56 -04:00
Amin Bandali
8865fc02ab
Add 'erc-bug' command for reporting ERC bugs
* etc/ERC-NEWS: Announce the new command, and mention it at the top of
the file along with 'report-emacs-bug'.
* lisp/erc/erc.el (erc-bug): New command for reporting ERC bugs.  It
prompts for a subject, and passes it on to 'report-emacs-bug' along
with the current ERC version, with the ERC mailing list in Cc.
2021-10-06 23:02:09 -04:00
Amin Bandali
bc941846d9
Small tweaks and improvements to etc/ERC-NEWS
* etc/ERC-NEWS: Small tweaks inspired by etc/NEWS, namely to add a
descriptive blurb at the top of the file to explain what it is about
and how to report ERC bugs, add a form feed before the section for
every release, and set the same Local Variables that etc/NEWS does.
2021-10-06 21:35:43 -04:00
Amin Bandali
30b5e0a514
Add NEWS items for changes to ERC since 5.3 to etc/ERC-NEWS
* etc/ERC-NEWS: copy ERC NEWS items from etc/NEWS, etc/NEWS.27,
etc/NEWS.26, etc/NEWS.25, and etc/NEWS.24 to here.  Future ERC NEWS
are also to be added here.  This is in motivated by preparation for
addition of ERC to GNU ELPA, along with the ERC manual and NEWS.
* etc/NEWS: remove ERC-related entries, and refer the reader to
ERC-NEWS instead.
2021-10-06 21:17:33 -04:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Paul Eggert
26bed8ba10 Update copyright year to 2019
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
2019-01-01 01:01:13 +00:00
Paul Eggert
5c7dd8a783 Update copyright year to 2018
Run admin/update-copyright.
2018-01-01 00:57:59 -08:00
Paul Eggert
bc511a64f6 Prefer HTTPS to FTP and HTTP in documentation
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
2017-09-13 15:54:37 -07:00
Paul Eggert
5badc81c1c Update copyright year to 2017
Run admin/update-copyright.
2016-12-31 19:42:26 -08:00
Paul Eggert
acae275b27 ; Spelling fixes 2016-11-04 14:50:59 -07:00
Paul Eggert
0e963201d0 Update copyright year to 2016
Run admin/update-copyright.
2016-01-01 01:34:24 -08:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00