]> git.eshelyaron.com Git - emacs.git/commit
Add erc-fill style based on visual-line-mode
authorF. Jason Park <jp@neverwas.me>
Fri, 13 Jan 2023 08:00:56 +0000 (00:00 -0800)
committerF. Jason Park <jp@neverwas.me>
Sat, 8 Apr 2023 21:23:51 +0000 (14:23 -0700)
commit4b56739547c93598d420c44dc7ae89129ccd912a
tree964fefdefce560f3db1f7de562a9103eae176e83
parente3c4a648d166600fa507caaca3efbbc7f9a6d12f
Add erc-fill style based on visual-line-mode

* lisp/erc/erc-fill.el (erc-fill-function): Add new value
`erc-fill-wrap'.
(erc-fill-static-center): Extend meaning of option to also affect
`erc-wrap-mode'.
(erc-fill--wrap-value, erc-fill--wrap-visual-keys): New variables to
support new local module.
(erc-fill-wrap-visual-keys): New option to control how and where
`visual-line-mode' keys are active.
(erc-fill-wrap-merge): Add option for omitting a speaker's name if
they just now spoke.  Enabled by default.
(erc-fill--wrap-move): New helper function for fill-wrap movement
commands.
(erc-fill--wrap-kill-line, erc-fill--wrap-beginning-of-line,
erc-fill--wrap-end-of-line): New movement commands.
(erc-fill-wrap-cycle-visual-movement): New command to cycle local
copy of `erc-fill-wrap-visual-keys'.
(erc-fill-wrap-mode-map): New keymap based on `visual-line-mode-map'.
(erc-fill--make-module-dependency-msg): Helper for
`erc-fill-wrap-enable'.
(erc-fill-wrap-mode, erc-fill-wrap-enable, erc-fill-wrap-disable): New
local module.
(erc-fill--wrap-length-function): Internal interface in the form of a
function variable for other modules to control the fill-wrap overhang.
(erc-fill--wrap-last-msg, erc-fill--wrap-max-lull,
erc-fill--wrap-continued-message-p): Add items to support hiding of
redundant speaker names in consecutive messages.
(erc-fill--wrap-stamp-insert-prefixed-date): New function to add
`line-prefix' property to inserted date stamp.
(erc-fill-wrap): New function implementing the
`erc-fill-function' (behavioral) interface.
(erc-fill--wrap-fix): New, possibly temporary function for other
modules to fix misalignment caused by fill-wrap.
(erc-fill-wrap-nudge, erc-fill--wrap-nudge): New command and helper
for growing and shrinking visual fill prefix.
* test/lisp/erc/erc-fill-tests.el: New file.  (Bug#60936.)
* test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: New file.
* test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: New file.
* test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld: New file.
* test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld: New file.
* test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld: New file.
* test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld: New file.
lisp/erc/erc-fill.el
test/lisp/erc/erc-fill-tests.el [new file with mode: 0644]
test/lisp/erc/resources/fill/snapshots/merge-01-start.eld [new file with mode: 0644]
test/lisp/erc/resources/fill/snapshots/merge-02-right.eld [new file with mode: 0644]
test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld [new file with mode: 0644]
test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld [new file with mode: 0644]
test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld [new file with mode: 0644]
test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld [new file with mode: 0644]