;; one-to-one communication.
;; Rcirc has simple defaults and clear and consistent behavior.
-;; Message arrival timestamps, activity notification on the modeline,
+;; Message arrival timestamps, activity notification on the mode line,
;; message filling, nick completion, and keepalive pings are all
;; enabled by default, but can easily be adjusted or turned off. Each
;; discussion takes place in its own buffer and there is a single
:type 'string
:group 'rcirc)
+(defcustom rcirc-kill-channel-buffers nil
+ "When non-nil, kill channel buffers when the server buffer is killed.
+Only the channel buffers associated with the server in question
+will be killed."
+ :version "24.3"
+ :type 'boolean
+ :group 'rcirc)
+
(defvar rcirc-nick nil)
(defvar rcirc-prompt-start-marker nil)
"List of buffers with unviewed activity.")
(defvar rcirc-activity-string ""
- "String displayed in modeline representing `rcirc-activity'.")
+ "String displayed in mode line representing `rcirc-activity'.")
(put 'rcirc-activity-string 'risky-local-variable t)
(defvar rcirc-server-buffer nil
rcirc-default-full-name))
(channels (plist-get (cdr c) :channels))
(password (plist-get (cdr c) :password))
- (encryption (plist-get (cdr c) :encryption)))
+ (encryption (plist-get (cdr c) :encryption))
+ contact)
(when server
(let (connected)
(dolist (p (rcirc-process-list))
full-name channels password encryption)
(quit (message "Quit connecting to %s" server)))
(with-current-buffer (process-buffer connected)
- (setq connected-servers
- (cons (process-contact (get-buffer-process
- (current-buffer)) :host)
- connected-servers))))))))
+ (setq contact (process-contact
+ (get-buffer-process (current-buffer)) :host))
+ (setq connected-servers
+ (cons (if (stringp contact) contact server)
+ connected-servers))))))))
(when connected-servers
(message "Already connected to %s"
(if (cdr connected-servers)
:group 'rcirc)
(defun rcirc-kill-buffer-hook ()
- "Part the channel when killing an rcirc buffer."
+ "Part the channel when killing an rcirc buffer.
+
+If `rcirc-kill-channel-buffers' is non-nil and the killed buffer
+is a server buffer, kills all of the channel buffers associated
+with it."
(when (eq major-mode 'rcirc-mode)
(when (and rcirc-log-flag
rcirc-log-directory)
(rcirc-log-write))
- (rcirc-clean-up-buffer "Killed buffer")))
+ (rcirc-clean-up-buffer "Killed buffer")
+ (when (and rcirc-buffer-alist ;; it's a server buffer
+ rcirc-kill-channel-buffers)
+ (dolist (channel rcirc-buffer-alist)
+ (kill-buffer (cdr channel))))))
(defun rcirc-change-major-mode-hook ()
"Part the channel when changing the major-mode."
(buffer-disable-undo)
(buffer-enable-undo))
- ;; record modeline activity
+ ;; record mode line activity
(when (and activity
(not rcirc-ignore-buffer-activity-flag)
(not (and rcirc-dim-nicks sender
buffers ","))
(defun rcirc-short-buffer-name (buffer)
- "Return a short name for BUFFER to use in the modeline indicator."
+ "Return a short name for BUFFER to use in the mode line indicator."
(with-current-buffer buffer
(or rcirc-short-buffer-name (buffer-name))))
(let ((channel (if (> (length channel) 0) channel target)))
(rcirc-send-string process (concat "PART " channel " :" rcirc-id-string))))
-(defun-rcirc-command quit (reason all)
- "Send a quit message to server with REASON.
-When called with prefix, quit all servers."
- (interactive "sQuit reason: \nP")
- (dolist (p (if all
- (rcirc-process-list)
- (list process)))
- (rcirc-send-string p (concat "QUIT :"
- (if (not (zerop (length reason)))
- reason
- rcirc-id-string)))))
+(defun-rcirc-command quit (reason)
+ "Send a quit message to server with REASON."
+ (interactive "sQuit reason: ")
+ (rcirc-send-string process (concat "QUIT :"
+ (if (not (zerop (length reason)))
+ reason
+ rcirc-id-string))))
(defun-rcirc-command nick (nick)
"Change nick to NICK."
:group 'faces)
(defface rcirc-my-nick ; font-lock-function-name-face
- '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
- (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
- (t (:inverse-video t :weight bold)))
- "The face used to highlight my messages."
+ '((((class color) (min-colors 88) (background light)) :foreground "Blue1")
+ (((class color) (min-colors 88) (background dark)) :foreground "LightSkyBlue")
+ (((class color) (min-colors 16) (background light)) :foreground "Blue")
+ (((class color) (min-colors 16) (background dark)) :foreground "LightSkyBlue")
+ (((class color) (min-colors 8)) :foreground "blue" :weight bold)
+ (t :inverse-video t :weight bold))
+ "Rcirc face for my messages."
:group 'rcirc-faces)
(defface rcirc-other-nick ; font-lock-variable-name-face
'((((class grayscale) (background light))
- (:foreground "Gray90" :weight bold :slant italic))
+ :foreground "Gray90" :weight bold :slant italic)
(((class grayscale) (background dark))
- (:foreground "DimGray" :weight bold :slant italic))
- (((class color) (min-colors 88) (background light)) (:foreground "DarkGoldenrod"))
- (((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod"))
- (((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
- (((class color) (min-colors 8)) (:foreground "yellow" :weight light))
- (t (:weight bold :slant italic)))
- "The face used to highlight other messages."
+ :foreground "DimGray" :weight bold :slant italic)
+ (((class color) (min-colors 88) (background light)) :foreground "DarkGoldenrod")
+ (((class color) (min-colors 88) (background dark)) :foreground "LightGoldenrod")
+ (((class color) (min-colors 16) (background light)) :foreground "DarkGoldenrod")
+ (((class color) (min-colors 16) (background dark)) :foreground "LightGoldenrod")
+ (((class color) (min-colors 8)) :foreground "yellow" :weight light)
+ (t :weight bold :slant italic))
+ "Rcirc face for other users' messages."
:group 'rcirc-faces)
(defface rcirc-bright-nick
'((((class grayscale) (background light))
- (:foreground "LightGray" :weight bold :underline t))
+ :foreground "LightGray" :weight bold :underline t)
(((class grayscale) (background dark))
- (:foreground "Gray50" :weight bold :underline t))
- (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
- (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
- (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
- (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
- (((class color) (min-colors 8)) (:foreground "magenta"))
- (t (:weight bold :underline t)))
- "Face used for nicks matched by `rcirc-bright-nicks'."
+ :foreground "Gray50" :weight bold :underline t)
+ (((class color) (min-colors 88) (background light)) :foreground "CadetBlue")
+ (((class color) (min-colors 88) (background dark)) :foreground "Aquamarine")
+ (((class color) (min-colors 16) (background light)) :foreground "CadetBlue")
+ (((class color) (min-colors 16) (background dark)) :foreground "Aquamarine")
+ (((class color) (min-colors 8)) :foreground "magenta")
+ (t :weight bold :underline t))
+ "Rcirc face for nicks matched by `rcirc-bright-nicks'."
:group 'rcirc-faces)
(defface rcirc-dim-nick
'((t :inherit default))
- "Face used for nicks in `rcirc-dim-nicks'."
+ "Rcirc face for nicks in `rcirc-dim-nicks'."
:group 'rcirc-faces)
(defface rcirc-server ; font-lock-comment-face
'((((class grayscale) (background light))
- (:foreground "DimGray" :weight bold :slant italic))
+ :foreground "DimGray" :weight bold :slant italic)
(((class grayscale) (background dark))
- (:foreground "LightGray" :weight bold :slant italic))
+ :foreground "LightGray" :weight bold :slant italic)
(((class color) (min-colors 88) (background light))
- (:foreground "Firebrick"))
+ :foreground "Firebrick")
(((class color) (min-colors 88) (background dark))
- (:foreground "chocolate1"))
+ :foreground "chocolate1")
(((class color) (min-colors 16) (background light))
- (:foreground "red"))
+ :foreground "red")
(((class color) (min-colors 16) (background dark))
- (:foreground "red1"))
- (((class color) (min-colors 8) (background light))
- )
- (((class color) (min-colors 8) (background dark))
- )
- (t (:weight bold :slant italic)))
- "The face used to highlight server messages."
+ :foreground "red1")
+ (((class color) (min-colors 8) (background light)))
+ (((class color) (min-colors 8) (background dark)))
+ (t :weight bold :slant italic))
+ "Rcirc face for server messages."
:group 'rcirc-faces)
(defface rcirc-server-prefix ; font-lock-comment-delimiter-face
:foreground "red")
(((class color) (min-colors 8) (background dark))
:foreground "red1"))
- "The face used to highlight server prefixes."
+ "Rcirc face for server prefixes."
:group 'rcirc-faces)
(defface rcirc-timestamp
- '((t (:inherit default)))
- "The face used to highlight timestamps."
+ '((t :inherit default))
+ "Rcirc face for timestamps."
:group 'rcirc-faces)
(defface rcirc-nick-in-message ; font-lock-keyword-face
- '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
- (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
- (((class color) (min-colors 88) (background light)) (:foreground "Purple"))
- (((class color) (min-colors 88) (background dark)) (:foreground "Cyan1"))
- (((class color) (min-colors 16) (background light)) (:foreground "Purple"))
- (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
- (((class color) (min-colors 8)) (:foreground "cyan" :weight bold))
- (t (:weight bold)))
- "The face used to highlight instances of your nick within messages."
+ '((((class grayscale) (background light)) :foreground "LightGray" :weight bold)
+ (((class grayscale) (background dark)) :foreground "DimGray" :weight bold)
+ (((class color) (min-colors 88) (background light)) :foreground "Purple")
+ (((class color) (min-colors 88) (background dark)) :foreground "Cyan1")
+ (((class color) (min-colors 16) (background light)) :foreground "Purple")
+ (((class color) (min-colors 16) (background dark)) :foreground "Cyan")
+ (((class color) (min-colors 8)) :foreground "cyan" :weight bold)
+ (t :weight bold))
+ "Rcirc face for instances of your nick within messages."
:group 'rcirc-faces)
-(defface rcirc-nick-in-message-full-line
- '((t (:bold t)))
- "The face used emphasize the entire message when your nick is mentioned."
+(defface rcirc-nick-in-message-full-line '((t :weight bold))
+ "Rcirc face for emphasizing the entire message when your nick is mentioned."
:group 'rcirc-faces)
(defface rcirc-prompt ; comint-highlight-prompt
- '((((min-colors 88) (background dark)) (:foreground "cyan1"))
- (((background dark)) (:foreground "cyan"))
- (t (:foreground "dark blue")))
- "The face used to highlight prompts."
+ '((((min-colors 88) (background dark)) :foreground "cyan1")
+ (((background dark)) :foreground "cyan")
+ (t :foreground "dark blue"))
+ "Rcirc face for prompts."
:group 'rcirc-faces)
(defface rcirc-track-nick
- '((((type tty)) (:inherit default))
- (t (:inverse-video t)))
- "The face used in the mode-line when your nick is mentioned."
+ '((((type tty)) :inherit default)
+ (t :inverse-video t))
+ "Rcirc face used in the mode-line when your nick is mentioned."
:group 'rcirc-faces)
-(defface rcirc-track-keyword
- '((t (:bold t )))
- "The face used in the mode-line when keywords are mentioned."
+(defface rcirc-track-keyword '((t :weight bold))
+ "Rcirc face used in the mode-line when keywords are mentioned."
:group 'rcirc-faces)
-(defface rcirc-url
- '((t (:bold t)))
- "The face used to highlight urls."
+(defface rcirc-url '((t :weight bold))
+ "Rcirc face used to highlight urls."
:group 'rcirc-faces)
-(defface rcirc-keyword
- '((t (:inherit highlight)))
- "The face used to highlight keywords."
+(defface rcirc-keyword '((t :inherit highlight))
+ "Rcirc face used to highlight keywords."
:group 'rcirc-faces)
\f