diff options
| author | F. Jason Park | 2023-10-02 22:59:22 -0700 |
|---|---|---|
| committer | F. Jason Park | 2023-10-13 07:47:00 -0700 |
| commit | 1950ddebacb73fdc17ebec4da24d74b628c3e0ae (patch) | |
| tree | 8d80dea1c389a0f0dedd3915d87b4b5bf804d225 /lisp/erc | |
| parent | d46c016fbd09cbce9ef23fe2b49d4fb5fc3b2b16 (diff) | |
| download | emacs-1950ddebacb73fdc17ebec4da24d74b628c3e0ae.tar.gz emacs-1950ddebacb73fdc17ebec4da24d74b628c3e0ae.zip | |
Allow spoofing process marker in erc-display-line-1
* lisp/erc/erc.el (erc--insert-marker): New internal variable for
overriding `erc-insert-marker' when displaying messages at a
non-default location in the buffer.
(erc-display-line-1): Favor `erc--insert-marker' over
`erc-insert-marker' when non-nil.
; * test/lisp/erc/resources/base/assoc/multi-net/barnet.eld: Timeouts.
; * test/lisp/erc/resources/base/assoc/multi-net/foonet.eld: Timeouts.
; * test/lisp/erc/resources/base/netid/bouncer/barnet-drop.eld: Timeouts.
; * test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld: Timeouts.
; * test/lisp/erc/resources/erc-d/resources/dynamic-foonet.eld: Timeouts.
; * test/lisp/erc/resources/sasl/scram-sha-1.eld: Timeouts.
; * test/lisp/erc/resources/sasl/scram-sha-256.eld: Timeouts.
Diffstat (limited to 'lisp/erc')
| -rw-r--r-- | lisp/erc/erc.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 87abe2a133b..79b4544a3e4 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -2925,6 +2925,9 @@ this option to nil." | |||
| 2925 | (delete-region (point) (1- erc-input-marker)))) | 2925 | (delete-region (point) (1- erc-input-marker)))) |
| 2926 | (run-hooks 'erc--refresh-prompt-hook))) | 2926 | (run-hooks 'erc--refresh-prompt-hook))) |
| 2927 | 2927 | ||
| 2928 | (defvar erc--insert-marker nil | ||
| 2929 | "Internal override for `erc-insert-marker'.") | ||
| 2930 | |||
| 2928 | (defun erc-display-line-1 (string buffer) | 2931 | (defun erc-display-line-1 (string buffer) |
| 2929 | "Display STRING in `erc-mode' BUFFER. | 2932 | "Display STRING in `erc-mode' BUFFER. |
| 2930 | Auxiliary function used in `erc-display-line'. The line gets filtered to | 2933 | Auxiliary function used in `erc-display-line'. The line gets filtered to |
| @@ -2948,6 +2951,8 @@ If STRING is nil, the function does nothing." | |||
| 2948 | (format "%s" buffer))) | 2951 | (format "%s" buffer))) |
| 2949 | (setq erc-insert-this t) | 2952 | (setq erc-insert-this t) |
| 2950 | (run-hook-with-args 'erc-insert-pre-hook string) | 2953 | (run-hook-with-args 'erc-insert-pre-hook string) |
| 2954 | (setq insert-position (marker-position (or erc--insert-marker | ||
| 2955 | erc-insert-marker))) | ||
| 2951 | (if (null erc-insert-this) | 2956 | (if (null erc-insert-this) |
| 2952 | ;; Leave erc-insert-this set to t as much as possible. Fran | 2957 | ;; Leave erc-insert-this set to t as much as possible. Fran |
| 2953 | ;; Litterio <franl> has seen erc-insert-this set to nil while | 2958 | ;; Litterio <franl> has seen erc-insert-this set to nil while |
| @@ -2970,7 +2975,8 @@ If STRING is nil, the function does nothing." | |||
| 2970 | '(erc-parsed nil)))) | 2975 | '(erc-parsed nil)))) |
| 2971 | (erc--refresh-prompt))))) | 2976 | (erc--refresh-prompt))))) |
| 2972 | (run-hooks 'erc-insert-done-hook) | 2977 | (run-hooks 'erc-insert-done-hook) |
| 2973 | (erc-update-undo-list (- (or (marker-position erc-insert-marker) | 2978 | (erc-update-undo-list (- (or (marker-position (or erc--insert-marker |
| 2979 | erc-insert-marker)) | ||
| 2974 | (point-max)) | 2980 | (point-max)) |
| 2975 | insert-position)))))) | 2981 | insert-position)))))) |
| 2976 | 2982 | ||