]> git.eshelyaron.com Git - emacs.git/commit
Restore missing metadata props in erc-display-line
authorF. Jason Park <jp@neverwas.me>
Mon, 16 Oct 2023 00:22:22 +0000 (17:22 -0700)
committerF. Jason Park <jp@neverwas.me>
Fri, 20 Oct 2023 21:53:24 +0000 (14:53 -0700)
commit7ffc79690ad63a09bc5baf99cbbe56654302dc72
treeb4ffcccb41be08ac0dcca7e61545f26f84a80212
parenta74b5de31f676d3a106687a3b972901c22784bff
Restore missing metadata props in erc-display-line

* etc/ERC-NEWS: Designate `erc-display-message' as the favored means
of inserting messages.
* lisp/erc/erc-fill.el (erc-fill-wrap): Skip any `unknown' `erc-msg'.
* lisp/erc/erc-stamp.el (erc-stamp--current-time): Use an existing
`erc-ts' text property, when present, for the current message time.
* lisp/erc/erc.el (erc-display-line-1, erc-insert-line): Update doc
string and declare the former an obsolete alias for the latter,
`erc-insert-line'.  Have `erc-log' label say `erc-display-message'
even though this function is actually `erc-insert-line'.
(erc-display-line): Convert to a thin wrapper around
`erc-display-message', and move its existing body to a new internal
function, `erc--route-insertion'.
(erc--route-insertion): Adopt former body of `erc-display-line', now a
convenience wrapper around `erc-display-message'.  Copy
`erc--msg-props' hash table when inserting a message in multiple
buffers.  At present, only `erc-server-QUIT' uses this facility, so
such a move shouldn't impact performance in any measurable way.  Also,
improve readability with at most one recursive call for the
fall-through case.
(erc--compose-text-properties, erc--merge-text-properties-p): Rename
former to latter to avoid confusion with `composition' property.
(erc-display-message): Update doc string.  Attempt to adapt a non-nil
TYPE parameter for use as the value of the `erc-msg' text property
before resorting to a value of `unknown'.  But only do this when
PARSED is nil, and MSG is a string.  Call `erc--route-insertion'
instead of `erc-display-line'.  Use new name for
`erc--compose-text-properties'.
(erc-put-text-property): Update name of variable
`erc--compose-text-properties'.
* test/lisp/erc/erc-networks-tests.el (erc-networks--set-name): Mock
`erc--route-insertion' instead of `erc-display-line'.
* test/lisp/erc/erc-scenarios-display-message.el: New file.
* test/lisp/erc/erc-tests.el (erc--route-insertion): New test.
* test/lisp/erc/resources/base/display-message/multibuf.eld: New test
data.
; * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld: Update.
(Bug#60936)
17 files changed:
etc/ERC-NEWS
lisp/erc/erc-fill.el
lisp/erc/erc-stamp.el
lisp/erc/erc.el
test/lisp/erc/erc-networks-tests.el
test/lisp/erc/erc-scenarios-display-message.el [new file with mode: 0644]
test/lisp/erc/erc-tests.el
test/lisp/erc/resources/base/display-message/multibuf.eld [new file with mode: 0644]
test/lisp/erc/resources/fill/snapshots/merge-01-start.eld
test/lisp/erc/resources/fill/snapshots/merge-02-right.eld
test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld
test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld
test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld
test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld
test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld
test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld
test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld