window @code{rcirc} considers is controlled by the
@code{rcirc-omit-threshold} variable.
+@vindex rcirc-omit-unless-requested
+Certain messages can be omitted by default, unless the user manual
+requests them. For example, if you don't want to display @code{TOPIC}
+and @code{NAMES} messages, after reconnecting, you can configure
+@code{rcirc-omit-unless-requested} to hide:
+
+@example
+(setq rcirc-omit-unless-requested '("TOPIC" "NAMES"))
+@end example
+
+Now NAMES will only be displayed, after it has been requested via the
+@code{rcirc-cmd-name} command.
+
@node Hacking and Tweaking
@chapter Hacking and Tweaking
@cindex hacking and tweaking
(defvar-local rcirc-low-priority-flag nil
"Non-nil means activity in this buffer is considered low priority.")
+(defvar-local rcirc-pending-requests '()
+ "List of pending requests.
+See `rcirc-omit-unless-requested'.")
+
+(defcustom rcirc-omit-unless-requested '()
+ "List of commands to only be requested if preceded by a command.
+For example, if \"TOPIC\" is added to this list, TOPIC commands
+will only be displayed if `rcirc-cmd-TOPIC' was previously
+invoked. Commands will only be hidden if `rcirc-omit-mode' is
+enabled."
+ :version "28.1"
+ :type '(repeat string))
+
(defcustom rcirc-omit-responses
'("JOIN" "PART" "QUIT" "NICK")
"Responses which will be hidden when `rcirc-omit-mode' is enabled."
;; make text omittable
(let ((last-activity-lines (rcirc-elapsed-lines process sender target)))
(if (and (not (string= (rcirc-nick process) sender))
- (member response rcirc-omit-responses)
- (or (not last-activity-lines)
- (< rcirc-omit-threshold last-activity-lines)))
+ (or (member response rcirc-omit-responses)
+ (and (member response rcirc-omit-unless-requested)
+ (if (member response rcirc-pending-requests)
+ (ignore (setq rcirc-pending-requests
+ (delete response rcirc-pending-requests)))
+ t)))
+ (or (member response rcirc-omit-unless-requested)
+ (not last-activity-lines)
+ (< rcirc-omit-threshold last-activity-lines)))
(put-text-property (point-min) (point-max)
'invisible 'rcirc-omit)
;; otherwise increment the line count
(<= ,required (length ,argument) ,total)
(string-match ,regexp ,argument))
(user-error "Malformed input (%s): %S" ',command ,argument))
+ (push ,(upcase (symbol-name command)) rcirc-pending-requests)
(let ((process (or process (rcirc-buffer-process)))
(target (or target rcirc-target)))
(ignore target process)