]> git.eshelyaron.com Git - emacs.git/commit
Improve erc-fill-wrap-merge refilling and movement
authorF. Jason Park <jp@neverwas.me>
Fri, 12 Apr 2024 07:04:50 +0000 (00:04 -0700)
committerEshel Yaron <me@eshelyaron.com>
Sat, 20 Apr 2024 11:09:11 +0000 (14:09 +0300)
commitfc767893f318880b25d907e1cc2f146ece4b59ee
tree136203fe2aae86b5173b77d53e1ddb75b6b1da70
parent05af9c8ec9838dc55af4ecaf86dda686c031181c
Improve erc-fill-wrap-merge refilling and movement

* lisp/erc/erc-fill.el (erc-fill--wrap-escape-hidden-speaker): Add
parameter to suppress escaping of hidden prefixes.
(erc-fill--wrap-beginning-of-line): Remember original value of point,
and pass it to `erc-fill--wrap-escape-hidden-speaker'.
(erc-fill--wrap-previous-line, erc-fill--wrap-next-line): Guard call
to `erc-fill--wrap-escape-hidden-speaker' with conditional check for
`erc-fill-wrap-merge'.
(erc-fill--wrap-insert-merged-pre): Add additional text property,
`erc-fill--wrap-merge', to help identify `display' regions servicing
`erc-fill-wrap-merge'.  This should make resolving inconsistencies
easier when "splicing" new messages between existing ones.
(erc-fill-wrap): Add `erc-fill--wrap-merge' text property to merged
speaker region.
(erc-fill--wrap-rejigger-region): Remove assertion disallowing a
non-nil `erc-fill--wrap-rejigger-last-message'.  Instead, adopt the
existing value of that variable when shadowing it for the remaining
extent of the function's execution.  When removing the `display'
property, also look for nonempty replacement text, such as values
specified by the option `erc-fill-wrap-merge-indicator'.
(erc-fill--wrap-merged-button-p): Look for `erc-fill--wrap-merge'
property instead of `display'.
* 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/merge-wrap-indicator-pre-01.eld:
Update.
* test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: Update.
(Bug#60936)

(cherry picked from commit 21b372a57bb0cab9ebdf93843090081eb4715030)
lisp/erc/erc-fill.el
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/merge-wrap-indicator-pre-01.eld
test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld