emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d5f6e911a99 3/7: Use format-prompt in erc-select-read-args


From: F. Jason Park
Subject: master d5f6e911a99 3/7: Use format-prompt in erc-select-read-args
Date: Sun, 31 Dec 2023 10:07:49 -0500 (EST)

branch: master
commit d5f6e911a99157d79bc900a1a8719298575dad74
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>

    Use format-prompt in erc-select-read-args
    
    * lisp/erc/erc-button.el (erc-button-cmd-KICK, erc-button-cmd-MSG):
    Use `read-string' instead of `read-from-minibuffer'.
    * lisp/erc/erc.el (erc-select-read-args): Use `format-prompt', which
    isn't normally available in Emacs 27 without Compat.
---
 lisp/erc/erc-button.el |  4 ++--
 lisp/erc/erc.el        | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index c290e76843c..3d7cfee907a 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -761,11 +761,11 @@ In server buffers, also prompt for a channel."
                                       (erc-get-channel-user nick)))
                           t nil t (caar targets))))
    nick
-   (read-from-minibuffer "Reason: ")))
+   (read-string "Reason: ")))
 
 (defun erc-button-cmd-MSG (nick)
   "Prompt for a message to NICK, and send it via `erc-cmd-MSG'."
-  (let ((msg (read-from-minibuffer (concat "Message to " nick ": "))))
+  (let ((msg (read-string (concat "Message to " nick ": "))))
     (erc-cmd-MSG (concat nick " " msg))))
 
 (defvar-local erc-button--nick-popup-alist nil
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index f6962910da0..f80c8cbf295 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2642,7 +2642,7 @@ With prefix arg, also prompt for user and full name."
   (let* ((input (let ((d (erc-compute-server)))
                   (if erc--prompt-for-server-function
                       (funcall erc--prompt-for-server-function)
-                    (read-string (format "Server or URL (default is %S): " d)
+                    (read-string (format-prompt "Server or URL" d)
                                  nil 'erc-server-history-list d))))
          ;; For legacy reasons, also accept a URL without a scheme.
          (url (url-generic-parse-url (erc--ensure-url input)))
@@ -2651,27 +2651,27 @@ With prefix arg, also prompt for user and full name."
          (port (or (url-portspec url)
                    (erc-compute-port
                     (let ((d (erc-compute-port sp))) ; may be a string
-                      (read-string (format "Port (default is %s): " d)
+                      (read-string (format-prompt "Port" d)
                                    nil nil d)))))
          ;; Trust the user not to connect twice accidentally.  We
          ;; can't use `erc-already-logged-in' to check for an existing
          ;; connection without modifying it to consider USER and PASS.
          (nick (or (url-user url)
                    (let ((d (erc-compute-nick)))
-                     (read-string (format "Nickname (default is %S): " d)
+                     (read-string (format-prompt "Nickname" d)
                                   nil 'erc-nick-history-list d))))
          (user (and current-prefix-arg
                     (let ((d (erc-compute-user (url-user url))))
-                      (read-string (format "User (default is %S): " d)
+                      (read-string (format-prompt "User" d)
                                    nil nil d))))
          (full (and current-prefix-arg
                     (let ((d (erc-compute-full-name (url-user url))))
-                      (read-string (format "Full name (default is %S): " d)
+                      (read-string (format-prompt "Full name" d)
                                    nil nil d))))
          (passwd (let* ((p (with-suppressed-warnings ((obsolete erc-password))
                              (or (url-password url) erc-password)))
                         (m (if p
-                               (format "Server password (default is %S): " p)
+                               (format-prompt "Server password" p)
                              "Server password (optional): ")))
                    (if erc-prompt-for-password (read-passwd m nil p) p)))
          (opener (and (or sp (eql port erc-default-port-tls)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]