X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/59c414b1d0a01acff2bdc5e8ee6b76b0ee5aac3d..1b76d9168336ede8976b980aeaed64ae2908501a:/lisp/net/rcirc.el diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 74d03f59f3..55b43f6396 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -1,6 +1,6 @@ ;;; rcirc.el --- default, simple IRC client -*- lexical-binding: t; -*- -;; Copyright (C) 2005-2015 Free Software Foundation, Inc. +;; Copyright (C) 2005-2016 Free Software Foundation, Inc. ;; Author: Ryan Yeske ;; Maintainers: Ryan Yeske , @@ -320,7 +320,7 @@ Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT." (defcustom rcirc-decode-coding-system 'utf-8 "Coding system used to decode incoming irc messages. -Set to 'undecided if you want the encoding of the incoming +Set to `undecided' if you want the encoding of the incoming messages autodetected." :type 'coding-system :group 'rcirc) @@ -904,7 +904,10 @@ The list is updated automatically by `defun-rcirc-command'.") "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) @@ -923,7 +926,7 @@ The list is updated automatically by `defun-rcirc-command'.") (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")) @@ -1372,7 +1375,7 @@ if ARG is omitted or nil." (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: @@ -1924,17 +1927,13 @@ Uninteresting lines are those whose responses are listed in (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. @@ -1949,15 +1948,13 @@ With prefix ARG, go to the next low priority 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") @@ -2167,6 +2164,7 @@ activity. Only run if the buffer is not visible and ,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) @@ -2602,7 +2600,7 @@ If ARG is given, opens the URL in a new browser window." (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)) @@ -2693,7 +2691,7 @@ the only argument." (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 @@ -2777,7 +2775,7 @@ the only argument." "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 @@ -2806,7 +2804,7 @@ the only argument." (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. @@ -2814,7 +2812,7 @@ Not in rfc1459.txt" (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)))))) @@ -2823,7 +2821,7 @@ Not in rfc1459.txt" (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)) @@ -2883,7 +2881,7 @@ Passwords are stored in `rcirc-authinfo' (which see)." (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))