Function: erc-keep-place-move

erc-keep-place-move is an interactive and byte-compiled function defined in erc-goodies.el.gz.

Signature

(erc-keep-place-move POS)

Documentation

Move keep-place indicator to current line or POS.

For use with keep-place-indicator module. When called interactively, interpret POS as an offset. Specifically, when POS is a raw prefix arg, like (4), move the indicator to the window's last line. When it's the minus sign, put it on the window's first line. Interpret an integer as an offset in lines.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-goodies.el.gz
(defun erc-keep-place-move (pos)
  "Move keep-place indicator to current line or POS.
For use with `keep-place-indicator' module.  When called
interactively, interpret POS as an offset.  Specifically, when
POS is a raw prefix arg, like (4), move the indicator to the
window's last line.  When it's the minus sign, put it on the
window's first line.  Interpret an integer as an offset in lines."
  (interactive
   (progn
     (unless erc-keep-place-indicator-mode
       (user-error "`erc-keep-place-indicator-mode' not enabled"))
     (list (pcase current-prefix-arg
             ((and (pred integerp) v)
              (save-excursion
                (let ((inhibit-field-text-motion t))
                  (forward-line v)
                  (point))))
             (`(,_) (1- (min erc-insert-marker (window-end))))
             ('- (min (1- erc-insert-marker) (window-start)))))))
  (save-excursion
    (let ((inhibit-field-text-motion t))
      (when pos
        (goto-char pos))
      (when-let* ((pos (erc--get-inserted-msg-beg)))
        (goto-char pos))
      (run-hooks 'erc--keep-place-move-hook)
      (move-overlay erc--keep-place-indicator-overlay
                    (line-beginning-position)
                    (line-end-position)))))