]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify erc-tab interface
authorF. Jason Park <jp@neverwas.me>
Tue, 23 May 2023 06:42:11 +0000 (23:42 -0700)
committerF. Jason Park <jp@neverwas.me>
Tue, 30 May 2023 04:42:41 +0000 (21:42 -0700)
* etc/ERC-NEWS: Improve section mentioning `erc-tab'.
* lisp/erc/erc-button.el (erc-button-alist): Restore a commented out
version of the "<URL ...>" entry, which was dropped in 5adda2f4683
"Revise FORM-as-function interface in erc-button-alist" for being
redundant.  This may help unlikely objectors better adapt to the
churn.
(erc-button-next, erc-button-previous): Don't bother accommodating raw
prefix arguments; expect numeric arguments only.
* lisp/erc/erc.el (erc-tab): Change interactive spec to lowercase
"p".  (Bug#60933)

etc/ERC-NEWS
lisp/erc/erc-button.el
lisp/erc/erc.el

index 5e5779cfcd5aedadda63d13837b722878d1ebb2b..c7d157eacfba4851654d1ff61c560c38bdf13e7a 100644 (file)
@@ -216,12 +216,12 @@ changes are encouraged to voice their concerns on the bug list.
 *** Miscellaneous changes
 Two helper macros from GNU ELPA's Compat library are now available to
 third-party modules as 'erc-compat-call' and 'erc-compat-function'.
-In the area of buttons, 'Info-goto-node' has been supplanted by plain
-old 'info' in 'erc-button-alist', and the bracketed "<URL:...>"
-pattern entry has been removed because it was more or less redundant.
-And the "TAB" key is now bound to a new command, 'erc-tab', that only
-calls 'completion-at-point' when point is in the input area and
-module-specific commands, like 'erc-button-next', otherwise.
+In 'erc-button-alist', 'Info-goto-node' has been supplanted by plain
+old 'info', and the "<URL:...>" entry has been removed because it was
+more or less redundant.  In all ERC buffers, the "<TAB>" key is now
+bound to a new command, 'erc-tab', that calls 'completion-at-point'
+inside the input area and otherwise dispatches module-specific
+commands, like 'erc-button-next'.
 
 \f
 * Changes in ERC 5.5
index 4307dc3b8604b307174cc43cb5402d4daa592ef9..33b93ff6744fd465d7bd87a837666d2c7d93262d 100644 (file)
@@ -128,6 +128,7 @@ longer than `erc-fill-column'."
   ;; things hard to maintain.
   '((nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0)
     (erc-button-url-regexp 0 t browse-url-button-open-url 0)
+    ;; ("<URL: *\\([^<> ]+\\) *>" 0 t browse-url-button-open-url 1)
 ;;; ("(\\(\\([^~\n \t@][^\n \t@]*\\)@\\([a-zA-Z0-9.:-]+\\)\\)" 1 t finger 2 3)
     ;; emacs internal
     ("[`‘]\\([a-zA-Z][-a-zA-Z_0-9!*<=>+]+\\)['’]"
@@ -629,15 +630,13 @@ greater than `point-min' with a text property of `erc-callback'.")
   "Go to the ARGth next button."
   (declare (advertised-calling-convention (arg) "30.1"))
   (interactive "p")
-  (setq arg (pcase arg ((pred listp) (prefix-numeric-value arg)) (_ arg)))
-  (erc--button-next arg))
+  (erc--button-next (or arg 1)))
 
 (defun erc-button-previous (&optional arg)
   "Go to ARGth previous button."
   (declare (advertised-calling-convention (arg) "30.1"))
   (interactive "p")
-  (setq arg (pcase arg ((pred listp) (prefix-numeric-value arg)) (_ arg)))
-  (erc--button-next (- arg)))
+  (erc--button-next (- (or arg 1))))
 
 (defun erc-button-previous-of-nick (arg)
   "Go to ARGth previous button for nick at point."
index aad6f7d9d5434a5b436b307b52911a79005cc34b..a84e38e70e534476c13767888feb37095b8e1dfb 100644 (file)
@@ -4773,11 +4773,11 @@ This places `point' just after the prompt, or at the beginning of the line."
   "Functions to try when user hits \\`TAB' outside of input area.
 Called with a numeric prefix arg.")
 
-(defun erc-tab (&optional arg)
+(defun erc-tab (arg)
   "Call `completion-at-point' when typing in the input area.
-Otherwise call members of `erc--tab-functions' with raw prefix
-ARG until one of them returns non-nil."
-  (interactive "P")
+Otherwise call members of `erc--tab-functions' with a numeric
+prefix ARG until one of them returns non-nil."
+  (interactive "p")
   (if (>= (point) erc-input-marker)
       (completion-at-point)
     (run-hook-with-args-until-success 'erc--tab-functions arg)))