"Function used for `completion-at-point-functions' in `rcirc-mode'."
(and (rcirc-looking-at-input)
(let* ((beg (save-excursion
- (if (re-search-backward " " rcirc-prompt-end-marker t)
+ ;; On some networks it is common to message or
+ ;; mention someone using @nick instead of just
+ ;; nick.
+ (if (re-search-backward "[[:space:]@]" rcirc-prompt-end-marker t)
(1+ (point))
rcirc-prompt-end-marker)))
(table (if (and (= beg rcirc-prompt-end-marker)
(defun rcirc-complete ()
"Cycle through completions from list of nicks in channel or IRC commands.
-IRC command completion is performed only if '/' is the first input char."
+IRC command completion is performed only if `/' is the first input char."
(interactive)
(unless (rcirc-looking-at-input)
(error "Point not located after rcirc prompt"))
(t . "%fp*** %fs%n %r %m"))
"An alist of formats used for printing responses.
The format is looked up using the response-type as a key;
-if no match is found, the default entry (with a key of `t') is used.
+if no match is found, the default entry (with a key of t) is used.
The entry's value part should be a string, which is inserted with
the of the following escape sequences replaced by the described values:
(goto-char overlay-arrow-position)
(message "No unread messages")))
-(defun rcirc-non-irc-buffer ()
- (let ((buflist (buffer-list))
- buffer)
- (while (and buflist (not buffer))
- (with-current-buffer (car buflist)
- (unless (or (eq major-mode 'rcirc-mode)
- (= ?\s (aref (buffer-name) 0)) ; internal buffers
- (get-buffer-window (current-buffer)))
- (setq buffer (current-buffer))))
- (setq buflist (cdr buflist)))
- buffer))
+(defun rcirc-bury-buffers ()
+ "Bury all RCIRC buffers."
+ (interactive)
+ (dolist (buf (buffer-list))
+ (when (eq 'rcirc-mode (with-current-buffer buf major-mode))
+ (bury-buffer buf) ; buffers not shown
+ (quit-windows-on buf)))) ; buffers shown in a window
(defun rcirc-next-active-buffer (arg)
"Switch to the next rcirc buffer with activity.
(switch-to-buffer (car (if arg lopri hipri)))
(when (> (point) rcirc-prompt-start-marker)
(recenter -1)))
- (if (eq major-mode 'rcirc-mode)
- (switch-to-buffer (rcirc-non-irc-buffer))
- (message "%s" (concat
- "No IRC activity."
- (when lopri
- (concat
- " Type C-u "
- (key-description (this-command-keys))
- " for low priority activity."))))))))
+ (rcirc-bury-buffers)
+ (message "No IRC activity.%s"
+ (if lopri
+ (concat
+ " Type C-u " (key-description (this-command-keys))
+ " for low priority activity.")
+ "")))))
(define-obsolete-variable-alias 'rcirc-activity-hooks
'rcirc-activity-functions "24.3")
,interactive-form
(let ((process (or process (rcirc-buffer-process)))
(target (or target rcirc-target)))
+ (ignore target) ; mark `target' variable as ignorable
,@body))))
(defun-rcirc-command msg (message)
(cond ((rcirc-channel-p target)
target)
;;; -ChanServ- [#gnu] Welcome...
- ((string-match "\\[\\(#[^\] ]+\\)\\]" message)
+ ((string-match "\\[\\(#[^] ]+\\)\\]" message)
(match-string 1 message))
(sender
(if (string= sender (rcirc-server-name process))
(defun rcirc-handler-KICK (process sender args _text)
(let* ((channel (car args))
(nick (cadr args))
- (reason (cl-caddr args))
+ (reason (nth 2 args))
(message (concat nick " " channel " " reason)))
(rcirc-print process sender "KICK" channel message t)
;; print in private chat buffer if it exists
"RPL_AWAY"
(let* ((nick (cadr args))
(rec (assoc-string nick rcirc-nick-away-alist))
- (away-message (cl-caddr args)))
+ (away-message (nth 2 args)))
(when (or (not rec)
(not (string= (cdr rec) away-message)))
;; away message has changed
(let ((buffer (or (rcirc-get-buffer process (cadr args))
(rcirc-get-temp-buffer-create process (cadr args)))))
(with-current-buffer buffer
- (setq rcirc-topic (cl-caddr args)))))
+ (setq rcirc-topic (nth 2 args)))))
(defun rcirc-handler-333 (process sender args _text)
"333 says who set the topic and when.
(let ((buffer (or (rcirc-get-buffer process (cadr args))
(rcirc-get-temp-buffer-create process (cadr args)))))
(with-current-buffer buffer
- (let ((setter (cl-caddr args))
+ (let ((setter (nth 2 args))
(time (current-time-string
(seconds-to-time
(string-to-number (cl-cadddr args))))))
(defun rcirc-handler-477 (process sender args _text)
"ERR_NOCHANMODES"
- (rcirc-print process sender "477" (cadr args) (cl-caddr args)))
+ (rcirc-print process sender "477" (cadr args) (nth 2 args)))
(defun rcirc-handler-MODE (process sender args _text)
(let ((target (car args))
(dolist (i rcirc-authinfo)
(let ((process (rcirc-buffer-process))
(server (car i))
- (nick (cl-caddr i))
+ (nick (nth 2 i))
(method (cadr i))
(args (cl-cdddr i)))
(when (and (string-match server rcirc-server))