Function: erc-speedbar-expand-channel
erc-speedbar-expand-channel is a byte-compiled function defined in
erc-speedbar.el.gz.
Signature
(erc-speedbar-expand-channel TEXT CHANNEL INDENT)
Documentation
For the line matching TEXT, in CHANNEL, expand or contract a line.
INDENT is the current indentation level.
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc-speedbar.el.gz
(defun erc-speedbar-expand-channel (text channel indent)
"For the line matching TEXT, in CHANNEL, expand or contract a line.
INDENT is the current indentation level."
(cond
((string-search "+" text)
(speedbar-change-expand-button-char ?-)
(speedbar-with-writable
(save-excursion
(end-of-line) (forward-char 1)
(let ((modes (with-current-buffer channel
(concat (apply #'concat
erc-channel-modes)
(cond
((and erc-channel-user-limit
erc-channel-key)
(if erc-show-channel-key-p
(format "lk %.0f %s"
erc-channel-user-limit
erc-channel-key)
(format "kl %.0f" erc-channel-user-limit)))
(erc-channel-user-limit
;; Emacs has no bignums
(format "l %.0f" erc-channel-user-limit))
(erc-channel-key
(if erc-show-channel-key-p
(format "k %s" erc-channel-key)
"k"))
(t "")))))
(topic (erc-controls-interpret
(with-current-buffer channel erc-channel-topic))))
(speedbar-make-tag-line
'angle ?i nil nil
(concat "Modes: +" modes) nil nil nil
(1+ indent))
(unless (string= topic "")
(speedbar-make-tag-line
'angle ?i nil nil
(concat "Topic: " topic) nil nil nil
(1+ indent)))
(let ((names (cond ((eq erc-speedbar-sort-users-type 'alphabetical)
(erc-sort-channel-users-alphabetically
(with-current-buffer channel
(erc-get-channel-user-list))))
((eq erc-speedbar-sort-users-type 'activity)
(erc-sort-channel-users-by-activity
(with-current-buffer channel
(erc-get-channel-user-list))))
(t (with-current-buffer channel
(erc-get-channel-user-list))))))
(when names
(speedbar-with-writable
(dolist (entry names)
(erc-speedbar-insert-user entry ?+ (1+ indent))))))))))
((string-search "-" text)
(speedbar-change-expand-button-char ?+)
(speedbar-delete-subblock indent))
(t (error "Ooops... not sure what to do")))
(speedbar-center-buffer-smartly))