* doc/misc/erc.texi: Add new section under "Integrations" chapter
describing `display-buffer' Custom function choice for ERC's many
buffer-display options.
* etc/ERC-NEWS: Mention new function variant for all buffer-display
options.
* lisp/erc/erc-backend.el: Add forward declaration for
`erc--called-as-input-p' and `erc--display-context'.
(erc--server-reconnect-display-timer,
erc--server-last-reconnect-display-reset): Use new name for option
`erc-reconnect-display', now `erc-auto-reconnect-display'.
(erc--server-determine-join-display-context): New generic function to
determine value of `erc--display-context' during JOINs.
(erc-server-JOIN, erc-server-PRIVMSG): Set `erc--display-context' to a
symbol for the handler's IRC command, like `JOIN', for the benefit of
custom `display-buffer'-like functions running in `erc-setup-buffer'.
(erc-server-471, erc-server-471-functions, erc-server-473,
erc-server-473-functions): New handlers for JOIN rejections. Also
remove 471 and 473 from comment at bottom of file.
(erc-server-475): Bind `erc--called-as-input-p' so that `erc-cmd-JOIN'
sets `erc-interactive-display' context.
* lisp/erc/erc-join.el (erc-autojoin-mode, erc-autojoin-enable,
erc-autojoin-disable): Kill local variable
`erc-join--requested-channels'. Add and remove
`erc-join--remove-requested-channels' to/from various server-handler
hooks for JOIN rejection numerics.
(erc-join--requested-channels): New local variable to remember
channels we've attempted to JOIN this session that haven't yet been
confirmed by the server.
(erc-join--remove-requested-channel): New JOIN rejection handler to
stop tracking channel in `erc-join--requested-channels'.
(erc--server-determine-join-display-context): module-specific
implementation of generic function for `erc-autojoin-mode'.
(erc-autojoin--join): Remember channels slated for JOIN'ing.
* lisp/erc/erc.el (erc--buffer-display-choices): New helper constant
for defining common `:type' for all buffer-display options.
(erc-buffer-display, erc-interactive-display,
erc-auto-reconnect-display, erc-receive-query-display): Use helper
`erc--buffer-display-choices' for defining `:type', which
includes a new choice for a `display-buffer'-like function.
(erc-reconnect-display, erc-auto-reconnect-display): Alias former to
latter, now the preferred name.
(erc-reconnect-timeout, erc-auto-reconnect-timeout): Change name from
former to latter. This option is new in ERC 5.6.
(erc-reconnect-display-server-buffers): New option.
(erc-buffer-do): Revise doc string.
(erc--display-context): New variable, an alist of "context tokens" to
be forwarded as the "action alist" to `erc-buffer-display' functions.
(erc-skip-displaying-selected-window-buffer): New variable, deprecated
at birth, to act as an escape hatch for folks who don't want to skip
the displaying of buffers already showing in the selected window.
(erc--display-buffer-overriding-action): Local variable allowing
modules to influence the displaying of new ERC buffers independently
of user options.
(erc-setup-buffer): Do nothing when the selected window already shows
current buffer unless user has provided a custom display function.
Accommodate new Custom choice function values, like `display-buffer'
and `pop-to-buffer'.
(erc-open): Run `erc-setup-buffer' when option
`erc-reconnect-display-server-buffers' is non-nil, even for existing
server buffers. Bind `display-buffer-overriding-action' to the value
of `erc--display-buffer-overriding-action' around calls to
`erc-setup-buffer'.
(erc-select-read-args): Add `erc--display-context' to environment.
(erc, erc-tls): Bind `erc--display-context' around calls to
`erc-select-read-args' and main body.
(erc-cmd-JOIN, erc-cmd-QUERY, erc--cmd-reconnect, erc-handle-irc-url):
Add item for `erc-interactive-display' to `erc--display-context'.
(erc-connection-established): Update name of
`erc-reconnect-display-timeout' to
`erc-auto-reconnect-display-timeout'.
(erc-message-english-s471, erc-message-english-s473): New variables,
format templates for JOIN rejection messages.
* test/lisp/erc/erc-scenarios-base-buffer-display.el
(erc-scenarios-base-buffer-display--defwin-recbury-intbuf,
erc-scenarios-base-buffer-display--defwino-recbury-intbuf,
erc-scenarios-base-buffer-display--count-reset-timeout): Use preferred
name `erc-auto-reconnect-display' for `erc-reconnect-display'.
* test/lisp/erc/erc-scenarios-join-display-context.el: New file.
* test/lisp/erc/erc-tests.el (erc--initialize-markers): Fix
unrealistic call to `erc-open'.
(erc-setup-buffer--custom-action): New test.
(erc-select-read-args, erc-tls, erc--interactive, erc-server-select):
Expect new environment binding for `erc--display-context'.
* test/lisp/erc/resources/join/buffer-display/mode-context.eld: New
file. (Bug#62833)
* lisp/erc/erc-join.el (erc-autojoin-channels-alist): In ERC 5.4, the
type of this option changed to accept symbols signifying IRC network
names. However, the option's definition was not updated to reflect
that. See commit 9bb8d90cdd "Allow irc network symbols in
erc-autojoin-channels-alist".
* lisp/erc/erc.el (erc-password): Deprecate variable only used by
`erc-select-read-args'. Server passwords are primarily used as
surrogates for other forms of authentication. Such use is common but
nonstandard and often discouraged in favor of the de facto standard,
SASL. Folks in the habit of invoking `erc(-tls)' interactively should
be encouraged to use auth-source instead.
(erc-select-read-args): Before this change, `erc-select-read-args'
offered to use the value of a non-nil `erc-password' as the :password
argument for `erc' and `erc-tls', referring to it as the "default"
password. And when `erc-prompt-for-password' was nil and
`erc-password' wasn't, the latter was passed along unconditionally.
This only further complicated an already confusing situation for new
users, who in most cases shouldn't be worried about sending a PASS
command at all. Until SASL arrives, they should provide server
passwords manually or learn to use auth-source.
(erc-auth-source-server-function, erc-auth-source-join-function): New
user options for retrieving a password externally, ostensibly by
calling `auth-source-search'.
(erc--auth-source-determine-params-defaults): New helper for
`erc--auth-source-search' with potential for exporting publicly in the
future. Favors :host and :port fields above others. Prioritizes
network IDs over announced servers and dialed endpoints.
(erc--auth-source-determine-params-merge): Add new function for
merging contextual and default parameters. This is another contender
for possible exporting.
(erc--auth-source-search): New function for consulting auth-source and
sorting the result as filtered and prioritized by the previously
mentioned helpers.
(erc-auth-source-search): New function to serve as default
value for auth-source query-function options.
(erc-server-join-channel): Use user option for consulting auth-source
facility. Also accept nil for first argument (instead of server).
(erc-cmd-JOIN): Use above-mentioned facilities when joining new
channel. Omit server when calling `erc-server-join-channel'. Don't
filter target buffers twice. Don't call `switch-to-buffer', which
would create phantom buffers with names like target/server that were
never used. IOW, only switch to existing target buffers.
(erc--compute-server-password): Add new helper function for
determining password.
(erc-open, erc-determine-parameters): Move password figuring from the
first to the latter.
* lisp/erc/erc-services.el
(erc-auth-source-services-function): Add new option for consulting
auth-source in a NickServ context.
(erc-nickserv-get-password): Pass network-context ID, when looking up
password in `erc-nickserv-passwords' and when formatting prompt for
user input.
(erc-nickserv-passwords): Add comment to custom option definition type
tag.
* test/lisp/erc/erc-services-tests.el: Add new test file for above
changes. For now, stash auth-source-related tests here until a
suitable home can be found.
* lisp/erc/erc-join.el (erc-autojoin--join): Don't pass session-like
entity from `erc-autojoin-channels-alist' match to
`erc-server-join-channel'. Allow that function to decide for itself
which host to look up if necessary.
* test/lisp/erc/resources/base/auth-source/foonet.eld: New file.
* test/lisp/erc/resources/base/auth-source/nopass.eld: New file.
* test/lisp/erc/resources/erc-scenarios-common.el: New file.
* test/lisp/erc/resources/services/auth-source/libera.eld: New file.
* test/lisp/erc/erc-scenarios-auth-source.el: New file.
* test/lisp/erc/erc-scenarios-base-reuse-buffers.el: New file.
* test/lisp/erc/erc-scenarios-join-auth-source.el: New file.
* test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld: New file.
* test/lisp/erc/resources/base/reuse-buffers/channel/foonet.eld: New file.
* test/lisp/erc/resources/join/auth-source/foonet.eld: New file.
(Bug#48598)
* lisp/erc/erc-join.el (erc-autojoin-server-match): Favor network
identities, falling back on old definition.
(erc-autojoin--join): Add new helper containing common code from
hookees `erc-autojoin-after-ident' and `erc-autojoin-channels'.
(erc-autojoin-after-ident, erc-autojoin-channels): No longer make a
point of returning nil because the hooks they're registered on,
`erc-nickserv-identified-hook' and `erc-after-connect', don't stop on
success.
(erc-autojoin--mutate): Add helper for `erc-autojoin-add' and
`erc-autojoin-remove'.
(erc-autojoin-add, erc-autojoin-remove): Favor given network
identities, over networks, when matching keys for
`erc-autojoin-channels-alist'.
* test/lisp/erc/erc-scenarios-base-reconnect.el: New file.
* test/lisp/erc/erc-scenarios-join-netid-newcmd-id.el: New file.
* test/lisp/erc/erc-scenarios-join-netid-newcmd.el: New file.
* test/lisp/erc/erc-scenarios-join-netid-recon-id.el: New file.
* test/lisp/erc/erc-scenarios-join-netid-recon.el: New file.
* test/lisp/erc/resources/erc-scenarios-common.el: New file.
* test/lisp/erc/resources/join/legacy/foonet.eld: New file.
* test/lisp/erc/resources/join/network-id/barnet.eld: New file.
* test/lisp/erc/resources/join/network-id/foonet-again.eld: New file.
* test/lisp/erc/resources/join/network-id/foonet.eld: New file.
* test/lisp/erc/resources/join/reconnect/foonet-again.eld: New file.
* test/lisp/erc/resources/join/reconnect/foonet.eld: New file.
* lisp/erc/erc.el (erc-default-recipients, erc-default-target):
Explain that the variable has fallen out of favor and that the
function may have been used historically by third-party code for
detecting channel subscription status, even though that's never been
the case internally since at least the adoption of version control.
Recommend newer alternatives.
(erc--current-buffer-joined-p): Add possibly temporary predicate for
detecting whether a buffer's target is a joined channel. The existing
means are inconsistent, as discussed in bug#48598. The mere fact that
they are disparate is unfriendly to new contributors. For example, in
the function `erc-autojoin-channels', the `process-status' of the
`erc-server-process' is used to detect whether a buffer needs joining.
That's fine in that specific situation, but it won't work elsewhere.
And neither will checking whether `erc-default-target' is nil, so
long as `erc-delete-default-channel' and friends remain in play.
(erc-add-default-channel, erc-delete-default-channel, erc-add-query,
erc-delete-query): Deprecate these helpers, which rely on an unused
usage variant of `erc-default-recipients'.
* lisp/erc/erc-services.el: remove stray `erc-default-recipients'
declaration.
* lisp/erc/erc-backend.el (erc-server-NICK, erc-server-JOIN,
erc-server-KICK, erc-server-PART): wrap deprecated helpers to suppress
warnings.
* lisp/erc/erc-join.el (erc-autojoin-channels): Use helper to detect
whether a buffer needs joining. Prefer this to server liveliness, as
explained above.
* lisp/erc/erc-join.el (erc-autojoin-channels-alist): Explain the
extension.
(erc-autojoin-server-match): New function.
(erc-autojoin-channels): Use it.
(erc-autojoin-current-server): New function.
(erc-autojoin-add): Use it.
(erc-autojoin-remove): Ditto.
This can be useful when connecting to an IRC proxy like Weechat that
relays several networks under the same server. If we just keyed on the
server name, we would end up joining a channel on all networks
whenever we join one network on that server.
Networks are simply stored as symbols instead of regexes, since that's
how `erc-network' works.
The `erc-autojoin-add' function will still auto-add servers as strings
if the network doesn't have at least one entry in
`erc-autojoin-channels-alist'.
Also remove various redundant `:group` arguments.
* lisp/erc/erc-backend.el (define-erc-response-handler): Move `declare`
after the docstring.
* lisp/erc/erc-capab.el: Use lexical-binding.
(erc-capab-identify-activate): Simplify with `member`.
* lisp/erc/erc-dcc.el (erc-dcc): Move before erc-dcc-mode definition,
which refers to it.
(erc-dcc-chat-accept): Remove unused vars `nick` and `buffer`.
* lisp/erc/erc-imenu.el: Use lexical-binding.
(erc-create-imenu-index): Remove unused var `prev-pos`.
* lisp/erc/erc-match.el: Use lexical-binding.
(erc-match-message): Remove unused var `old-pt`.
(erc-match-message): Strength-reduce `eval` to `symbol-value`.
* lisp/erc/erc-page.el: Use lexical-binding.
(erc-page): Move Custom group before `erg-page-mode` which refers to it.
* lisp/erc/erc-replace.el: Use lexical-binding.
(erc-replace-insert): Use `functionp`.
* lisp/erc/erc-status-sidebar.el: Use lexical-binding.
(erc-status-sidebar-open): Remove unused var `sidebar-window`.
* lisp/erc/erc.el: Fix header to use the customary 3 semi-colons.
(erc-fill-column): Declare variable.
* lisp/erc/erc-autoaway.el: Use lexical-binding.
* lisp/erc/erc-ezbounce.el: Use lexical-binding.
* lisp/erc/erc-fill.el: Use lexical-binding.
* lisp/erc/erc-goodies.el: Use lexical-binding.
* lisp/erc/erc-ibuffer.el: Use lexical-binding.
* lisp/erc/erc-identd.el: Use lexical-binding.
* lisp/erc/erc-join.el: Use lexical-binding.
* lisp/erc/erc-lang.el: Use lexical-binding.
* lisp/erc/erc-log.el: Use lexical-binding.
* lisp/erc/erc-menu.el: Use lexical-binding.
* lisp/erc/erc-netsplit.el: Use lexical-binding.
* lisp/erc/erc-networks.el: Use lexical-binding.
* lisp/erc/erc-pcomplete.el: Use lexical-binding.
* lisp/erc/erc-ring.el: Use lexical-binding.
* lisp/erc/erc-speedbar.el: Use lexical-binding.
* lisp/erc/erc-spelling.el: Use lexical-binding.
* lisp/erc/erc-truncate.el: Use lexical-binding.
* lisp/erc/erc-xdcc.el: Use lexical-binding.
* lisp/erc/erc.el (erc-generate-new-buffer-name): Fixes behavior 1,
also determines if the '#channel/server' buffer already exists
and will reuse that buffer when joining on the same
server. Additionally when creating a new buffer with
'#channel/serverB', the existing buffer '#channel' on 'severA' will be
renamed to '#channel/serverA' for the sake of consistency (bug#40121).
* lisp/erc/erc-join.el (erc-autojoin-channels): The logic is
simplified ensuring that when autojoining channels specified in
erc-autojoin-channels-alist, if there exists an erc buffer with the
same channel name but a different server, it will create a new buffer
to join the channel. The current logic is very weak that will skip
joining same channel on different servers altogether.
By the definition of erc-reuse-buffers, if non-nil it should create a
new buffer when joining channels with same names on different
servers. The current behavior of erc-reuse-buffers is:
1. when non-nil, it will always reuse the same channel buffer,
resulting in server A's channel gets reconnected to the channel with
the same name of server B.
2. when nil, the buffer-name of the joined channel is
'#channel/server'. However if one tries to '/join #channel' from the
server buffer, it creates a new empty buffer with buffer-name
'#channel', instead of opening the already-joined channel buffer.
Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is
no special maintainer for a file. Although this wasn't documented
it was common practice and removing the lines didn't have consensus.
63b04c11d5 Fix copyright years by hand
5c7dd8a783 Update copyright year to 2018
220a9ecba1 Merge from Gnulib
312c565566 Don't add empty keyboard macro to macro ring (Bug#24992)
39ca289a7a Allow customization of decoding of "man" command
f8240815ea * etc/NEWS: Add security consideration note on passphrase ...
0c78822c70 Fix subtle problem with scroll-down when scroll-margin is ...
acd289c5a4 Fix problems with indexing in User manual
b240c7846b * lisp/help.el (describe-key): Only (copy-sequence elt) wh...
e879a5444a * src/buffer.c (Frestore_buffer_modified_p): Fix bug#29846
81b1028b63 Improve documentation of 'inhibit-modification-hooks' and ...
7175496d7a Fix doc string of 'enable-recursive-minibuffers'
5b38406491 Fix documentation of delsel and of killing text
# Conflicts:
# etc/NEWS
# etc/refcards/ru-refcard.tex
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.
Bug#25349
* lisp/erc/erc-join.el (erc-autojoin-after-ident): Switch order of
server names.
(erc-autojoin-channels, erc-autojoin-add, erc-autojoin-remove):
Likewise.
(erc-server-join-channel): Move to erc.el.
* lisp/erc/erc.el (erc-server-join-channel): Move from erc-join.el.
(erc-cmd-JOIN): Use erc-server-join-channel.
* lisp/erc/erc-track.el, lisp/erc/erc-networks.el, lisp/erc/erc-netsplit.el:
* lisp/erc/erc-dcc.el, lisp/erc/erc-backend.el: Use cl-lib, nth, pcase, and
called-interactively-p instead of cl.
* lisp/erc/erc-speedbar.el, lisp/erc/erc-services.el:
* lisp/erc/erc-pcomplete.el, lisp/erc/erc-notify.el, lisp/erc/erc-match.el:
* lisp/erc/erc-log.el, lisp/erc/erc-join.el, lisp/erc/erc-ezbounce.el:
* lisp/erc/erc-capab.el: Don't require cl since we don't use it.
* lisp/erc/erc.el: Use cl-lib, nth, pcase, and called-interactively-p i.s.o cl.
(erc-lurker-ignore-chars, erc-common-server-suffixes): Move before first use.
* lisp/json.el: Don't require cl since we don't use it.
* lisp/color.el: Don't require cl.
(color-complement): `caddr' -> `nth 2'.
* test/automated/ert-x-tests.el: Use cl-lib.
* test/automated/ert-tests.el: Use lexical-binding and cl-lib.
* lisp/erc/erc-join.el (erc-server-join-channel): New function to look up
the channel password via auth-source.
(erc-autojoin-channels): Use it.
(erc-autojoin-after-ident): Ditto.
(erc-autojoin-channels-alist): Mention auth-source.
* lisp/erc/erc-backend.el (erc-coding-system-precedence):
* lisp/erc/erc-join.el (erc-autojoin-delay, erc-autojoin-timing):
Add missing :version settings.
* etc/NEWS: We don't need to duplicate the doc-strings of variables.