Re: repeat
"J.P." <[email protected]> Tue, 02 Jan 2024 06:54:41 -0800
| Newsgroups | gmane.emacs.erc.general |
|---|---|
| Message-ID | <[email protected]> |
Emanuel Berg writes: > J.P. wrote: > >> But what about something more general, like something resembling >> >> previous-matching-history-element >> next-matching-history-element >> >> and/or >> >> previous-complete-history-element >> next-complete-history-element >> >> from simple.el? >> >> Folks are already used to these interfaces Sorry, I guess by "general" I actually meant something rather specific, namely, input completion in a manner people are already accustomed to. > (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." > (let ((num (or (and n (string-to-number n)) 0))) > (if (and erc-input-ring > (< (1+ num) (ring-length erc-input-ring)) ) > (progn > (ring-remove erc-input-ring 0) > (erc-send-input (ring-ref erc-input-ring num)) > (ring-remove erc-input-ring 0) ) > (message "No data") ))) It looks like /R requires knowing the relative location of a message in your history. Perhaps that's reasonable if you can spot it at a glance and not have to scroll back too far. But much like with interactive command-line programs, query output can amount to many screenfuls. It also looks like this fires off messages immediately. For updates/mutations, it might be nice to have some sort of visual confirmation before actually sending. FWIW, the completion/recall functions I mentioned up thread provide such feedback and are likely on par with /R in terms of keystroke economy. Overall, it seems like this is almost meant to cater to a narrower set of users with more selective needs or a more specific purpose (like interacting with a bot you have intimate knowledge of). I do think completion- and/or search-based history recall would be a great addition to ERC because many users could quickly benefit. But as for recalling and sending together in one shot? Not so sure. Can you describe situations in which this might prove useful? And can you explain how previous/next completion/search style commands like those I've suggested don't measure up? Or, if unwilling, can you at least point to a command similar to /R offered by a popular standalone client and/or find other people willing to express interest in this general flavor of recall?