[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 2d3ae5d5e68 03/37: Add subcommand erc-cmd-HELP handler to erc-dcc
From: |
F. Jason Park |
Subject: |
master 2d3ae5d5e68 03/37: Add subcommand erc-cmd-HELP handler to erc-dcc |
Date: |
Sat, 8 Apr 2023 17:31:27 -0400 (EDT) |
branch: master
commit 2d3ae5d5e68a21e51105168b1d9503f28e9e98c3
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
Add subcommand erc-cmd-HELP handler to erc-dcc
* lisp/erc/erc-compat.el (erc-compat--28-split-string-shell-command,
erc-compat--split-string-shell-command): New functions introduced in
Emacs 28 for splitting pcomplete input.
* lisp/erc/erc-dcc.el (erc-cmd-DCC): Elect to tokenize line specially.
(erc-dcc--cmd-help): Add help handler. (Bug#62444.)
---
lisp/erc/erc-compat.el | 22 ++++++++++++++++++++++
lisp/erc/erc-dcc.el | 8 ++++++++
2 files changed, 30 insertions(+)
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
index 5601ede27a5..e6ae62d3a2e 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/erc/erc-compat.el
@@ -409,6 +409,28 @@ If START or END is negative, it counts from the end."
(cons '("\\`irc6?s?://" . erc-compat--29-browse-url-irc)
existing))))))
+
+;;;; Misc 28.1
+
+(defvar comint-file-name-quote-list)
+(defvar shell-file-name-quote-list)
+(declare-function shell--parse-pcomplete-arguments "shell" nil)
+
+(defun erc-compat--28-split-string-shell-command (string)
+ (require 'comint)
+ (require 'shell)
+ (with-temp-buffer
+ (insert string)
+ (let ((comint-file-name-quote-list shell-file-name-quote-list))
+ (car (shell--parse-pcomplete-arguments)))))
+
+(defmacro erc-compat--split-string-shell-command (string)
+ ;; Autoloaded in Emacs 28.
+ (list (if (fboundp 'split-string-shell-command)
+ 'split-string-shell-command
+ 'erc-compat--28-split-string-shell-command)
+ string))
+
(provide 'erc-compat)
;;; erc-compat.el ends here
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index 4c557e0e0f9..70683a92ffc 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -404,8 +404,16 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
(apropos "erc-dcc-do-.*-command")
t))))
+(put 'erc-cmd-DCC 'do-not-parse-args t)
(autoload 'pcomplete-erc-all-nicks "erc-pcomplete")
+;;;###autoload(put 'erc-cmd-DCC 'erc--cmd-help 'erc-dcc--cmd-help)
+(defun erc-dcc--cmd-help (&rest args)
+ (describe-function
+ (or (and args (intern-soft (concat "erc-dcc-do-"
+ (upcase (car args)) "-command")))
+ 'erc-cmd-DCC)))
+
;;;###autoload
(defun pcomplete/erc-mode/DCC ()
"Provide completion for the /DCC command."
- master 5011554529b 12/37: Don't require erc-goodies in erc.el, (continued)
- master 5011554529b 12/37: Don't require erc-goodies in erc.el, F. Jason Park, 2023/04/08
- master 0e4c07dc744 36/37: Allow erc-reuse-frames to favor connections, F. Jason Park, 2023/04/08
- master 89815631f24 10/37: Copy over upstream Compat macros to erc-compat, F. Jason Park, 2023/04/08
- master 9aa2806fdc3 13/37: Modify erc-mode-map in module definitions, F. Jason Park, 2023/04/08
- master 8793874616f 26/37: Adjust some old text properties in ERC buffers, F. Jason Park, 2023/04/08
- master 3d81ecf0a95 11/37: Leverage loaddefs for migrating ERC modules, F. Jason Park, 2023/04/08
- master 9f6a9cef97b 29/37: Put display properties to better use in erc-stamp, F. Jason Park, 2023/04/08
- master e3c4a648d16 31/37: Add variant for erc-match invisibility spec, F. Jason Park, 2023/04/08
- master c104e90888a 35/37: Make auth-source erc-services tests more readable, F. Jason Park, 2023/04/08
- master 0c3a069ae00 30/37: Convert erc-fill minor mode into a proper module, F. Jason Park, 2023/04/08
- master 2d3ae5d5e68 03/37: Add subcommand erc-cmd-HELP handler to erc-dcc,
F. Jason Park <=