1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-05-10 15:25:04 -07:00
emacs/lisp/erc
F. Jason Park cf9728c4be Only perform erc-log-insert-log-on-open setup once
* etc/ERC-NEWS: Add entry for option `erc-log-insert-log-on-open'.
Mention deprecation of `erc-log-setup-logging'.
* lisp/erc/erc-log.el (erc-log-insert-log-on-open): Expand type from
boolean to choice of boolean, predicate, and new function item
`erc-log-new-target-buffer-p'.
(erc-log-mode, erc-log-enable, erc-log-disable): Replace
`erc-log-setup-logging' on `erc-connect-pre-hook' with
`erc-log--insert-log-on-open' at depth 80.  Replace calls to
`erc-log-setup-logging' with ones to `erc-log--setup'.
(erc-log-new-target-buffer-p): New function.  While the name could
perhaps do more to indicate that it's only useful when called from
`erc-open', that's the only place ERC typically sets up new target
buffers.
(erc-log-setup-logging): Deprecate and replace body with adapter that
calls `erc-log--setup' and `erc-log--insert-log-on-open'.
(erc-log--setup): New function whose body is mostly from the
"nondestructive" portion of `erc-log-setup-logging'.  Instead of moving
the `erc-saved-last-position' marker to the old value, expect it not to
have been initialized by `erc-initialize-log-marker' because
`erc-connect-pre-hook' now runs after this code, which is now
incorporated more judiciously into the module's "enable body".
(erc-log--insert-log-on-open): New function whose body is mostly from
the "destructive" portion of the previous incarnation of
`erc-log-setup-logging'.  Unlike the original, if option
`erc-log-insert-log-on-open' is a function, call it to decide whether to
insert a log file atop its buffer.  Also, don't advance the marker
`erc-last-saved-position' to the prompt area, where it can get stuck and
prevent logs from being saved when `erc-log-insert-log-on-open' is
non-nil.  Thanks to Libera user Lionyx for reporting the bug, which has
been around since at least ERC 5.4 and Emacs 28.1.
(erc-log-disable-logging): Remove `erc-save-buffer-in-logs' from
`write-file-functions' to undo its buffer-local addition in what is now
`erc--log-setup'.
* test/lisp/erc/erc-scenarios-log-options.el: New file.  (Bug#79665)
2026-04-30 15:46:42 -07:00
..
ChangeLog.1
ChangeLog.2
erc-autoaway.el
erc-backend.el
erc-button.el
erc-capab.el
erc-common.el
erc-compat.el
erc-dcc.el
erc-desktop-notifications.el
erc-ezbounce.el
erc-fill.el
erc-goodies.el
erc-ibuffer.el
erc-identd.el
erc-imenu.el
erc-join.el
erc-lang.el
erc-list.el
erc-log.el Only perform erc-log-insert-log-on-open setup once 2026-04-30 15:46:42 -07:00
erc-match.el
erc-menu.el
erc-netsplit.el
erc-networks.el
erc-nicks.el
erc-notify.el
erc-page.el
erc-pcomplete.el
erc-replace.el
erc-ring.el
erc-sasl.el
erc-services.el
erc-sound.el
erc-speedbar.el
erc-spelling.el
erc-stamp.el
erc-status-sidebar.el
erc-track.el
erc-truncate.el
erc-xdcc.el
erc.el