Function: erc-send-current-line
erc-send-current-line is an interactive and byte-compiled function
defined in erc.el.gz.
Signature
(erc-send-current-line)
Documentation
Parse current line and send it to IRC.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-send-current-line ()
"Parse current line and send it to IRC."
(interactive)
(let ((now (current-time)))
(if (or (not erc-accidental-paste-threshold-seconds)
(time-less-p erc-accidental-paste-threshold-seconds
(time-subtract now erc-last-input-time)))
(save-restriction
;; If there's an abbrev at the end of the line, expand it.
(when (and abbrev-mode
(eolp))
(expand-abbrev))
(widen)
(let* ((str (erc-user-input))
(state (erc--make-input-split str)))
(run-hook-with-args 'erc--input-review-functions state)
(when-let* (((not (erc--input-split-abortp state)))
(inhibit-read-only t)
(erc--current-line-input-split state)
(old-buf (current-buffer)))
(progn ; unprogn this during next major surgery
(erc-set-active-buffer (current-buffer))
;; Kill the input and the prompt
(delete-region erc-input-marker (erc-end-of-input-line))
(unwind-protect
(erc--send-input-lines (erc--run-send-hooks state))
;; Fix the buffer if the command didn't kill it
(when (buffer-live-p old-buf)
(with-current-buffer old-buf
(setq buffer-undo-list nil)
;; `set-buffer-modified-p' used to do this here.
(force-mode-line-update))))
;; Only when last hook has been run...
(run-hook-with-args 'erc-send-completed-hook str)))
(setq erc-last-input-time now)))
(switch-to-buffer "*ERC Accidental Paste Overflow*")
(lwarn 'erc :warning
"You seem to have accidentally pasted some text!"))))