summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2022-03-21 05:40:16 -0700
committerF. Jason Park <jp@neverwas.me>2022-06-30 15:19:53 -0700
commitf46547294d2684d80bb473bd4c85f273ff661a7d (patch)
tree9957e4f497d0588560cad7639441e0b01ca8b123 /test/lisp/emacs-lisp
parenta9d89d083ac5bf0b9fd5568d42e565aba0b6e13f (diff)
downloademacs-f46547294d2684d80bb473bd4c85f273ff661a7d.tar.gz
emacs-f46547294d2684d80bb473bd4c85f273ff661a7d.tar.bz2
emacs-f46547294d2684d80bb473bd4c85f273ff661a7d.zip
Improve ERC's handling of multiline prompt input
* lisp/erc/erc.el (erc--pre-send-split-functions): Add new internal hook allowing members to revise individual lines before sending. This was created with an eye toward possibly exporting it publicly as a customizable option. (erc-last-input-time): Tweak meaning of variable to match likely original intent, which is that it's only updated on successful calls to `erc-send-current-line'. (erc--discard-trailing-multiline-nulls): Conditionally truncate list of lines to be sent, skipping trailing blanks. This constitutes a behavioral change. But, considering the nature of the bug being fixed, it is thought to be justified. (erc--input-split): Add new internal struct containing split input lines and flag for command detection. (erc--input-line-delim-regexp): Add regex var for splitting multiline prompt input. (erc--blank-in-multiline-p): Add helper for detecting blank lines. (erc--check-prompt-input-for-multiline-blanks, erc--check-prompt-input-for-point-in-bounds, erc--check-prompt-input-for-running-process): New functions to encapsulate logic for various pre-flight idiot checks. (erc--check-prompt-input-functions): Add new hook for validating prompt input prior to clearing it, internal for now. (erc-send-current-line): Pre-screen for blank lines and bail out if necessary. (erc-send-input): Add optional param to skip checking for blank lines. Call hook `erc--pre-send-split-functions'. * test/lisp/erc/erc-tests.el (erc-ring-previous-command): Use new test helper. (erc--input-line-delim-regexp, erc--blank-in-multiline-input-p): Add tests. (erc-tests--send-prep, erc-tests--set-fake-server-process, erc-tests--with-process-input-spy): Add test helpers. (erc--check-prompt-input-functions, erc-send-current-line, erc-send-whitespace-lines): Add tests. (Bug#54536)
Diffstat (limited to 'test/lisp/emacs-lisp')
0 files changed, 0 insertions, 0 deletions