;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/erc/erc-misc.el (require 'erc-ring) (defun erc-sort-list (col) "Use after /list. Sort table by column COL. A negative value will reverse the result after sorting." (interactive (list (read-number "column [- to reverse]: " -2))) (let ((colu (abs col)) (buffer-read-only nil) (beg (point-min)) (end (point-max))) (if (= colu 1) (sort-fields colu beg end) (sort-numeric-fields colu beg end)) (when (< col 0) (reverse-region beg end)) (goto-char beg))) (defun erc-cmd-R (&optional n) "Resend the most recent or Nth `erc' message/command. The most recent message, the default, has index N = 0." (or n (setq n 0)) (if (and erc-input-ring (< (1+ n) (ring-length erc-input-ring))) (progn (ring-remove erc-input-ring 0) (erc-send-input (ring-ref erc-input-ring n)) (ring-remove erc-input-ring 0)) (message "No data"))) (provide 'erc-misc)