* erc/erc.el (erc-open-server-buffer-p): Actually use the `buffer' arg.
* erc/erc-backend.el (erc-server-process-alive): Take optional `buffer' arg.
* erc/erc-button.el (erc-button-click-button, erc-button-press-button):
Mark unused arguments.
+2013-09-19 Glenn Morris <rgm@gnu.org>
+
+ * erc-button.el (erc-button-click-button, erc-button-press-button):
+ Mark unused arguments.
+
+ * erc.el (erc-open-server-buffer-p): Actually use the `buffer' arg.
+ * erc-backend.el (erc-server-process-alive): Take optional `buffer' arg.
+
2013-09-18 Glenn Morris <rgm@gnu.org>
* erc-button.el (erc-button-add-buttons): Remove unused local vars.
erc-server-ping-handler)
erc-server-ping-timer-alist)))))
-(defun erc-server-process-alive ()
- "Return non-nil when `erc-server-process' is open or running."
- (and erc-server-process
- (processp erc-server-process)
- (memq (process-status erc-server-process) '(run open))))
+(defun erc-server-process-alive (&optional buffer)
+ "Return non-nil when BUFFER has an `erc-server-process' open or running."
+ (with-current-buffer (or buffer (current-buffer))
+ (and erc-server-process
+ (processp erc-server-process)
+ (memq (process-status erc-server-process) '(run open)))))
;;;; Connecting to a server
;; Since Emacs runs this directly, rather than with
;; widget-button-click, we need to fake an extra arg in the
;; interactive spec.
-(defun erc-button-click-button (ignore event)
+(defun erc-button-click-button (_ignore event)
"Call `erc-button-press-button'."
(interactive "P\ne")
(save-excursion
;; XEmacs calls this via widget-button-press with a bunch of arguments
;; which we don't care about.
-(defun erc-button-press-button (&rest ignore)
+(defun erc-button-press-button (&rest _ignore)
"Check text at point for a callback function.
If the text at point has a `erc-callback' property,
call it with the value of the `erc-data' text property."
(and (eq major-mode 'erc-mode)
(null (erc-default-target)))))
-(defun erc-open-server-buffer-p (&optional buffer) ;FIXME: `buffer' is ignored!
+(defun erc-open-server-buffer-p (&optional buffer)
"Return non-nil if argument BUFFER is an ERC server buffer that
has an open IRC process.
If BUFFER is nil, the current buffer is used."
- (and (erc-server-buffer-p)
- (erc-server-process-alive)))
+ (and (erc-server-buffer-p buffer)
+ (erc-server-process-alive buffer)))
(defun erc-query-buffer-p (&optional buffer)
"Return non-nil if BUFFER is an ERC query buffer.