"If non-nil, activity in this buffer is considered low priority.")
(make-variable-buffer-local 'rcirc-low-priority-flag)
-(defvar rcirc-omit-mode nil
- "Non-nil if Rcirc-Omit mode is enabled.
-Use the command `rcirc-omit-mode' to change this variable.")
-(make-variable-buffer-local 'rcirc-omit-mode)
+(defcustom rcirc-omit-responses
+ '("JOIN" "PART" "QUIT" "NICK")
+ "Responses which will be hidden when `rcirc-omit-mode' is enabled."
+ :type '(repeat string)
+ :group 'rcirc)
+
+(define-minor-mode rcirc-omit-mode
+ "Toggle the hiding of \"uninteresting\" lines.
+With a prefix argument ARG, enable Rcirc-Omit mode if ARG is
+positive, and disable it otherwise. If called from Lisp, enable
+the mode if ARG is omitted or nil.
+
+Uninteresting lines are those whose responses are listed in
+`rcirc-omit-responses'."
+ nil " Omit" nil
+ (if rcirc-omit-mode
+ (progn
+ (add-to-invisibility-spec '(rcirc-omit . nil))
+ (message "Rcirc-Omit mode enabled"))
+ (remove-from-invisibility-spec '(rcirc-omit . nil))
+ (message "Rcirc-Omit mode disabled"))
+ (dolist (window (get-buffer-window-list (current-buffer)))
+ (with-selected-window window
+ (recenter (when (> (point) rcirc-prompt-start-marker) -1)))))
(defcustom rcirc-time-format "%H:%M "
"Describes how timestamps are printed.
:value-type string)
:group 'rcirc)
-(defcustom rcirc-omit-responses
- '("JOIN" "PART" "QUIT" "NICK")
- "Responses which will be hidden when `rcirc-omit-mode' is enabled."
- :type '(repeat string)
- :group 'rcirc)
-
(defun rcirc-format-response-string (process sender response target text)
"Return a nicely-formatted response string, incorporating TEXT
\(and perhaps other arguments). The specific formatting used
(or (assq 'rcirc-low-priority-flag minor-mode-alist)
(setq minor-mode-alist
(cons '(rcirc-low-priority-flag " LowPri") minor-mode-alist)))
-(or (assq 'rcirc-omit-mode minor-mode-alist)
- (setq minor-mode-alist
- (cons '(rcirc-omit-mode " Omit") minor-mode-alist)))
(defun rcirc-toggle-ignore-buffer-activity ()
"Toggle the value of `rcirc-ignore-buffer-activity-flag'."
"Activity in this buffer is normal priority"))
(force-mode-line-update))
-(defun rcirc-omit-mode ()
- "Toggle the Rcirc-Omit mode.
-If enabled, \"uninteresting\" lines are not shown.
-Uninteresting lines are those whose responses are listed in
-`rcirc-omit-responses'."
- (interactive)
- (setq rcirc-omit-mode (not rcirc-omit-mode))
- (if rcirc-omit-mode
- (progn
- (add-to-invisibility-spec '(rcirc-omit . nil))
- (message "Rcirc-Omit mode enabled"))
- (remove-from-invisibility-spec '(rcirc-omit . nil))
- (message "Rcirc-Omit mode disabled"))
- (dolist (window (get-buffer-window-list (current-buffer)))
- (with-selected-window window
- (recenter (when (> (point) rcirc-prompt-start-marker) -1)))))
-
(defun rcirc-switch-to-server-buffer ()
"Switch to the server buffer associated with current channel buffer."
(interactive)