aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2021-03-07 19:06:06 -0500
committerStefan Monnier2021-03-07 19:06:06 -0500
commitfb779e98572fe1a7a37dd6feed3cf08ee4ea7244 (patch)
tree42d83466a931b39648bd2c9e20cb0be0d859a1f3
parent42751f440dc46628ac09a522026f4ce41cada8d3 (diff)
downloademacs-fb779e98572fe1a7a37dd6feed3cf08ee4ea7244.tar.gz
emacs-fb779e98572fe1a7a37dd6feed3cf08ee4ea7244.zip
* lisp/erc/erc.el: Fix problem pointed out by compiler warning
[ Also use `read-string` instead of `read-from-minibuffer`. ] (erc-part-from-channel): Comment out improbable reference to the formal argument from within the interactive spec.
-rw-r--r--lisp/erc/erc.el44
1 files changed, 21 insertions, 23 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 4d45ac29bab..939113acc52 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2144,15 +2144,15 @@ parameters SERVER and NICK."
2144(defun erc-select-read-args () 2144(defun erc-select-read-args ()
2145 "Prompt the user for values of nick, server, port, and password." 2145 "Prompt the user for values of nick, server, port, and password."
2146 (let (user-input server port nick passwd) 2146 (let (user-input server port nick passwd)
2147 (setq user-input (read-from-minibuffer 2147 (setq user-input (read-string
2148 "IRC server: " 2148 "IRC server: "
2149 (erc-compute-server) nil nil 'erc-server-history-list)) 2149 (erc-compute-server) 'erc-server-history-list))
2150 2150
2151 (if (string-match "\\(.*\\):\\(.*\\)\\'" user-input) 2151 (if (string-match "\\(.*\\):\\(.*\\)\\'" user-input)
2152 (setq port (erc-string-to-port (match-string 2 user-input)) 2152 (setq port (erc-string-to-port (match-string 2 user-input))
2153 user-input (match-string 1 user-input)) 2153 user-input (match-string 1 user-input))
2154 (setq port 2154 (setq port
2155 (erc-string-to-port (read-from-minibuffer 2155 (erc-string-to-port (read-string
2156 "IRC port: " (erc-port-to-string 2156 "IRC port: " (erc-port-to-string
2157 (erc-compute-port)))))) 2157 (erc-compute-port))))))
2158 2158
@@ -2161,13 +2161,12 @@ parameters SERVER and NICK."
2161 user-input (match-string 2 user-input)) 2161 user-input (match-string 2 user-input))
2162 (setq nick 2162 (setq nick
2163 (if (erc-already-logged-in server port nick) 2163 (if (erc-already-logged-in server port nick)
2164 (read-from-minibuffer 2164 (read-string
2165 (erc-format-message 'nick-in-use ?n nick) 2165 (erc-format-message 'nick-in-use ?n nick)
2166 nick 2166 nick 'erc-nick-history-list)
2167 nil nil 'erc-nick-history-list) 2167 (read-string
2168 (read-from-minibuffer
2169 "Nickname: " (erc-compute-nick nick) 2168 "Nickname: " (erc-compute-nick nick)
2170 nil nil 'erc-nick-history-list)))) 2169 'erc-nick-history-list))))
2171 2170
2172 (setq server user-input) 2171 (setq server user-input)
2173 2172
@@ -2186,10 +2185,9 @@ parameters SERVER and NICK."
2186 ;; bnc with the same nick. actually it would be nice to have 2185 ;; bnc with the same nick. actually it would be nice to have
2187 ;; bncs transparent, so that erc-compute-buffer-name displays 2186 ;; bncs transparent, so that erc-compute-buffer-name displays
2188 ;; the server one is connected to. 2187 ;; the server one is connected to.
2189 (setq nick (read-from-minibuffer 2188 (setq nick (read-string
2190 (erc-format-message 'nick-in-use ?n nick) 2189 (erc-format-message 'nick-in-use ?n nick)
2191 nick 2190 nick 'erc-nick-history-list)))
2192 nil nil 'erc-nick-history-list)))
2193 (list :server server :port port :nick nick :password passwd))) 2191 (list :server server :port port :nick nick :password passwd)))
2194 2192
2195;;;###autoload 2193;;;###autoload
@@ -3511,7 +3509,7 @@ The type of query window/frame/etc will depend on the value of
3511If USER is omitted, close the current query buffer if one exists 3509If USER is omitted, close the current query buffer if one exists
3512- except this is broken now ;-)" 3510- except this is broken now ;-)"
3513 (interactive 3511 (interactive
3514 (list (read-from-minibuffer "Start a query with: " nil))) 3512 (list (read-string "Start a query with: ")))
3515 (let ((session-buffer (erc-server-buffer)) 3513 (let ((session-buffer (erc-server-buffer))
3516 (erc-join-buffer erc-query-display)) 3514 (erc-join-buffer erc-query-display))
3517 (if user 3515 (if user
@@ -4023,8 +4021,7 @@ If FACE is non-nil, it will be used to propertize the prompt. If it is nil,
4023 "Interactively input a user action and send it to IRC." 4021 "Interactively input a user action and send it to IRC."
4024 (interactive "") 4022 (interactive "")
4025 (erc-set-active-buffer (current-buffer)) 4023 (erc-set-active-buffer (current-buffer))
4026 (let ((action (read-from-minibuffer 4024 (let ((action (read-string "Action: " nil 'erc-action-history-list)))
4027 "Action: " nil nil nil 'erc-action-history-list)))
4028 (if (not (string-match "^\\s-*$" action)) 4025 (if (not (string-match "^\\s-*$" action))
4029 (erc-send-action (erc-default-target) action)))) 4026 (erc-send-action (erc-default-target) action))))
4030 4027
@@ -4041,24 +4038,25 @@ If `point' is at the beginning of a channel name, use that as default."
4041 (completing-read (format-prompt "Join channel" chnl) 4038 (completing-read (format-prompt "Join channel" chnl)
4042 table nil nil nil nil chnl)) 4039 table nil nil nil nil chnl))
4043 (when (or current-prefix-arg erc-prompt-for-channel-key) 4040 (when (or current-prefix-arg erc-prompt-for-channel-key)
4044 (read-from-minibuffer "Channel key (RET for none): " nil)))) 4041 (read-string "Channel key (RET for none): "))))
4045 (erc-cmd-JOIN channel (when (>= (length key) 1) key))) 4042 (erc-cmd-JOIN channel (when (>= (length key) 1) key)))
4046 4043
4047(defun erc-part-from-channel (reason) 4044(defun erc-part-from-channel (reason)
4048 "Part from the current channel and prompt for a REASON." 4045 "Part from the current channel and prompt for a REASON."
4049 (interactive 4046 (interactive
4047 ;; FIXME: Has this ever worked? We're in the interactive-spec, so the
4048 ;; argument `reason' can't be in scope yet!
4049 ;;(if (and (boundp 'reason) (stringp reason) (not (string= reason "")))
4050 ;; reason
4050 (list 4051 (list
4051 (if (and (boundp 'reason) (stringp reason) (not (string= reason ""))) 4052 (read-string (concat "Reason for leaving " (erc-default-target) ": "))))
4052 reason
4053 (read-from-minibuffer (concat "Reason for leaving " (erc-default-target)
4054 ": ")))))
4055 (erc-cmd-PART (concat (erc-default-target)" " reason))) 4053 (erc-cmd-PART (concat (erc-default-target)" " reason)))
4056 4054
4057(defun erc-set-topic (topic) 4055(defun erc-set-topic (topic)
4058 "Prompt for a TOPIC for the current channel." 4056 "Prompt for a TOPIC for the current channel."
4059 (interactive 4057 (interactive
4060 (list 4058 (list
4061 (read-from-minibuffer 4059 (read-string
4062 (concat "Set topic of " (erc-default-target) ": ") 4060 (concat "Set topic of " (erc-default-target) ": ")
4063 (when erc-channel-topic 4061 (when erc-channel-topic
4064 (let ((ss (split-string erc-channel-topic "\C-o"))) 4062 (let ((ss (split-string erc-channel-topic "\C-o")))
@@ -4070,7 +4068,7 @@ If `point' is at the beginning of a channel name, use that as default."
4070(defun erc-set-channel-limit (&optional limit) 4068(defun erc-set-channel-limit (&optional limit)
4071 "Set a LIMIT for the current channel. Remove limit if nil. 4069 "Set a LIMIT for the current channel. Remove limit if nil.
4072Prompt for one if called interactively." 4070Prompt for one if called interactively."
4073 (interactive (list (read-from-minibuffer 4071 (interactive (list (read-string
4074 (format "Limit for %s (RET to remove limit): " 4072 (format "Limit for %s (RET to remove limit): "
4075 (erc-default-target))))) 4073 (erc-default-target)))))
4076 (let ((tgt (erc-default-target))) 4074 (let ((tgt (erc-default-target)))
@@ -4081,7 +4079,7 @@ Prompt for one if called interactively."
4081(defun erc-set-channel-key (&optional key) 4079(defun erc-set-channel-key (&optional key)
4082 "Set a KEY for the current channel. Remove key if nil. 4080 "Set a KEY for the current channel. Remove key if nil.
4083Prompt for one if called interactively." 4081Prompt for one if called interactively."
4084 (interactive (list (read-from-minibuffer 4082 (interactive (list (read-string
4085 (format "Key for %s (RET to remove key): " 4083 (format "Key for %s (RET to remove key): "
4086 (erc-default-target))))) 4084 (erc-default-target)))))
4087 (let ((tgt (erc-default-target))) 4085 (let ((tgt (erc-default-target)))
@@ -4092,7 +4090,7 @@ Prompt for one if called interactively."
4092(defun erc-quit-server (reason) 4090(defun erc-quit-server (reason)
4093 "Disconnect from current server after prompting for REASON. 4091 "Disconnect from current server after prompting for REASON.
4094`erc-quit-reason' works with this just like with `erc-cmd-QUIT'." 4092`erc-quit-reason' works with this just like with `erc-cmd-QUIT'."
4095 (interactive (list (read-from-minibuffer 4093 (interactive (list (read-string
4096 (format "Reason for quitting %s: " 4094 (format "Reason for quitting %s: "
4097 (or erc-server-announced-name 4095 (or erc-server-announced-name
4098 erc-session-server))))) 4096 erc-session-server)))))