Function: mpc-tagbrowser

mpc-tagbrowser is an interactive and byte-compiled function defined in mpc.el.gz.

Signature

(mpc-tagbrowser TAG)

Documentation

Create a new browser for TAG.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mpc.el.gz
(defun mpc-tagbrowser (tag)
  "Create a new browser for TAG."
  (interactive
   (list
    (let ((completion-ignore-case t))
      (intern
       (completing-read "Tag: " tag-browser-tagtypes nil 'require-match)))))
  (let* ((newbuf (mpc-tagbrowser-buf tag))
         (win (get-buffer-window newbuf 0)))
    (if win (select-window win)
      (if (with-current-buffer (window-buffer)
            (derived-mode-p 'mpc-tagbrowser-mode))
          (setq win (selected-window))
        ;; Find a tagbrowser-mode buffer.
        (let ((buffers (process-get (mpc-proc) 'buffers))
              buffer)
          (while
              (and buffers
                   (not (and (buffer-live-p (setq buffer (cdr (pop buffers))))
                             (with-current-buffer buffer
                               (derived-mode-p 'mpc-tagbrowser-mode))
                             (setq win (get-buffer-window buffer 0))))))))
      (if (not win)
          (pop-to-buffer newbuf)
        (setq win (split-window win nil 'horiz))
        (set-window-buffer win newbuf)
        (set-window-dedicated-p win 'soft)
        (select-window win)
        (balance-windows-area)))))