Function: rcirc-get-buffer-create

rcirc-get-buffer-create is a byte-compiled function defined in rcirc.el.gz.

Signature

(rcirc-get-buffer-create PROCESS TARGET)

Documentation

Return the buffer associated with the PROCESS and TARGET.

Create the buffer if it doesn't exist.

Source Code

;; Defined in /usr/src/emacs/lisp/net/rcirc.el.gz
(defun rcirc-get-buffer-create (process target)
  "Return the buffer associated with the PROCESS and TARGET.
Create the buffer if it doesn't exist."
  (let ((buffer (rcirc-get-buffer process target)))
    (if (and buffer (buffer-live-p buffer))
        (with-current-buffer buffer
          (when (not rcirc-target)
            (setq rcirc-target target))
          buffer)
      ;; create the buffer
      (with-rcirc-process-buffer process
        (let ((new-buffer (get-buffer-create
                           (rcirc-generate-new-buffer-name process target))))
          (with-current-buffer new-buffer
            (unless (eq major-mode 'rcirc-mode)
              (rcirc-mode process target))
            (setq mode-line-process nil))
          (rcirc-put-nick-channel process (rcirc-nick process) target
                                  rcirc-current-line)
          new-buffer)))))