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 (buffer-local-value 'erc--mode-line-mode-string channel))
	     (topic (erc-controls-interpret
		     (with-current-buffer channel erc-channel-topic))))
         (when modes
           (speedbar-make-tag-line
            'angle ?m nil (list erc-speedbar--fmt-sentinel "Mode: %s" modes)
            modes nil nil 'erc-notice-face (1+ indent)))
	 (unless (string= topic "")
	   (speedbar-make-tag-line
            'angle ?t nil (list erc-speedbar--fmt-sentinel  "Topic: %s" topic)
            topic nil nil 'erc-notice-face
	    (1+ indent)))
         (unless (pcase erc-speedbar-hide-mode-topic
                   ('nil 'show)
                   ('headerline (null erc-header-line-format)))
           (save-excursion
             (goto-char (point-max))
             (forward-line (if (string= topic "") -1 -2))
             (put-text-property (pos-bol) (point-max) 'invisible t)))
	 (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) channel)))))))))
   ((string-search "-" text)
    (speedbar-change-expand-button-char ?+)
    (speedbar-delete-subblock indent))
   (t (error "Ooops... not sure what to do")))
  (speedbar-center-buffer-smartly))